STM32 LL(Low Layer) library for I2C LCD. Works for both 16x2 LCD and 20x4 LCD etc.
- Small code footprint
- Supports progress bar
- Display printf function
- No HAL dependencies
How to add CPM to the project, check the link
CPMAddPackage(
NAME HD44780_I2C
GITHUB_REPOSITORY ximtech/HD44780_I2C
GIT_TAG origin/main)
- Start project with STM32CubeMX:
- Select: Project Manager -> Advanced Settings -> I2C -> LL
- Generate Code
- Add sources to project:
add_subdirectory(${STM32_CORE_SOURCE_DIR}/I2C/Polling) # add I2C dependency
include_directories(${includes}
${HD44780_LCD_I2C_DIRECTORY}) # source directories
file(GLOB_RECURSE SOURCES ${sources}
${HD44780_LCD_I2C_SOURCES}) # source files
- Then Build -> Clean -> Rebuild Project
In HD44780_LCD_I2C.h
default defines. Override them in main.h
if needed
#define HD44780_LCD_COL_COUNT 20
#define HD44780_LCD_ROW_COUNT 4
#define HD44780_LCD_I2C_DEVICE_ADDRESS 0x4e // default PCF8574 address