OpenThread_app
Loading...
Searching...
No Matches

RMT driver initialization and control functions. More...

Functions

const ws2812b_drv_tws2812b_if_getDrvRMT (void)
 Get RMT driver interface.
void ws2812b_if_init (void)
 Initialize RMT peripheral for WS2812B control.
void ws2812b_if_simpleTest (void)
 Run simple LED test sequence.

Detailed Description

RMT driver initialization and control functions.

Function Documentation

◆ ws2812b_if_getDrvRMT()

const ws2812b_drv_t * ws2812b_if_getDrvRMT ( void )

Get RMT driver interface.

Returns
const ws2812b_drv_t* Pointer to driver interface structure

Returns function pointer structure for LED control. Use this interface to interact with LEDs.

Example:

drv->SetOneDiodeRGB(0, 255, 0, 0);
drv->Refresh();
const ws2812b_drv_t * ws2812b_if_getDrvRMT(void)
Get RMT driver interface.
Definition ws2812b_drv_RMT.c:66
WS2812B driver interface structure.
Definition ws2812b_if.h:81
Note
Must call ws2812b_if_init() before using driver

◆ ws2812b_if_init()

void ws2812b_if_init ( void )

Initialize RMT peripheral for WS2812B control.

Initializes ESP32-C6 RMT peripheral with WS2812B-specific configuration.

Initialization Steps:

  1. Configure RMT bytes encoder (0.3µs / 0.9µs timing)
  2. Create RMT TX channel on specified GPIO
  3. Configure 64-symbol memory blocks (reduces flickering)
  4. Set up 4-deep transaction queue for smooth updates
  5. Enable RMT channel

RMT Configuration:

  • Resolution: 10MHz (0.1µs per tick)
  • Bit 0: 0.3µs HIGH + 0.9µs LOW
  • Bit 1: 0.9µs HIGH + 0.3µs LOW
  • MSB first transmission
  • DMA enabled
Note
Call once during application startup
Must be called before any LED operations
Warning
Crashes if RMT channel allocation fails
See also
ws2812b_if_getDrvRMT() to get driver interface

◆ ws2812b_if_simpleTest()

void ws2812b_if_simpleTest ( void )

Run simple LED test sequence.

Cycles through LEDs one by one in red, green, blue sequence. Useful for testing LED strip connectivity and order.

Test Sequence:

  1. Light LED 0 red
  2. Light LED 1 red
  3. ... through all LEDs red
  4. Light LED 0 green
  5. ... through all LEDs green
  6. Light LED 0 blue
  7. ... through all LEDs blue
  8. Repeat

Usage:

void test_task(void *pvParameters) {
while(1) {
vTaskDelay(pdMS_TO_TICKS(100)); // 100ms delay
}
}
void ws2812b_if_simpleTest(void)
Run simple LED test sequence.
Definition ws2812b_drv_RMT.c:129
void ws2812b_if_init(void)
Initialize RMT peripheral for WS2812B control.
Definition ws2812b_drv_RMT.c:166
Note
Add to FreeRTOS task with delay
Static state maintained between calls
Warning
Do not call faster than 10ms