Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface NTPClient SDFileSystem TextLCD WebSocketClient mbed-rtos mbed Socket lwip-eth lwip-sys lwip FATFileSystem
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 (PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, LCDType type=LCD16x2, PinName bl=NC, PinName e2=NC, LCDCtrl ctrl=HD44780) | |
| Create a TextLCD interface for using regular mbed pins. | |
| TextLCD (I2C *i2c, char deviceAddress, LCDType type=LCD16x2, LCDCtrl ctrl=HD44780) | |
| Create a TextLCD interface using an I2C PC8574 portexpander. | |
| TextLCD (SPI *spi, PinName cs, 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 | setBacklight (TextLCD::LCDBacklight backlightMode) |
| Set the Backlight mode. | |
| 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
| TextLCD | ( | PinName | rs, |
| PinName | e, | ||
| PinName | d4, | ||
| PinName | d5, | ||
| PinName | d6, | ||
| PinName | d7, | ||
| LCDType | type = LCD16x2, |
||
| PinName | bl = NC, |
||
| PinName | e2 = NC, |
||
| LCDCtrl | ctrl = HD44780 |
||
| ) |
Create a TextLCD interface for using regular mbed pins.
- Parameters:
-
rs Instruction/data control line e Enable line (clock) d4-d7 Data lines for using as a 4-bit interface type Sets the panel size/addressing mode (default = LCD16x2) bl Backlight control line (optional, default = NC) e2 Enable2 line (clock for second controller, LCD40x4 only) ctrl LCD controller (default = HD44780)
Definition at line 44 of file TextLCD.cpp.
Create a TextLCD interface using an I2C PC8574 portexpander.
- Parameters:
-
i2c I2C Bus deviceAddress I2C slave address (PCF8574) type Sets the panel size/addressing mode (default = LCD16x2) ctrl LCD controller (default = HD44780)
Definition at line 65 of file TextLCD.cpp.
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 94 of file TextLCD.cpp.
Member Function Documentation
| void cls | ( | ) |
Clear the screen and locate to 0,0.
Definition at line 284 of file TextLCD.cpp.
| int columns | ( | ) |
Return the number of columns.
- Parameters:
-
return The number of columns
Definition at line 851 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 697 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 319 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 886 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 824 of file TextLCD.cpp.
| void setBacklight | ( | TextLCD::LCDBacklight | backlightMode ) |
Set the Backlight mode.
- Parameters:
-
backlightMode The Backlight mode (LightOff, LightOn)
Definition at line 979 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 917 of file TextLCD.cpp.
| void setMode | ( | TextLCD::LCDMode | displayMode ) |
Set the Displaymode.
- Parameters:
-
displayMode The Display mode (DispOff, DispOn)
Definition at line 928 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 990 of file TextLCD.cpp.
Generated on Tue Jul 12 2022 14:08:13 by
1.7.2