Initial commit
Fork of TextLCD by
TextLCD Class Reference
A TextLCD interface for driving 4-bit HD44780-based LCDs. More...
#include <TextLCD.h>
Public Types | |
enum | LCDType { LCD8x1, LCD8x2, LCD8x2B, LCD12x2, LCD12x4, LCD16x1, LCD16x2, LCD16x2B, LCD16x4, LCD20x2, LCD20x4, LCD24x2, LCD24x4, LCD40x2, LCD40x4 } |
LCD panel format. More... | |
enum | LCDCtrl { HD44780, WS0010, ST7036 } |
LCD Controller Device. More... | |
enum | LCDCursor { CurOff_BlkOff = 0x00, CurOn_BlkOff = 0x02, CurOff_BlkOn = 0x01, CurOn_BlkOn = 0x03 } |
LCD Cursor control. More... | |
enum | LCDMode { DispOff = 0x00, DispOn = 0x04 } |
LCD Display control. More... | |
enum | LCDBacklight { LightOff, LightOn } |
LCD Backlight control. More... | |
Public Member Functions | |
TextLCD (SPI *spi, PinName cs, PinName rs, LCDType type=LCD16x2, LCDCtrl ctrl=HD44780) | |
Create a TextLCD interface using an SPI 74595 portexpander. | |
int | putc (int c) |
Write a character to the LCD. | |
int | printf (const char *format,...) |
Write a formated string to the LCD. | |
void | locate (int column, int row) |
Locate to a screen column and row. | |
int | getAddress (int column, int row) |
Return the memoryaddress of screen column and row location. | |
void | setAddress (int column, int row) |
Set the memoryaddress of screen column and row location. | |
void | cls () |
Clear the screen and locate to 0,0. | |
int | rows () |
Return the number of rows. | |
int | columns () |
Return the number of columns. | |
void | setCursor (LCDCursor cursorMode) |
Set the Cursormode. | |
void | setMode (TextLCD::LCDMode displayMode) |
Set the Displaymode. | |
void | setUDC (unsigned char c, char *udc_data) |
Set User Defined Characters. |
Detailed Description
A TextLCD interface for driving 4-bit HD44780-based LCDs.
Currently supports 8x1, 8x2, 12x2, 12x4, 16x1, 16x2, 16x4, 20x2, 20x4, 24x2, 24x4, 40x2 and 40x4 panels
Definition at line 166 of file TextLCD.h.
Member Enumeration Documentation
enum LCDBacklight |
enum LCDCtrl |
enum LCDCursor |
enum LCDMode |
enum LCDType |
LCD panel format.
- Enumerator:
Constructor & Destructor Documentation
Create a TextLCD interface using an SPI 74595 portexpander.
- Parameters:
-
spi SPI Bus cs chip select pin (active low) type Sets the panel size/addressing mode (default = LCD16x2) ctrl LCD controller (default = HD44780)
Definition at line 42 of file TextLCD.cpp.
Member Function Documentation
void cls | ( | ) |
Clear the screen and locate to 0,0.
Definition at line 213 of file TextLCD.cpp.
int columns | ( | ) |
Return the number of columns.
- Parameters:
-
return The number of columns
Definition at line 529 of file TextLCD.cpp.
int getAddress | ( | int | column, |
int | row | ||
) |
Return the memoryaddress of screen column and row location.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0 return The memoryaddress of screen column and row location
Definition at line 375 of file TextLCD.cpp.
void locate | ( | int | column, |
int | row | ||
) |
Locate to a screen column and row.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0
Definition at line 248 of file TextLCD.cpp.
int printf | ( | const char * | format, |
... | |||
) |
Write a formated string to the LCD.
- Parameters:
-
format A printf-style format string, followed by the variables to use in formating the string.
int putc | ( | int | c ) |
Write a character to the LCD.
- Parameters:
-
c The character to write to the display
int rows | ( | ) |
Return the number of rows.
- Parameters:
-
return The number of rows
Definition at line 564 of file TextLCD.cpp.
void setAddress | ( | int | column, |
int | row | ||
) |
Set the memoryaddress of screen column and row location.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0
Definition at line 502 of file TextLCD.cpp.
void setCursor | ( | TextLCD::LCDCursor | cursorMode ) |
Set the Cursormode.
- Parameters:
-
cursorMode The Cursor mode (CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn)
Definition at line 595 of file TextLCD.cpp.
void setMode | ( | TextLCD::LCDMode | displayMode ) |
Set the Displaymode.
- Parameters:
-
displayMode The Display mode (DispOff, DispOn)
Definition at line 606 of file TextLCD.cpp.
void setUDC | ( | unsigned char | c, |
char * | udc_data | ||
) |
Set User Defined Characters.
- Parameters:
-
unsigned char c The Index of the UDC (0..7) char *udc_data The bitpatterns for the UDC (8 bytes of 5 significant bits)
Definition at line 658 of file TextLCD.cpp.
Generated on Sun Jul 17 2022 18:32:24 by 1.7.2