- Notifications
You must be signed in to change notification settings - Fork 7.6k
/
Copy pathesp32-hal-rgb-led.h
40 lines (30 loc) · 1005 Bytes
/
esp32-hal-rgb-led.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndefMAIN_ESP32_HAL_RGB_LED_H_
#defineMAIN_ESP32_HAL_RGB_LED_H_
#ifdef__cplusplus
extern"C" {
#endif
#include"esp32-hal.h"
#ifndefRGB_BRIGHTNESS
#defineRGB_BRIGHTNESS 64
#endif
#ifndefRGB_BUILTIN_LED_COLOR_ORDER
#defineRGB_BUILTIN_LED_COLOR_ORDER LED_COLOR_ORDER_GRB // default WS2812B color order
#endif
typedefenum {
LED_COLOR_ORDER_RGB,
LED_COLOR_ORDER_BGR,
LED_COLOR_ORDER_BRG,
LED_COLOR_ORDER_RBG,
LED_COLOR_ORDER_GBR,
LED_COLOR_ORDER_GRB
} rgb_led_color_order_t;
voidrgbLedWriteOrdered(uint8_tpin, rgb_led_color_order_torder, uint8_tred_val, uint8_tgreen_val, uint8_tblue_val);
// Will use RGB_BUILTIN_LED_COLOR_ORDER
voidrgbLedWrite(uint8_tpin, uint8_tred_val, uint8_tgreen_val, uint8_tblue_val);
// Backward compatibility - Deprecated. It will be removed in future releases.
[[deprecated("Use rgbLedWrite() instead.")]]
voidneopixelWrite(uint8_tp, uint8_tr, uint8_tg, uint8_tb);
#ifdef__cplusplus
}
#endif
#endif/* MAIN_ESP32_HAL_RGB_LED_H_ */