One Framework 0.1.0
RoboMaster嵌入式框架“一键”解决方案,为你的“创意”服务。
载入中...
搜索中...
未找到
led_pixel.h 文件参考
#include <zephyr/device.h>
#include <stdint.h>
led_pixel.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

结构体

struct  led_color
 
struct  led_pixel_api
 

宏定义

#define _HEX_C2I(c)
 
#define _HEX_OFF(s)
 
#define _HEX_BYTE(s, i, off)
 
#define COLOR_HEX(s)
 

类型定义

typedef int(* led_set_pixel_t) (const struct device *dev, struct led_color color, const uint8_t bright_percent)
 
typedef int(* led_pixel_off_t) (const struct device *dev)
 
typedef int(* led_pixel_on_t) (const struct device *dev)
 

函数

static int led_pixel_set (const struct device *dev, const struct led_color color, const uint8_t bright_percent)
 设置像素 LED 的颜色
 
static int led_pixel_off (const struct device *dev)
 
static int led_pixel_on (const struct device *dev)
 

宏定义说明

◆ _HEX_BYTE

#define _HEX_BYTE ( s,
i,
off )
值:
( \
(_HEX_C2I((s)[(off) + (i)*2]) << 4) | \
(_HEX_C2I((s)[(off) + (i)*2 + 1])) \
)
#define _HEX_C2I(c)
定义 led_pixel.h:7

◆ _HEX_C2I

#define _HEX_C2I ( c)
值:
( \
(c) >= '0' && (c) <= '9' ? (c) - '0' : \
(c) >= 'a' && (c) <= 'f' ? (c) - 'a' + 10 : \
(c) >= 'A' && (c) <= 'F' ? (c) - 'A' + 10 : 0 \
)

◆ _HEX_OFF

#define _HEX_OFF ( s)
值:
((s)[0] == '#' ? 1 : 0)

◆ COLOR_HEX

#define COLOR_HEX ( s)
值:
{ \
.r = _HEX_BYTE(s, 0, _HEX_OFF(s)), \
.g = _HEX_BYTE(s, 1, _HEX_OFF(s)), \
.b = _HEX_BYTE(s, 2, _HEX_OFF(s)) \
}
#define _HEX_OFF(s)
定义 led_pixel.h:16
#define _HEX_BYTE(s, i, off)
定义 led_pixel.h:23

类型定义说明

◆ led_pixel_off_t

typedef int(* led_pixel_off_t) (const struct device *dev)

◆ led_pixel_on_t

typedef int(* led_pixel_on_t) (const struct device *dev)

◆ led_set_pixel_t

typedef int(* led_set_pixel_t) (const struct device *dev, struct led_color color, const uint8_t bright_percent)

函数说明

◆ led_pixel_off()

static int led_pixel_off ( const struct device * dev)
inlinestatic

◆ led_pixel_on()

static int led_pixel_on ( const struct device * dev)
inlinestatic

◆ led_pixel_set()

static int led_pixel_set ( const struct device * dev,
const struct led_color color,
const uint8_t bright_percent )
inlinestatic

设置像素 LED 的颜色

参数
dev设备指针 (指向你的虚拟设备)
colorRGB 颜色
bright_percent亮度百分比 (0 ~ 100)
返回
0 成功, 负数 失败