A library for LPM013M126A – JDI Color Memory LCD. This library is an inherited class from the “GraphicDisplay”, and Its functions are similar to “C12832_lcd” or ”SPI_TFT” library.

Dependents:   Test_ColorMemLCD rIoTwear_LCD

Embed: (wiki syntax)

« Back to documentation index

ColorMemLCD Class Reference

ColorMemLCD Class Reference

A class for Color Memory LCD Library. More...

#include <ColorMemLCD.h>

Public Member Functions

 ColorMemLCD (PinName mosi, PinName miso, PinName sclk, PinName cs, PinName disp, PinName power, const char *name="TFT")
 Create a SPI_LCD object connected to SPI.
virtual int width ()
 Get the width of the screen in pixel.
virtual int height ()
 Get the height of the screen in pixel.
virtual void window (int x, int y, int w, int h)
 Set window region.
virtual void pixel (int x, int y, int colour)
 Set a pixel on the window memory.
virtual void pixel_alpha (int x, int y, int colour)
 Set a pixel on the window memory (alpha blend)
virtual void cls (void)
 Fill the window memory with background color.
void circle (int x, int y, int r, int colour)
 draw a circle
void fillcircle (int x, int y, int r, int colour)
 draw a filled circle
void hline (int x0, int x1, int y, int colour)
 draw a horizontal line
void vline (int y0, int y1, int x, int colour)
 draw a vertical line
void line (int x0, int y0, int x1, int y1, int colour)
 draw a 1 pixel line
void rect (int x0, int y0, int x1, int y1, int colour)
 draw a rect
void fillrect (int x0, int y0, int x1, int y1, int colour)
 draw a filled rect
virtual void locate (int x, int y)
 setup cursor position
virtual int columns (void)
 calculate the max number of char in a line
virtual int rows (void)
 calculate the max number of columns
virtual int _putc (int value)
 put a char on the screen
virtual void character (int x, int y, int c)
 draw a character of selected font
void set_font (unsigned char *f)
 select the font
void setTransMode (char mode)
 set transpalent effect
void Bitmap4bit (int x, int y, int w, int h, unsigned char *bitmap)
 set a bitmap on the window buffer
void Bitmap4bit (int x, int y, int w, int h, unsigned char *bitmap, int bmp_x, int bmp_y, int bmp_w, int bmp_h)
 set a bitmap on the window buffer
void Bitmap1bit (int x, int y, int w, int h, unsigned char *bitmap)
 set a bitmap on the window buffer
void Bitmap1bit (int x, int y, int w, int h, unsigned char *bitmap, int bmp_x, int bmp_y, int bmp_w, int bmp_h)
 set a bitmap on the window buffer
void update ()
 Transfer to the LCD from diaply buffer.
int BMP_24 (int x, int y, const char *filenameBMP)
 Transfer a 24 bit BMP to the LCD from filesytem.
void command_SetState ()
 Command for setting the state of LCD.
void command_AllClear ()
 Command to clear whole the LCD.
void setBlinkMode (char mode)
 Command to blink.
void polling ()
 Toggle the LCD polarity.
void symbol (unsigned int x, unsigned int y, unsigned char *symbol)
 draw a symbol of same format as "character"

Protected Member Functions

void sendLineCommand (char *line_cmd, int line)
 send command

Detailed Description

A class for Color Memory LCD Library.

Definition at line 67 of file ColorMemLCD.h.


Constructor & Destructor Documentation

ColorMemLCD ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  cs,
PinName  disp,
PinName  power,
const char *  name = "TFT" 
)

Create a SPI_LCD object connected to SPI.

Parameters:
mosipin connected to SDO of display
misopin connected to SDI of display
sclkpin connected to RS of display
cspin connected to CS of display
disppin connected to DISP of display
powerpin connected to POWER of display

Definition at line 31 of file ColorMemLCD.cpp.


Member Function Documentation

int _putc ( int  value ) [virtual]

put a char on the screen

Parameters:
valuechar to print
Returns:
printed char

Definition at line 411 of file ColorMemLCD.cpp.

void Bitmap1bit ( int  x,
int  y,
int  w,
int  h,
unsigned char *  bitmap 
)

set a bitmap on the window buffer

Parameters:
x,yupper left corner
wwidth of bitmap
hhigh of bitmap
*bitmappointer to the bitmap data
Remarks:
bitmap format 1 bit

Definition at line 578 of file ColorMemLCD.cpp.

void Bitmap1bit ( int  x,
int  y,
int  w,
int  h,
unsigned char *  bitmap,
int  bmp_x,
int  bmp_y,
int  bmp_w,
int  bmp_h 
)

set a bitmap on the window buffer

Parameters:
x,yupper left corner
wwidth of draw rect
hhigh of draw rect
*bitmappointer to the bitmap data
bmp_x,bmp_yupper left corner at BMP files
bmp_wwidth of bitmap
bmp_hhigh of bitmap
Remarks:
bitmap format 1 bit

Definition at line 585 of file ColorMemLCD.cpp.

void Bitmap4bit ( int  x,
int  y,
int  w,
int  h,
unsigned char *  bitmap 
)

set a bitmap on the window buffer

Parameters:
x,yupper left corner
wwidth of bitmap
hhigh of bitmap
*bitmappointer to the bitmap data
Remarks:
bitmap format 4 bit R1 G1 B1

Definition at line 528 of file ColorMemLCD.cpp.

void Bitmap4bit ( int  x,
int  y,
int  w,
int  h,
unsigned char *  bitmap,
int  bmp_x,
int  bmp_y,
int  bmp_w,
int  bmp_h 
)

set a bitmap on the window buffer

Parameters:
x,yupper left corner
wwidth of draw rect
hhigh of draw rect
*bitmappointer to the bitmap data
bmp_x,bmp_yupper left corner at BMP files
bmp_wwidth of bitmap
bmp_hhigh of bitmap
Remarks:
bitmap format 4 bit R1 G1 B1

Definition at line 535 of file ColorMemLCD.cpp.

int BMP_24 ( int  x,
int  y,
const char *  filenameBMP 
)

Transfer a 24 bit BMP to the LCD from filesytem.

Parameters:
x,yposition of upper left corner
*filenameBMPname of the BMP file
Return values:
1succes
0error
Remarks:
bitmap format 24 bit R8 G8 B8

Definition at line 671 of file ColorMemLCD.cpp.

void character ( int  x,
int  y,
int  c 
) [virtual]

draw a character of selected font

Parameters:
xx-position of char (top left)
yy-position
cchar to print

Definition at line 427 of file ColorMemLCD.cpp.

void circle ( int  x,
int  y,
int  r,
int  colour 
)

draw a circle

Parameters:
x0,y0center
rradius
color4 bit color

Definition at line 178 of file ColorMemLCD.cpp.

void cls ( void   ) [virtual]

Fill the window memory with background color.

Definition at line 171 of file ColorMemLCD.cpp.

int columns ( void   ) [virtual]

calculate the max number of char in a line

Returns:
max columns depends on actual font size

Definition at line 397 of file ColorMemLCD.cpp.

void command_AllClear (  )

Command to clear whole the LCD.

Definition at line 875 of file ColorMemLCD.cpp.

void command_SetState (  )

Command for setting the state of LCD.

Definition at line 862 of file ColorMemLCD.cpp.

void fillcircle ( int  x,
int  y,
int  r,
int  colour 
)

draw a filled circle

Parameters:
x0,y0center
rradius
color4 bit color

Definition at line 205 of file ColorMemLCD.cpp.

void fillrect ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

draw a filled rect

Parameters:
x0,y0top left corner
x1,y1down right corner
color4 bit color

Definition at line 366 of file ColorMemLCD.cpp.

int height (  ) [virtual]

Get the height of the screen in pixel.

Returns:
height of screen in pixel

Definition at line 80 of file ColorMemLCD.cpp.

void hline ( int  x0,
int  x1,
int  y,
int  colour 
)

draw a horizontal line

Parameters:
x0horizontal start
x1horizontal stop
yvertical position
color4 bit color

Definition at line 230 of file ColorMemLCD.cpp.

void line ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

draw a 1 pixel line

Parameters:
x0,y0start point
x1,y1stop point
color4 bit color

Definition at line 276 of file ColorMemLCD.cpp.

void locate ( int  x,
int  y 
) [virtual]

setup cursor position

Parameters:
xx-position (top left)
yy-position

Definition at line 389 of file ColorMemLCD.cpp.

void pixel ( int  x,
int  y,
int  colour 
) [virtual]

Set a pixel on the window memory.

Parameters:
xhorizontal position
yvertical position
color4 bit pixel color

Definition at line 129 of file ColorMemLCD.cpp.

void pixel_alpha ( int  x,
int  y,
int  colour 
) [virtual]

Set a pixel on the window memory (alpha blend)

Set a pixel - for transrucent mode.

Parameters:
xhorizontal position
yvertical position
color4 bit pixel color

Definition at line 151 of file ColorMemLCD.cpp.

void polling (  )

Toggle the LCD polarity.

Toggle the polarity at evry scecond.

Definition at line 844 of file ColorMemLCD.cpp.

void rect ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

draw a rect

Parameters:
x0,y0top left corner
x1,y1down right corner
color4 bit color

Definition at line 353 of file ColorMemLCD.cpp.

int rows ( void   ) [virtual]

calculate the max number of columns

Returns:
max columndepends on actual font size

Definition at line 404 of file ColorMemLCD.cpp.

void sendLineCommand ( char *  line_cmd,
int  line 
) [protected]

send command

send data packet

Parameters:
line_cmdcmannd data
lineline of display

Definition at line 808 of file ColorMemLCD.cpp.

void set_font ( unsigned char *  f )

select the font

Parameters:
fpointer to font array

Definition at line 514 of file ColorMemLCD.cpp.

void setBlinkMode ( char  mode )

Command to blink.

Parameters:
modeBlinking Mode or Inversion Mode

Definition at line 888 of file ColorMemLCD.cpp.

void setTransMode ( char  mode )

set transpalent effect

Parameters:
modetrans mode

Definition at line 521 of file ColorMemLCD.cpp.

void symbol ( unsigned int  x,
unsigned int  y,
unsigned char *  symbol 
)

draw a symbol of same format as "character"

Definition at line 477 of file ColorMemLCD.cpp.

void update (  )

Transfer to the LCD from diaply buffer.

Definition at line 639 of file ColorMemLCD.cpp.

void vline ( int  y0,
int  y1,
int  x,
int  colour 
)

draw a vertical line

Parameters:
xhorizontal position
y0vertical start
y1vertical stop
color4 bit color

Definition at line 253 of file ColorMemLCD.cpp.

int width (  ) [virtual]

Get the width of the screen in pixel.

Returns:
width of screen in pixel

Definition at line 73 of file ColorMemLCD.cpp.

void window ( int  x,
int  y,
int  w,
int  h 
) [virtual]

Set window region.

Parameters:
xhorizontal position
yvertical position
wwindow width in pixel
hwindow height in pixels

Definition at line 87 of file ColorMemLCD.cpp.