Class for HD44780 LCD
More...
#include <HD44780_LCD_PCF8574.h>
|
enum | LCDBackLight_e : uint8_t { LCDBackLightOnMask = 0x0F
, LCDBackLightOffMask = 0x07
} |
|
enum | LCDEntryMode_e : uint8_t { LCDEntryModeOne = 0x04
, LCDEntryModeTwo = 0x05
, LCDEntryModeThree = 0x06
, LCDEntryModeFour = 0x07
} |
|
enum | LCDCursorType_e : uint8_t { LCDCursorTypeOff = 0x0C
, LCDCursorTypeBlink = 0x0D
, LCDCursorTypeOn = 0x0E
, LCDCursorTypeOnBlink = 0x0F
} |
|
enum | LCDDirectionType_e : uint8_t { LCDMoveRight = 1
, LCDMoveLeft = 2
} |
|
enum | LCDLineNumber_e : uint8_t { LCDLineNumberOne = 1
, LCDLineNumberTwo = 2
, LCDLineNumberThree = 3
, LCDLineNumberFour = 4
} |
|
|
| HD44780LCD (uint8_t NumRow, uint8_t NumCol, uint8_t I2Caddress, TwoWire *twi) |
| Constructor for class TM1638plus. More...
|
|
void | PCF8574_LCDInit (LCDCursorType_e) |
| Initialise LCD. More...
|
|
void | PCF8574_LCDDisplayON (bool) |
| Turn Screen on and off. More...
|
|
void | PCF8574_LCDResetScreen (LCDCursorType_e) |
| Reset screen. More...
|
|
void | PCF8574_LCDBackLightSet (bool) |
| Turn LED backlight on and off. More...
|
|
bool | PCF8574_LCDBackLightGet (void) |
| get the backlight flag status More...
|
|
void | PCF8574_LCDSendString (char *str) |
| Send a string to LCD. More...
|
|
void | PCF8574_LCDSendChar (char data) |
| Sends a character to screen , simply wraps SendData command. More...
|
|
void | PCF8574_LCDCreateCustomChar (uint8_t location, uint8_t *charmap) |
| Saves a custom character to a location in character generator RAM 64 bytes. More...
|
|
void | PCF8574_LCDPrintCustomChar (uint8_t location) |
| Print out a customer character from character generator CGRAM 64 bytes 8 characters. More...
|
|
void | PCF8574_LCDMoveCursor (LCDDirectionType_e, uint8_t moveSize) |
| Moves cursor. More...
|
|
void | PCF8574_LCDScroll (LCDDirectionType_e, uint8_t ScrollSize) |
| Scrolls screen. More...
|
|
void | PCF8574_LCDGOTO (LCDLineNumber_e lineNo, uint8_t col) |
| moves cursor to an x , y position on display. More...
|
|
void | PCF8574_LCDClearLine (LCDLineNumber_e lineNo) |
| Clear a line by writing spaces to every position. More...
|
|
void | PCF8574_LCDClearScreen (void) |
| Clear screen by writing spaces to every position. More...
|
|
void | PCF8574_LCDClearScreenCmd (void) |
| Clear display using software command , set cursor position to zero. More...
|
|
void | PCF8574_LCDHome (void) |
| Set cursor position to home position .
|
|
void | PCF8574_LCDChangeEntryMode (LCDEntryMode_e mode) |
| Change entry mode
More...
|
|
virtual void | write (uint8_t) |
| Called by print class, used to print out numerical data types etc. More...
|
|
◆ LCDAddress_e
DDRAM address's used to set cursor position Note Private
Enumerator |
---|
LCDLineAddressOne | Line 1
|
LCDLineAddressTwo | Line 2
|
LCDLineAddress3Col20 | Line 3 20x04 line 3
|
LCDLineAddress4Col20 | Line 4 20x04 line 4
|
LCDLineAddress3Col16 | Line 3 16x04 untested, no part
|
LCDLineAddress4Col16 | Line 4 16x04 untested, no part
|
◆ LCDBackLight_e
Backlight Control , Command Byte Code
Enumerator |
---|
LCDBackLightOnMask | XXXX-1111 , Turn on Back light
|
LCDBackLightOffMask | XXXX-0111, Turn off Back light
|
◆ LCDCmdBytesGeneral_e
Command Bytes General Note Private
Enumerator |
---|
LCDModeFourBit | Function set (4-bit interface, 2 lines, 5*7 Pixels)
|
LCDHomePosition | Home (move cursor to top/left character position)
|
LCDDisplayOn | Restore the display (with cursor hidden)
|
LCDDisplayOff | Blank the display (without clearing)
|
LCDClearScreen | clear screen
|
◆ LCDCursorType_e
Cursor mode, Command Byte Code
Enumerator |
---|
LCDCursorTypeOff | Make cursor invisible
|
LCDCursorTypeBlink | Turn on blinking-block cursor
|
LCDCursorTypeOn | Turn on visible underline cursor
|
LCDCursorTypeOnBlink | Turn on blinking-block cursor + visible underline cursor
|
◆ LCDDirectionType_e
Direction mode for scroll and move
Enumerator |
---|
LCDMoveRight | move or scroll right
|
LCDMoveLeft | move or scroll left
|
◆ LCDEntryMode_e
Entry mode control set command, Command Byte Code
Enumerator |
---|
LCDEntryModeOne | Display Shift :OFF Decrement Address Counter
|
LCDEntryModeTwo | Display Shift :ON Decrement Address Counter
|
LCDEntryModeThree | Display Shift :OFF Increment Address Counter, default
|
LCDEntryModeFour | Display Shift :ON Increment Address Counter
|
◆ LCDLineNumber_e
Line Row Number
Enumerator |
---|
LCDLineNumberOne | row 1
|
LCDLineNumberTwo | row 2
|
LCDLineNumberThree | row 3
|
LCDLineNumberFour | row 4
|
◆ HD44780LCD()
HD44780LCD::HD44780LCD |
( |
uint8_t |
NumRow, |
|
|
uint8_t |
NumCol, |
|
|
uint8_t |
I2Caddress, |
|
|
TwoWire * |
twi |
|
) |
| |
Constructor for class TM1638plus.
- Parameters
-
NumRow | Number of Rows/Lines in the LCD |
NumCol | Number of Columns in the LCD |
I2Caddress | The PCF8574 I2C address, default is 0x27. |
twi | Pointer to the Wire I2C interface. |
◆ PCF8574_LCD_I2C_ON()
bool HD44780LCD::PCF8574_LCD_I2C_ON |
( |
void |
| ) |
|
|
private |
Switch on the I2C.
- Returns
- false if PCF8574 fails to appear on I2C bus , true if ok
- Note
- if LCD_SERIAL_DEBUG enabled will print I2C error code to screen wire.endTransmission() return: 0 : Success 1 : Data length error 2 : NACK on transmit of the address. 3 : NACK on transmit of the data. 4 : Some other error
◆ PCF8574_LCDBackLightGet()
bool HD44780LCD::PCF8574_LCDBackLightGet |
( |
void |
| ) |
|
get the backlight flag status
- Returns
- the status of backlight on or off , true or false.
◆ PCF8574_LCDBackLightSet()
void HD44780LCD::PCF8574_LCDBackLightSet |
( |
bool |
OnOff | ) |
|
Turn LED backlight on and off.
- Parameters
-
OnOff | passed bool True = LED on , false = display LED off |
- Note
- another data or command must be issued before it takes effect.
◆ PCF8574_LCDChangeEntryMode()
void HD44780LCD::PCF8574_LCDChangeEntryMode |
( |
LCDEntryMode_e |
newEntryMode | ) |
|
Change entry mode
- Parameters
-
newEntryMode | 1-4 , 4 choices. |
◆ PCF8574_LCDClearLine()
Clear a line by writing spaces to every position.
- Parameters
-
lineNo | LCDLineNumber_e enum lineNo 1-4 |
◆ PCF8574_LCDClearScreen()
void HD44780LCD::PCF8574_LCDClearScreen |
( |
void |
| ) |
|
Clear screen by writing spaces to every position.
- Note
- : See also LCDClearScreenCmd for software command clear alternative.
◆ PCF8574_LCDClearScreenCmd()
void HD44780LCD::PCF8574_LCDClearScreenCmd |
( |
void |
| ) |
|
Clear display using software command , set cursor position to zero.
- Note
- See also LCDClearScreen for manual clear
◆ PCF8574_LCDCreateCustomChar()
void HD44780LCD::PCF8574_LCDCreateCustomChar |
( |
uint8_t |
location, |
|
|
uint8_t * |
charmap |
|
) |
| |
Saves a custom character to a location in character generator RAM 64 bytes.
- Parameters
-
location | CG_RAM location 0-7, we only have 8 locations 64 bytes |
charmap | An array of 8 bytes representing a custom character data |
◆ PCF8574_LCDDisplayON()
void HD44780LCD::PCF8574_LCDDisplayON |
( |
bool |
OnOff | ) |
|
Turn Screen on and off.
- Parameters
-
OnOff | True = display on , false = display off |
◆ PCF8574_LCDGOTO()
moves cursor to an x , y position on display.
- Parameters
-
line | x row 1-4 |
col | y column 0-15 or 0-19 |
◆ PCF8574_LCDInit()
Initialise LCD.
- Parameters
-
◆ PCF8574_LCDMoveCursor()
Moves cursor.
- Parameters
-
direction | enum LCDDirectionType_e left or right |
moveSize | number of spaces to move |
◆ PCF8574_LCDPrintCustomChar()
void HD44780LCD::PCF8574_LCDPrintCustomChar |
( |
uint8_t |
location | ) |
|
Print out a customer character from character generator CGRAM 64 bytes 8 characters.
- Parameters
-
◆ PCF8574_LCDResetScreen()
Reset screen.
- Parameters
-
CursorType | LCDCursorType_e enum cursor type, 4 choices |
◆ PCF8574_LCDScroll()
Scrolls screen.
- Parameters
-
direction | left or right |
ScrollSize | number of spaces to scroll |
◆ PCF8574_LCDSendChar()
void HD44780LCD::PCF8574_LCDSendChar |
( |
char |
data | ) |
|
Sends a character to screen , simply wraps SendData command.
- Parameters
-
◆ PCF8574_LCDSendCmd()
void HD44780LCD::PCF8574_LCDSendCmd |
( |
unsigned char |
cmd | ) |
|
|
private |
Send command byte to lcd.
- Parameters
-
- Note
- if LCD_SERIAL_DEBUG is defined will output data on I2C failures
◆ PCF8574_LCDSendData()
void HD44780LCD::PCF8574_LCDSendData |
( |
unsigned char |
data | ) |
|
|
private |
Send data byte to LCD via I2C.
- Parameters
-
data | The data byte to send |
- Note
- if LCD_SERIAL_DEBUG is defined , will output data on I2C failures.
◆ PCF8574_LCDSendString()
void HD44780LCD::PCF8574_LCDSendString |
( |
char * |
str | ) |
|
Send a string to LCD.
- Parameters
-
str | Pointer to the char array |
◆ write()
size_t HD44780LCD::write |
( |
uint8_t |
character | ) |
|
|
virtual |
Called by print class, used to print out numerical data types etc.
- Parameters
-
character | write a character |
- Note
- used internally. Called by the print method using virtual
◆ _LCDBackLight
Enum to store backlight status
◆ _LCDSlaveAddresI2C
uint8_t HD44780LCD::_LCDSlaveAddresI2C = 0x27 |
|
private |
I2C address for I2C module PCF8574 backpack on LCD
◆ _NumColsLCD
uint8_t HD44780LCD::_NumColsLCD = 16 |
|
private |
◆ _NumRowsLCD
uint8_t HD44780LCD::_NumRowsLCD = 2 |
|
private |
◆ wire
TwoWire* HD44780LCD::wire |
|
private |
The documentation for this class was generated from the following files: