STM32 Low Layer(LL) library. MAX7219 are compact, serial input/output common-cathode display drivers that interface microprocessors (µPs) to 7-segment numeric LED displays of up to 8 digits, bar-graph displays, or 64 individual LEDs.
- Dot LED Matrix library
- Text shift and scroll
- Custom text font and image print
- Predefined text fonts and sprints
How to add CPM to the project, check the link
CPMAddPackage(
NAME MAX7219
GITHUB_REPOSITORY ximtech/MAX7219
GIT_TAG origin/main)
- Start project with STM32CubeMX:
- Select: Project Manager -> Advanced Settings -> SPI -> LL
- Generate Code
- Add sources to project:
add_subdirectory(${STM32_CORE_SOURCE_DIR}/SPI/Polling) # add SPI dependency
include_directories(${includes}
${MAX7219_MATRIX_DIRECTORY}) # matrix display source directories
file(GLOB_RECURSE SOURCES ${sources}
${MAX7219_MATRIX_SOURCES}) # matrix display source files
- Then Build -> Clean -> Rebuild Project
In main.h
set configuration defines
#define MAX7219_NUMBER_OF_MATRIX_DISPLAYS 4 // by default 4 led matrix modules selected
// Define fonts. Comment unused.
#define MAX7219_FONT_DEFAULT 1
#define MAX7219_FONT_SPRITES 2
#define MAX7219_FONT_REGULAR 3
- Usage example: link