4#include <zephyr/device.h>
8(c) >= '0' && (c) <= '9' ? (c) - '0' : \
9(c) >= 'a' && (c) <= 'f' ? (c) - 'a' + 10 : \
10(c) >= 'A' && (c) <= 'F' ? (c) - 'A' + 10 : 0 \
16#define _HEX_OFF(s) ((s)[0] == '#' ? 1 : 0)
23#define _HEX_BYTE(s, i, off) ( \
24(_HEX_C2I((s)[(off) + (i)*2]) << 4) | \
25(_HEX_C2I((s)[(off) + (i)*2 + 1])) \
28#define COLOR_HEX(s) { \
29.r = _HEX_BYTE(s, 0, _HEX_OFF(s)), \
30.g = _HEX_BYTE(s, 1, _HEX_OFF(s)), \
31.b = _HEX_BYTE(s, 2, _HEX_OFF(s)) \
static int led_pixel_off(const struct device *dev)
定义 led_pixel.h:68
int(* led_set_pixel_t)(const struct device *dev, struct led_color color, const uint8_t bright_percent)
定义 led_pixel.h:42
int(* led_pixel_off_t)(const struct device *dev)
定义 led_pixel.h:43
static int led_pixel_set(const struct device *dev, const struct led_color color, const uint8_t bright_percent)
设置像素 LED 的颜色
定义 led_pixel.h:61
int(* led_pixel_on_t)(const struct device *dev)
定义 led_pixel.h:44
static int led_pixel_on(const struct device *dev)
定义 led_pixel.h:74
uint8_t g
定义 led_pixel.h:38
uint8_t b
定义 led_pixel.h:39
uint8_t r
定义 led_pixel.h:37
led_set_pixel_t set_led_pixel
定义 led_pixel.h:48
led_pixel_on_t open_led
定义 led_pixel.h:50
led_pixel_off_t close_led
定义 led_pixel.h:49