64 #define I2C_LCD1602_CHARACTER_CUSTOM_0 0b00001000
65 #define I2C_LCD1602_CHARACTER_CUSTOM_1 0b00001001
66 #define I2C_LCD1602_CHARACTER_CUSTOM_2 0b00001010
67 #define I2C_LCD1602_CHARACTER_CUSTOM_3 0b00001011
68 #define I2C_LCD1602_CHARACTER_CUSTOM_4 0b00001100
69 #define I2C_LCD1602_CHARACTER_CUSTOM_5 0b00001101
70 #define I2C_LCD1602_CHARACTER_CUSTOM_6 0b00001110
71 #define I2C_LCD1602_CHARACTER_CUSTOM_7 0b00001111
73 #define I2C_LCD1602_CHARACTER_ALPHA 0b11100000
74 #define I2C_LCD1602_CHARACTER_BETA 0b11100010
75 #define I2C_LCD1602_CHARACTER_THETA 0b11110010
76 #define I2C_LCD1602_CHARACTER_PI 0b11110111
77 #define I2C_LCD1602_CHARACTER_OMEGA 0b11110100
78 #define I2C_LCD1602_CHARACTER_SIGMA 0b11110110
79 #define I2C_LCD1602_CHARACTER_INFINITY 0b11110011
80 #define I2C_LCD1602_CHARACTER_DEGREE 0b11011111
81 #define I2C_LCD1602_CHARACTER_ARROW_RIGHT 0b01111110
82 #define I2C_LCD1602_CHARACTER_ARROW_LEFT 0b01111111
83 #define I2C_LCD1602_CHARACTER_SQUARE 0b11011011
84 #define I2C_LCD1602_CHARACTER_DOT 0b10100101
85 #define I2C_LCD1602_CHARACTER_DIVIDE 0b11111101
86 #define I2C_LCD1602_CHARACTER_BLOCK 0b11111111
103 #define I2C_LCD1602_ERROR_CHECK(x) do { \
104 esp_err_t rc = (x); \
105 if (rc != ESP_OK) { \
106 ESP_LOGW(TAG, "I2C error %d at %s:%d", rc, __FILE__, __LINE__); \
137 bool backlight, uint8_t num_rows, uint8_t num_columns, uint8_t num_visible_columns);
333 #endif // I2C_LCD1602_H
esp_err_t i2c_lcd1602_set_backlight(i2c_lcd1602_info_t *i2c_lcd1602_info, bool enable)
Enable or disable the LED backlight.
Definition: i2c-lcd1602.c:455
esp_err_t i2c_lcd1602_reset(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Reset the display. Custom characters will be cleared.
Definition: i2c-lcd1602.c:316
esp_err_t i2c_lcd1602_set_right_to_left(i2c_lcd1602_info_t *i2c_lcd1602_info)
Set cursor movement direction following each character write to produce right-to-left text...
Definition: i2c-lcd1602.c:510
esp_err_t i2c_lcd1602_set_blink(i2c_lcd1602_info_t *i2c_lcd1602_info, bool enable)
Enable or disable display of the blinking block cursor. If enabled, this visually indicates where the...
Definition: i2c-lcd1602.c:488
esp_err_t i2c_lcd1602_home(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Move cursor to home position. Also resets any display shift that may have occurred. DDRAM content is not changed. CGRAM content is not changed.
Definition: i2c-lcd1602.c:422
bool init
True if struct has been initialised, otherwise false.
Definition: i2c-lcd1602.h:50
uint8_t num_visible_columns
Number of visible columns.
Definition: i2c-lcd1602.h:55
i2c_lcd1602_custom_index_t
Enum of valid indexes for definitions of user-defined characters.
Definition: i2c-lcd1602.h:91
Structure containing information related to the I2C-LCD1602 device.
Definition: i2c-lcd1602.h:48
esp_err_t i2c_lcd1602_clear(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Clears entire display (clears DDRAM) and returns cursor to home position. DDRAM content is cleared...
Definition: i2c-lcd1602.c:408
esp_err_t i2c_lcd1602_write_string(const i2c_lcd1602_info_t *i2c_lcd1602_info, const char *string)
Write a string of characters to the display, starting at the current position of the cursor...
Definition: i2c-lcd1602.c:601
esp_err_t i2c_lcd1602_set_cursor(i2c_lcd1602_info_t *i2c_lcd1602_info, bool enable)
Enable or disable display of the underline cursor. If enabled, this visually indicates where the next...
Definition: i2c-lcd1602.c:477
esp_err_t i2c_lcd1602_set_left_to_right(i2c_lcd1602_info_t *i2c_lcd1602_info)
Set cursor movement direction following each character write to produce left-to-right text...
Definition: i2c-lcd1602.c:499
uint8_t display_control_flags
Currently active display control flags.
Definition: i2c-lcd1602.h:56
uint8_t entry_mode_flags
Currently active entry mode flags.
Definition: i2c-lcd1602.h:57
Index of eighth user-defined custom symbol.
Definition: i2c-lcd1602.h:100
esp_err_t i2c_lcd1602_init(i2c_lcd1602_info_t *i2c_lcd1602_info, smbus_info_t *smbus_info, bool backlight, uint8_t num_rows, uint8_t num_columns, uint8_t num_visible_columns)
Initialise a I2C-LCD1602 info instance with the specified SMBus information.
Definition: i2c-lcd1602.c:281
esp_err_t i2c_lcd1602_move_cursor_right(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Move the cursor one position to the right, even if it is invisible. This affects where the next chara...
Definition: i2c-lcd1602.c:565
uint8_t num_columns
Number of configured columns, including offscreen columns.
Definition: i2c-lcd1602.h:54
esp_err_t i2c_lcd1602_set_display(i2c_lcd1602_info_t *i2c_lcd1602_info, bool enable)
Enable or disable the display. When disabled, the backlight is not affected, but any contents of the ...
Definition: i2c-lcd1602.c:466
Index of fourth user-defined custom symbol.
Definition: i2c-lcd1602.h:96
esp_err_t i2c_lcd1602_move_cursor(const i2c_lcd1602_info_t *i2c_lcd1602_info, uint8_t col, uint8_t row)
Move cursor to specified column and row position. This is where a new character will appear...
Definition: i2c-lcd1602.c:436
uint8_t num_rows
Number of configured columns.
Definition: i2c-lcd1602.h:53
Index of second user-defined custom symbol.
Definition: i2c-lcd1602.h:94
void i2c_lcd1602_free(i2c_lcd1602_info_t **tsl2561_info)
Delete an existing I2C-LCD1602 info instance.
Definition: i2c-lcd1602.c:267
Index of sixth user-defined custom symbol.
Definition: i2c-lcd1602.h:98
esp_err_t i2c_lcd1602_move_cursor_left(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Move the cursor one position to the left, even if it is invisible. This affects where the next charac...
Definition: i2c-lcd1602.c:554
Index of seventh user-defined custom symbol.
Definition: i2c-lcd1602.h:99
Index of first user-defined custom symbol.
Definition: i2c-lcd1602.h:93
esp_err_t i2c_lcd1602_define_char(const i2c_lcd1602_info_t *i2c_lcd1602_info, i2c_lcd1602_custom_index_t index, const uint8_t pixelmap[])
Define a custom character from an array of pixel data.
Definition: i2c-lcd1602.c:576
smbus_info_t * smbus_info
Pointer to associated SMBus info.
Definition: i2c-lcd1602.h:51
i2c_lcd1602_info_t * i2c_lcd1602_malloc(void)
Construct a new I2C-LCD1602 info instance. New instance should be initialised before calling other fu...
Definition: i2c-lcd1602.c:252
Index of third user-defined custom symbol.
Definition: i2c-lcd1602.h:95
esp_err_t i2c_lcd1602_scroll_display_left(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Scroll the display one position to the left. On-screen text will appear to move to the right...
Definition: i2c-lcd1602.c:532
uint8_t backlight_flag
Non-zero if backlight is to be enabled, otherwise zero.
Definition: i2c-lcd1602.h:52
esp_err_t i2c_lcd1602_scroll_display_right(const i2c_lcd1602_info_t *i2c_lcd1602_info)
Scroll the display one position to the right. On-screen text will appear to move to the left...
Definition: i2c-lcd1602.c:543
esp_err_t i2c_lcd1602_set_auto_scroll(i2c_lcd1602_info_t *i2c_lcd1602_info, bool enable)
Enable or disable auto-scroll of display. When enabled, the display will scroll as characters are wri...
Definition: i2c-lcd1602.c:521
Index of fifth user-defined custom symbol.
Definition: i2c-lcd1602.h:97
esp_err_t i2c_lcd1602_write_char(const i2c_lcd1602_info_t *i2c_lcd1602_info, uint8_t chr)
Write a single character to the display at the current position of the cursor. Depending on the activ...
Definition: i2c-lcd1602.c:591