WS2812 RMT Driver
API reference
Loading...
Searching...
No Matches
Classes | Macros | Functions
led_strip_encoder.c File Reference
#include "led_strip_encoder.h"
#include "esp_check.h"
Include dependency graph for led_strip_encoder.c:

Classes

struct  rmt_led_strip_encoder_t
 

Macros

#define LED_NS_TO_TICKS(ns)    ((uint16_t)(((uint64_t)(ns) * config->resolution + 500000000ULL) / 1000000000ULL))
 

Functions

esp_err_t rmt_new_led_strip_encoder (const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder)
 Create RMT encoder for encoding LED strip pixels into RMT symbols.
 

Macro Definition Documentation

◆ LED_NS_TO_TICKS

#define LED_NS_TO_TICKS (   ns)     ((uint16_t)(((uint64_t)(ns) * config->resolution + 500000000ULL) / 1000000000ULL))

Function Documentation

◆ rmt_new_led_strip_encoder()

esp_err_t rmt_new_led_strip_encoder ( const led_strip_encoder_config_t *  config,
rmt_encoder_handle_t *  ret_encoder 
)

Create RMT encoder for encoding LED strip pixels into RMT symbols.

The encoder takes bytes in wire order (G, R, B for a WS2812B; G, R, B, W for an RGBW part), sends them high bit first and appends the reset code.

Parameters
[in]configEncoder configuration
[out]ret_encoderReturned encoder handle
Returns
  • ESP_ERR_INVALID_ARG for any invalid arguments
  • ESP_ERR_NO_MEM out of memory when creating led strip encoder
  • ESP_OK if creating encoder successfully