Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/ws281x: add RMT hardware support for ESP32x SoCs #19424

Merged
merged 8 commits into from
Mar 29, 2023
Prev Previous commit
Next Next commit
cpu/esp32: add RMT configuration type
  • Loading branch information
gschorcht committed Mar 28, 2023
commit d4d4bc4df1274d3b3306259d9408b6115c1141f5
34 changes: 34 additions & 0 deletions cpu/esp32/include/periph_cpu.h
Original file line number Diff line number Diff line change
@@ -548,6 +548,40 @@ typedef struct {

/** @} */

/**
* @name RMT configuration
*
* ESP32x SoCs have a Remote Control Peripheral (RMT) that can be used to
* generate digital waveforms, such as NEC remote control signals or
* WS2812B RGB LED signals. Each RMT peripheral has either 4 or 8 channels.
* Some ESP32x SoCs support configuring the clock sources used for each channel
* separately, while other ESP32x SoCs can only use a single clock source for
* all channels.
*
* @{
*/

/**
* @brief RMT channel configuration
*
* Each RMT channel is mapped to a GPIO. The configured mappings are used
* by the drivers that use the RMT peripheral to determine the RMT channel
* for a given GPIO.
*/
typedef struct {
uint8_t channel; /**< channel index */
gpio_t gpio; /**< GPIO used as RMT channel */
} rmt_channel_config_t;

/**
* @brief Maximum number of RMT channels
*
* The number of configured channels must be less or equal.
*/
#define RMT_CH_NUMOF_MAX (SOC_RMT_CHANNELS_PER_GROUP)

/** @} */

/**
* @name RNG configuration
* @{