You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: led_strip/api.md
+92-61
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,6 @@
21
21
| esp\_err\_t |[**led\_strip\_set\_pixel\_hsv**](#function-led_strip_set_pixel_hsv) ([**led\_strip\_handle\_t**](#typedef-led_strip_handle_t) strip, uint32\_t index, uint16\_t hue, uint8\_t saturation, uint8\_t value) <br>_Set HSV for a specific pixel._|
22
22
| esp\_err\_t |[**led\_strip\_set\_pixel\_rgbw**](#function-led_strip_set_pixel_rgbw) ([**led\_strip\_handle\_t**](#typedef-led_strip_handle_t) strip, uint32\_t index, uint32\_t red, uint32\_t green, uint32\_t blue, uint32\_t white) <br>_Set RGBW for a specific pixel._|
23
23
24
-
## Macros
25
-
26
-
| Type | Name |
27
-
| ---: | :--- |
28
-
| define |[**LED\_STRIP\_SET\_RGBW\_ORDER**](#define-led_strip_set_rgbw_order) (R, G, B, W) (R << 0 \| G << 2 \| B << 4 \| W << 6)<br>_Help macro to set pixel RGBW color order The default order of the four-color LED strips is GRBW. If you have a different order, you can use the macro to set_`pixel_order`_in_[_**led\_strip\_config\_t**_](#struct-led_strip_config_t)_. The positions are counted from the least significant bit (LSB)._|
29
-
| define |[**LED\_STRIP\_SET\_RGB\_ORDER**](#define-led_strip_set_rgb_order) (R, G, B) (R << 0 \| G << 2 \| B << 4)<br>_Help macro to set pixel RGB color order The default order of the three-color LED strips is GRB. If you have a different order, you can use the macro to set_`pixel_order`_in_[_**led\_strip\_config\_t**_](#struct-led_strip_config_t)_. The positions are counted from the least significant bit (LSB)._|
30
-
31
24
## Functions Documentation
32
25
33
26
### function `led_strip_clear`
@@ -185,52 +178,14 @@ Also see `led_strip_set_pixel` if you only want to specify the RGB part of the c
185
178
- ESP\_ERR\_INVALID\_ARG: Set RGBW color for a specific pixel failed because of an invalid argument
186
179
- ESP\_FAIL: Set RGBW color for a specific pixel failed because other error occurred
187
180
188
-
## Macros Documentation
189
-
190
-
### define `LED_STRIP_SET_RGBW_ORDER`
191
-
192
-
_Help macro to set pixel RGBW color order The default order of the four-color LED strips is GRBW. If you have a different order, you can use the macro to set_`pixel_order`_in_[_**led\_strip\_config\_t**_](#struct-led_strip_config_t)_. The positions are counted from the least significant bit (LSB)._
193
-
194
-
```c
195
-
#defineLED_STRIP_SET_RGBW_ORDER (R, G, B, W) (R << 0 | G << 2 | B << 4 | W << 6)
196
-
```
197
-
198
-
**Parameters:**
199
-
200
-
- `R` The position of the red channel in the color order.
201
-
- `G` The position of the green channel in the color order.
202
-
- `B` The position of the blue channel in the color order.
203
-
- `W` The position of the white channel in the color order.
204
-
205
-
**Note:**
206
-
207
-
The order starts from 0. And the user needs to make sure that all the numbers appear exactly once and are all less than the number of colors per pixel.
208
-
209
-
### define `LED_STRIP_SET_RGB_ORDER`
210
-
211
-
_Help macro to set pixel RGB color order The default order of the three-color LED strips is GRB. If you have a different order, you can use the macro to set_ `pixel_order`_in_[_**led\_strip\_config\_t**_](#struct-led_strip_config_t)_. The positions are counted from the least significant bit (LSB)._
212
-
213
-
```c
214
-
#define LED_STRIP_SET_RGB_ORDER (R, G, B) (R << 0 | G << 2 | B << 4)
215
-
```
216
-
217
-
**Parameters:**
218
-
219
-
- `R` The position of the red channel in the color order.
220
-
- `G` The position of the green channel in the color order.
221
-
- `B` The position of the blue channel in the color order.
222
-
223
-
**Note:**
224
-
225
-
The order starts from 0. And the user needs to make sure that all the numbers appear exactly once and are all less than the number of colors per pixel.
226
-
227
181
## File include/led_strip_rmt.h
228
182
229
183
## Structures and Types
230
184
231
185
| Type | Name |
232
186
| ---: | :--- |
233
187
| struct |[**led\_strip\_rmt\_config\_t**](#struct-led_strip_rmt_config_t) <br>_LED Strip RMT specific configuration._|
- size\_t mem_block_symbols <br>How many RMT symbols can one RMT channel hold at one time. Set to 0 will fallback to use the default size.
208
+
- size\_t mem_block_symbols <br>How many RMT symbols can one RMT channel hold at one time. Set to 0 will fallback to use the default size. Extra RMT specific driver flags
254
209
255
210
- uint32\_t resolution_hz <br>RMT tick resolution, if set to zero, a default resolution (10MHz) will be applied
| struct | [**led\_strip\_config\_t**](#struct-led_strip_config_t) <br>_LED Strip common configurations The common configurations are not specific to any backend peripheral._ |
- uint32\_t b_pos <br>Position of the blue channel in the color order: 0~3
350
+
351
+
- uint32\_t g_pos <br>Position of the green channel in the color order: 0~3
352
+
353
+
- uint32\_t num_components <br>Number of color components per pixel: 3 or 4. If set to 0, it will fallback to 3
354
+
355
+
- uint32\_t r_pos <br>Position of the red channel in the color order: 0~3
356
+
357
+
- uint32\_t reserved <br>Reserved
358
+
359
+
- uint32\_t w_pos <br>Position of the white channel in the color order: 0~3
360
+
360
361
### enum `led_model_t`
361
362
362
363
_LED strip model._
@@ -375,40 +376,70 @@ Different led model may have different timing parameters, so we need to distingu
375
376
376
377
### struct `led_strip_config_t`
377
378
378
-
_LED Strip Configuration._
379
+
_LED Strip common configurations The common configurations are not specific to any backend peripheral._
379
380
380
381
Variables:
381
382
382
-
-uint8\_t bytes_per_pixel <br>bytes per LED pixel. Should be 3 or 4
383
+
-[**led\_color\_component\_format\_t**](#union-led_color_component_format_t) color_component_format <br>Specifies the order of color components in each pixel. Use helper macros like `LED_STRIP_COLOR_COMPONENT_FMT_GRB` to set the format LED strip extra driver flags
383
384
384
-
- struct led\_strip\_config\_t::@2 flags <br>The order of the pixel color. Use help macro LED\_STRIP\_SET\_RGB\_ORDER or LED\_STRIP\_SET\_RGBW\_ORDER to set. Not set or set to 0 if the default order is used. Extra driver flags
0 commit comments