ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
led_strip_t Struct Reference

LED strip interface definition. More...

#include <led_strip_interface.h>

Data Fields

esp_err_t(* set_pixel )(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue)
 Set RGB for a specific pixel.
esp_err_t(* set_pixel_rgbw )(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue, uint32_t white)
 Set RGBW for a specific pixel. Similar to set_pixel but also set the white component.
esp_err_t(* refresh )(led_strip_t *strip)
 Refresh memory colors to LEDs.
esp_err_t(* clear )(led_strip_t *strip)
 Clear LED strip (turn off all LEDs).
esp_err_t(* del )(led_strip_t *strip)
 Free LED strip resources.

Detailed Description

LED strip interface definition.

Definition at line 20 of file led_strip_interface.h.

Field Documentation

◆ clear

esp_err_t(* led_strip_t::clear) (led_strip_t *strip)

Clear LED strip (turn off all LEDs).

Parameters
stripLED strip
timeout_mstimeout value for clearing task
Returns
  • ESP_OK: Clear LEDs successfully
  • ESP_FAIL: Clear LEDs failed because some other error occurred

Definition at line 79 of file led_strip_interface.h.

Referenced by led_strip_clear(), led_strip_new_rmt_device(), led_strip_new_rmt_device(), and led_strip_new_spi_device().

◆ del

esp_err_t(* led_strip_t::del) (led_strip_t *strip)

Free LED strip resources.

Parameters
stripLED strip
Returns
  • ESP_OK: Free resources successfully
  • ESP_FAIL: Free resources failed because error occurred

Definition at line 90 of file led_strip_interface.h.

Referenced by led_strip_del(), led_strip_new_rmt_device(), led_strip_new_rmt_device(), and led_strip_new_spi_device().

◆ refresh

esp_err_t(* led_strip_t::refresh) (led_strip_t *strip)

Refresh memory colors to LEDs.

Parameters
stripLED strip
timeout_mstimeout value for refreshing task
Returns
  • ESP_OK: Refresh successfully
  • ESP_FAIL: Refresh failed because some other error occurred
Note
: After updating the LED colors in the memory, a following invocation of this API is needed to flush colors to strip.

Definition at line 67 of file led_strip_interface.h.

Referenced by led_strip_new_rmt_device(), led_strip_new_rmt_device(), led_strip_new_spi_device(), and led_strip_refresh().

◆ set_pixel

esp_err_t(* led_strip_t::set_pixel) (led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue)

Set RGB for a specific pixel.

Parameters
stripLED strip
indexindex of pixel to set
redred part of color
greengreen part of color
blueblue part of color
Returns
  • ESP_OK: Set RGB for a specific pixel successfully
  • ESP_ERR_INVALID_ARG: Set RGB for a specific pixel failed because of invalid parameters
  • ESP_FAIL: Set RGB for a specific pixel failed because other error occurred

Definition at line 35 of file led_strip_interface.h.

Referenced by led_strip_new_rmt_device(), led_strip_new_rmt_device(), led_strip_new_spi_device(), led_strip_set_pixel(), and led_strip_set_pixel_hsv().

◆ set_pixel_rgbw

esp_err_t(* led_strip_t::set_pixel_rgbw) (led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue, uint32_t white)

Set RGBW for a specific pixel. Similar to set_pixel but also set the white component.

Parameters
stripLED strip
indexindex of pixel to set
redred part of color
greengreen part of color
blueblue part of color
whiteseparate white component
Returns
  • ESP_OK: Set RGBW color for a specific pixel successfully
  • ESP_ERR_INVALID_ARG: Set RGBW color for a specific pixel failed because of an invalid argument
  • ESP_FAIL: Set RGBW color for a specific pixel failed because other error occurred

Definition at line 52 of file led_strip_interface.h.

Referenced by led_strip_new_rmt_device(), led_strip_new_spi_device(), and led_strip_set_pixel_rgbw().


The documentation for this struct was generated from the following file: