Skip to content

foxofdev/st-addrled-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

st_addrled_lib

Description

This is a simple library to control the WS2812-style adresable LEDs (with Data line) using STM32 DMA. It itself is written in plain C but references some HAL functions.

How to use?

  1. Configure the desired timer channel with the following settings:
    • Output Type: PWM generation
    • Choose Prescaler (PSC) and Auto-Reload Register (ARR) values so that the resulting PWM frequency corresponds to the LED timing specified in the datasheet (usually 800 kHz)
  2. Create the project and add the library by either copying it manually or importing as Git submodule. The included CMakeLists should help with that
  3. Open include/addrled_config.h and configure the defines there.
  4. In your initialization code, call ADDRLED_Init once to init the required variables
  5. Add ADDRLED_Callback to HAL_TIM_PWM_PulseFinishedCallback for the respective timer
  6. Use the included functionality to set the colors and call ADDRLED_Update to send the data to the LEDs
  7. Let your project light up :)

About

A simple STM32 HAL library for controlling adressable RGB LEDs with single data line using DMA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors