A C12832 LCD with generic interface
Dependents: mbed_blinky HTTPClient_HelloWorld websocketandnode xbeerx ... more
Fork of C12832 by
C12832 Class Reference
#include <C12832.h>
Inherits GraphicsDisplay.
Public Member Functions | |
C12832 (PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char *name="LCD") | |
Create a C12832 object connected to SPI1. | |
virtual int | width () |
Get the width of the screen in pixel. | |
virtual int | height () |
Get the height of the screen in pixel. | |
virtual void | pixel (int x, int y, int colour) |
Draw a pixel at x,y black or white. | |
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 | 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. | |
void | copy_to_lcd (void) |
Copy display buffer to LCD. | |
void | set_contrast (unsigned int o) |
Set the orienation of the screen. | |
unsigned int | get_contrast (void) |
Read the contrast level. | |
void | invert (unsigned int o) |
Invert the screen. | |
virtual void | cls (void) |
Clear the screen. | |
void | setmode (int mode) |
Set the drawing mode. | |
virtual int | columns (void) |
Return number if columns on TextDisplay\. | |
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 on given position out of the active font to the LCD. | |
virtual void | locate (int x, int y) |
Setup cursor position. | |
void | set_auto_up (unsigned int up) |
Setup auto update of screen. | |
unsigned int | get_auto_up (void) |
Get status of the auto update function. | |
void | set_font (unsigned char *f) |
Select the font to use. | |
void | print_bm (Bitmap bm, int x, int y) |
Print bitmap to buffer. | |
virtual bool | claim (FILE *stream) |
Redirect output from a stream (stoud, sterr) to display. | |
Data Fields | |
SPI | _spi |
Vars. | |
Protected Member Functions | |
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 | lcd_reset () |
Init the C12832 LCD controller. | |
void | wr_dat (unsigned char value) |
Write data to the LCD controller. | |
void | wr_cmd (unsigned char value) |
Write a command the LCD controller. |
Detailed Description
The C12832 class.
Definition at line 59 of file C12832.h.
Constructor & Destructor Documentation
C12832 | ( | PinName | mosi, |
PinName | sck, | ||
PinName | reset, | ||
PinName | a0, | ||
PinName | ncs, | ||
const char * | name = "LCD" |
||
) |
Create a C12832 object connected to SPI1.
Definition at line 31 of file C12832.cpp.
Member Function Documentation
int _putc | ( | int | value ) | [virtual] |
Put a char on the screen.
- Parameters:
-
value char to print
- Returns:
- printed char
Reimplemented from TextDisplay.
Definition at line 470 of file C12832.cpp.
void character | ( | int | x, |
int | y, | ||
int | c | ||
) | [virtual] |
Draw a character on given position out of the active font to the LCD.
- Parameters:
-
x x-position of char (top left) y y-position c char to print
Implements TextDisplay.
Definition at line 485 of file C12832.cpp.
void circle | ( | int | x, |
int | y, | ||
int | r, | ||
int | colour | ||
) |
Draw a circle.
- Parameters:
-
x0,y0 center r radius color - 1 set pixel, 0 erase pixel
Definition at line 324 of file C12832.cpp.
bool claim | ( | FILE * | stream ) | [virtual, inherited] |
Redirect output from a stream (stoud, sterr) to display.
- Parameters:
-
stream stream that shall be redirected to the TextDisplay
Definition at line 65 of file TextDisplay.cpp.
void cls | ( | void | ) | [virtual] |
int columns | ( | void | ) | [virtual] |
Return number if columns on TextDisplay\.
number of rows
Implements TextDisplay.
Definition at line 456 of file C12832.cpp.
void copy_to_lcd | ( | void | ) |
Copy display buffer to LCD.
Definition at line 158 of file C12832.cpp.
void fillcircle | ( | int | x, |
int | y, | ||
int | r, | ||
int | colour | ||
) |
Draw a filled circle.
- Parameters:
-
x0,y0 center r radius color - 1 set pixel, 0 erase pixel
Use circle with different radius, Can miss some pixels
Definition at line 432 of file C12832.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 - 1 set pixel, 0 erase pixel
Definition at line 299 of file C12832.cpp.
unsigned int get_auto_up | ( | void | ) |
Get status of the auto update function.
- Returns:
- if auto update is on
Definition at line 538 of file C12832.cpp.
unsigned int get_contrast | ( | void | ) |
Read the contrast level.
Definition at line 68 of file C12832.cpp.
int height | ( | ) | [virtual] |
Get the height of the screen in pixel.
- Returns:
- height of screen in pixel
Definition at line 47 of file C12832.cpp.
void hline | ( | int | x0, |
int | x1, | ||
int | y, | ||
int | colour | ||
) | [protected] |
Draw a horizontal line.
- Parameters:
-
x0 horizontal start x1 horizontal stop y vertical position color - 1 set pixel, 0 erase pixel
void invert | ( | unsigned int | o ) |
void lcd_reset | ( | ) | [protected] |
Init the C12832 LCD controller.
Definition at line 96 of file C12832.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 - 1 set pixel, 0 erase pixel
Definition at line 211 of file C12832.cpp.
void locate | ( | int | x, |
int | y | ||
) | [virtual] |
Setup cursor position.
- Parameters:
-
x x-position (top left) y y-position
Reimplemented from TextDisplay.
Definition at line 448 of file C12832.cpp.
void pixel | ( | int | x, |
int | y, | ||
int | colour | ||
) | [virtual] |
Draw a pixel at x,y black or white.
- Parameters:
-
x horizontal position y vertical position color - 1 set pixel, 0 erase pixel
Definition at line 140 of file C12832.cpp.
void print_bm | ( | Bitmap | bm, |
int | x, | ||
int | y | ||
) |
Print bitmap to buffer.
- Parameters:
-
bm Bitmap in flash x x start y y start
Definition at line 543 of file C12832.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 - 1 set pixel, 0 erase pixel
Definition at line 281 of file C12832.cpp.
int rows | ( | void | ) | [virtual] |
Calculate the max number of columns.
Depends on actual font size
- Returns:
- max column
Implements TextDisplay.
Definition at line 463 of file C12832.cpp.
void set_auto_up | ( | unsigned int | up ) |
Setup auto update of screen.
- Parameters:
-
up 1 = on , 0 = off
if switched off the program has to call copy_to_lcd() to update screen from framebuffer
Definition at line 532 of file C12832.cpp.
void set_contrast | ( | unsigned int | o ) |
Set the orienation of the screen.
Definition at line 61 of file C12832.cpp.
void set_font | ( | unsigned char * | f ) |
Select the font to use.
- Parameters:
-
f pointer to font array
font array can created with GLCD Font Creator from http://www.mikroe.com you have to add 4 parameter at the beginning of the font array to use:
- the number of byte / char
- the vertial size in pixel
- the horizontal size in pixel
- the number of byte per vertical line you also have to change the array to char[]
Definition at line 527 of file C12832.cpp.
void setmode | ( | int | mode ) |
void vline | ( | int | y0, |
int | y1, | ||
int | x, | ||
int | colour | ||
) | [protected] |
Draw a vertical line.
- Parameters:
-
x horizontal position y0 vertical start y1 vertical stop color - 1 set pixel, 0 erase pixel
int width | ( | ) | [virtual] |
Get the width of the screen in pixel.
- Returns:
- width of screen in pixel
Definition at line 41 of file C12832.cpp.
void wr_cmd | ( | unsigned char | value ) | [protected] |
Write a command the LCD controller.
- Parameters:
-
cmd,: command to be written
Definition at line 76 of file C12832.cpp.
void wr_dat | ( | unsigned char | value ) | [protected] |
Write data to the LCD controller.
- Parameters:
-
dat data written to LCD controller
Definition at line 86 of file C12832.cpp.
Field Documentation
Generated on Tue Jul 12 2022 14:46:23 by 1.7.2