API for the LCM1602 I2C controller for HD44780-based displays.
More...
This supports all sizes of HD44780 displays, from 16x2 to 4x20. The controller has no idea of the actual display hardware, so it lets you write farther than you can see. These displays with such controllers are available from various manufacturers with different I2C addresses. Adafruit* TC1602A-01T seems to be a well-documented example. The driver also supports parallel GPIO connections directly to the HD44780 in case you are not using an I2C expander/backpack.
Example for LCM1602 displays that use the I2C bus
lcd->
write(
"Hello World");
Code sample for GPIO based LCM1602 displays
lcd->
write(
"Hello World");
lcd->
write(
"Hello World");
printf("Sleeping for 5 seconds\n");
sleep(5);
delete lcd;
|
| Lcm1602 (int bus, int address, bool isExpander=true, uint8_t numColumns=16, uint8_t numRows=4) |
|
| Lcm1602 (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t numColumns=16, uint8_t numRows=4) |
|
| ~Lcm1602 () |
|
mraa::Result | write (std::string msg) |
|
mraa::Result | setCursor (int row, int column) |
|
mraa::Result | clear () |
|
mraa::Result | home () |
|
mraa::Result | createChar (uint8_t charSlot, uint8_t charData[]) |
|
mraa::Result | displayOn () |
|
mraa::Result | displayOff () |
|
mraa::Result | cursorOn () |
|
mraa::Result | cursorOff () |
|
mraa::Result | cursorBlinkOn () |
|
mraa::Result | cursorBlinkOff () |
|
mraa::Result | scrollDisplayLeft () |
|
mraa::Result | scrollDisplayRight () |
|
mraa::Result | entryLeftToRight () |
|
mraa::Result | entryRightToLeft () |
|
mraa::Result | autoscrollOn () |
|
mraa::Result | autoscrollOff () |
|
mraa::Result | write (int x, int y, std::string msg) |
|
std::string | name () |
|
|
mraa::Result | send (uint8_t value, int mode) |
|
mraa::Result | write4bits (uint8_t value) |
|
mraa::Result | expandWrite (uint8_t value) |
|
mraa::Result | pulseEnable (uint8_t value) |
|
virtual mraa::Result | command (uint8_t cmd) |
|
virtual mraa::Result | data (uint8_t data) |
|
|
uint8_t | m_displayControl |
|
uint8_t | m_entryDisplayMode |
|
uint8_t | m_numColumns |
|
uint8_t | m_numRows |
|
int | m_lcd_control_address |
|
mraa::I2c * | m_i2c_lcd_control |
|
std::string | m_name |
|
Lcm1602 |
( |
int |
bus, |
|
|
int |
address, |
|
|
bool |
isExpander = true , |
|
|
uint8_t |
numColumns = 16 , |
|
|
uint8_t |
numRows = 4 |
|
) |
| |
Lcm1602 constructor; calls libmraa initialisation functions
- Parameters
-
bus | I2C bus to use |
address | Slave address the LCD is registered on |
isExpander | True if we are dealing with an I2C expander, false otherwise. Default is true. |
Lcm1602 |
( |
uint8_t |
rs, |
|
|
uint8_t |
enable, |
|
|
uint8_t |
d0, |
|
|
uint8_t |
d1, |
|
|
uint8_t |
d2, |
|
|
uint8_t |
d3, |
|
|
uint8_t |
numColumns = 16 , |
|
|
uint8_t |
numRows = 4 |
|
) |
| |
Lcm1602 alternate constructor, used for GPIO based HD44780 controllers supporting RS, Enable, and 4 data pins in 4-bit mode.
- Parameters
-
rs | Register select pin |
enable | Enable pin |
d0 | Data 0 pin |
d1 | Data 1 pin |
d2 | Data 2 pin |
d3 | Data 3 pin |
mraa::Result write |
( |
std::string |
msg | ) |
|
|
virtual |
Writes a string to the LCD
- Parameters
-
msg | std::string to write to the display; note: only ASCII characters are supported |
- Returns
- Result of the operation
Implements LCD.
mraa::Result setCursor |
( |
int |
row, |
|
|
int |
column |
|
) |
| |
|
virtual |
Sets the cursor to specified coordinates
- Parameters
-
row | Row to set the cursor to |
column | Column to set the cursor to |
- Returns
- Result of the operation
Implements LCD.
Clears the display of all characters
- Returns
- Result of the operation
Implements LCD.
Returns to the original coordinates (0,0)
- Returns
- Result of the operation
Implements LCD.
mraa::Result createChar |
( |
uint8_t |
charSlot, |
|
|
uint8_t |
charData[] |
|
) |
| |
Create a custom character
- Parameters
-
charSlot | the character slot to write, only 8 are available |
charData | The character data (8 bytes) making up the character |
- Returns
- Result of operation
mraa::Result displayOn |
( |
| ) |
|
Turn the display on
- Returns
- Result of operation
mraa::Result displayOff |
( |
| ) |
|
Turn the display off
- Returns
- Result of operation
mraa::Result cursorOn |
( |
| ) |
|
Turn the cursor on
- Returns
- Result of operation
mraa::Result cursorOff |
( |
| ) |
|
Turn the cursor off
- Returns
- Result of operation
mraa::Result cursorBlinkOn |
( |
| ) |
|
Turn cursor blink on
- Returns
- Result of operation
mraa::Result cursorBlinkOff |
( |
| ) |
|
Turn cursor blink off
- Returns
- Result of operation
mraa::Result scrollDisplayLeft |
( |
| ) |
|
Scroll the display left, without changing the character RAM
- Returns
- Result of operation
mraa::Result scrollDisplayRight |
( |
| ) |
|
Scroll the display right, without changing the character RAM
- Returns
- Result of operation
mraa::Result entryLeftToRight |
( |
| ) |
|
set the entry mode so that characters are added left to right
- Returns
- Result of operation
mraa::Result entryRightToLeft |
( |
| ) |
|
set the entry mode so that characters are added right to left
- Returns
- Result of operation
mraa::Result autoscrollOn |
( |
| ) |
|
Right justify text entered from the cursor
- Returns
- Result of operation
mraa::Result autoscrollOff |
( |
| ) |
|
Left justify text entered from the cursor
- Returns
- Result of operation
The documentation for this class was generated from the following files:
- /iotdk/jenkins/workspace/upm-doc-stable/src/lcd/lcm1602.h
- /iotdk/jenkins/workspace/upm-doc-stable/src/lcd/lcm1602.cxx