File syn_charlcd.h¶
FileList > display > syn_charlcd.h
Go to the source code of this file
Generic Character LCD Driver (HD44780, ST7066, KS0066 over I2C PCF8574 or 4-Bit Parallel GPIO).
#include "../common/syn_defs.h"#include "../drivers/syn_soft_i2c.h"#include "../port/syn_port_gpio.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_CharLCD Generic Character LCD Context. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_CharLCDMode Character LCD Interface Mode. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_charlcd_clear (SYN_CharLCD * lcd) Clear LCD screen and reset cursor to home (0,0). |
| void | syn_charlcd_create_char (SYN_CharLCD * lcd, uint8_t slot, const uint8_t charmap) Load a custom 5x8 pixel character into CGRAM. |
| SYN_Status | syn_charlcd_init_gpio (SYN_CharLCD * lcd, SYN_GPIO_Pin rs, SYN_GPIO_Pin en, SYN_GPIO_Pin d4, SYN_GPIO_Pin d5, SYN_GPIO_Pin d6, SYN_GPIO_Pin d7, uint8_t cols, uint8_t rows) Initialize Character LCD in Direct 4-Bit Parallel GPIO mode. |
| SYN_Status | syn_charlcd_init_i2c (SYN_CharLCD * lcd, SYN_GPIO_Pin scl, SYN_GPIO_Pin sda, uint8_t i2c_addr, uint8_t cols, uint8_t rows) Initialize Character LCD in I2C PCF8574 Backpack mode. |
| void | syn_charlcd_print (SYN_CharLCD * lcd, const char * str) Print an ASCII string at current cursor position. |
| void | syn_charlcd_set_backlight (SYN_CharLCD * lcd, bool enable) Turn display backlight ON or OFF (I2C backpack mode). |
| void | syn_charlcd_set_cursor (SYN_CharLCD * lcd, uint8_t col, uint8_t row) Set cursor position. |
Public Types Documentation¶
enum SYN_CharLCDMode¶
Character LCD Interface Mode.
Public Functions Documentation¶
function syn_charlcd_clear¶
Clear LCD screen and reset cursor to home (0,0).
Parameters:
lcdLCD context.
function syn_charlcd_create_char¶
Load a custom 5x8 pixel character into CGRAM.
Parameters:
lcdLCD context.slotCGRAM slot (0 to 7).charmapArray of 8 bytes (each byte represents a 5-bit pixel row).
function syn_charlcd_init_gpio¶
Initialize Character LCD in Direct 4-Bit Parallel GPIO mode.
SYN_Status syn_charlcd_init_gpio (
SYN_CharLCD * lcd,
SYN_GPIO_Pin rs,
SYN_GPIO_Pin en,
SYN_GPIO_Pin d4,
SYN_GPIO_Pin d5,
SYN_GPIO_Pin d6,
SYN_GPIO_Pin d7,
uint8_t cols,
uint8_t rows
)
Parameters:
lcdLCD context.rsRegister Select GPIO pin.enEnable GPIO pin.d4Data Bit 4 GPIO pin.d5Data Bit 5 GPIO pin.d6Data Bit 6 GPIO pin.d7Data Bit 7 GPIO pin.colsColumns (e.g. 16 or 20).rowsRows (e.g. 2 or 4).
Returns:
SYN_OK on success.
function syn_charlcd_init_i2c¶
Initialize Character LCD in I2C PCF8574 Backpack mode.
SYN_Status syn_charlcd_init_i2c (
SYN_CharLCD * lcd,
SYN_GPIO_Pin scl,
SYN_GPIO_Pin sda,
uint8_t i2c_addr,
uint8_t cols,
uint8_t rows
)
Parameters:
lcdLCD context.sclI2C SCL GPIO pin.sdaI2C SDA GPIO pin.i2c_addrPCF8574 I2C address (e.g. 0x27 or 0x3F).colsColumns (e.g. 16 or 20).rowsRows (e.g. 2 or 4).
Returns:
SYN_OK on success.
function syn_charlcd_print¶
Print an ASCII string at current cursor position.
Parameters:
lcdLCD context.strNull-terminated string.
function syn_charlcd_set_backlight¶
Turn display backlight ON or OFF (I2C backpack mode).
Parameters:
lcdLCD context.enableTrue for backlight ON.
function syn_charlcd_set_cursor¶
Set cursor position.
Parameters:
lcdLCD context.colColumn (0 to cols-1).rowRow (0 to rows-1).
The documentation for this class was generated from the following file src/syntropic/display/syn_charlcd.h