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
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:
-
mosi pin connected to SDO of display miso pin connected to SDI of display sclk pin connected to RS of display cs pin connected to CS of display disp pin connected to DISP of display power pin 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:
-
value char 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,y upper left corner w width of bitmap h high of bitmap *bitmap pointer 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,y upper left corner w width of draw rect h high of draw rect *bitmap pointer to the bitmap data bmp_x,bmp_y upper left corner at BMP files bmp_w width of bitmap bmp_h high 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,y upper left corner w width of bitmap h high of bitmap *bitmap pointer 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,y upper left corner w width of draw rect h high of draw rect *bitmap pointer to the bitmap data bmp_x,bmp_y upper left corner at BMP files bmp_w width of bitmap bmp_h high 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,y position of upper left corner *filenameBMP name of the BMP file
- Return values:
-
1 succes 0 error
- 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:
-
x x-position of char (top left) y y-position c char 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,y0 center r radius color 4 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,y0 center r radius color 4 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,y0 top left corner x1,y1 down right corner color 4 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:
-
x0 horizontal start x1 horizontal stop y vertical position color 4 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,y0 start point x1,y1 stop point color 4 bit color
Definition at line 276 of file ColorMemLCD.cpp.
void locate | ( | int | x, |
int | y | ||
) | [virtual] |
setup cursor position
- Parameters:
-
x x-position (top left) y y-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:
-
x horizontal position y vertical position color 4 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:
-
x horizontal position y vertical position color 4 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,y0 top left corner x1,y1 down right corner color 4 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_cmd cmannd data line line of display
Definition at line 808 of file ColorMemLCD.cpp.
void set_font | ( | unsigned char * | f ) |
void setBlinkMode | ( | char | mode ) |
Command to blink.
- Parameters:
-
mode Blinking Mode or Inversion Mode
Definition at line 888 of file ColorMemLCD.cpp.
void setTransMode | ( | char | mode ) |
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:
-
x horizontal position y0 vertical start y1 vertical stop color 4 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:
-
x horizontal position y vertical position w window width in pixel h window height in pixels
Definition at line 87 of file ColorMemLCD.cpp.
Generated on Sun Jul 24 2022 21:55:57 by 1.7.2