One Framework 0.1.0
RoboMaster嵌入式框架“一键”解决方案,为你的“创意”服务。
载入中...
搜索中...
未找到
led_pixel.c 文件参考
#include <OF/drivers/output/led_pixel.h>
#include <zephyr/drivers/led.h>
led_pixel.c 的引用(Include)关系图:

结构体

struct  led_pixel_pwm_config
 

宏定义

#define DT_DRV_COMPAT   led_pixel_pwm
 
#define GET_LED_DEV(inst, prop)
 
#define GET_LED_IDX(inst, prop)
 
#define INST_PWM(n)
 

函数

static uint8_t led_scale_int (const uint16_t v, const uint8_t p)
 
static int led_pixel_pwm_set (const struct device *dev, const struct led_color color, const uint8_t bright_percent)
 
static int led_pixel_pwm_off (const struct device *dev)
 
static int led_pixel_pwm_on (const struct device *dev)
 
 DT_INST_FOREACH_STATUS_OKAY (INST_PWM)
 

宏定义说明

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   led_pixel_pwm

◆ GET_LED_DEV

#define GET_LED_DEV ( inst,
prop )
值:
DEVICE_DT_GET(DT_PARENT(DT_INST_PHANDLE(inst, prop)))

◆ GET_LED_IDX

#define GET_LED_IDX ( inst,
prop )
值:
DT_NODE_CHILD_IDX(DT_INST_PHANDLE(inst, prop))

◆ INST_PWM

#define INST_PWM ( n)
值:
static const struct led_pixel_pwm_config config_pwm_##n = { \
.dev_r = GET_LED_DEV(n, red_led), \
.dev_g = GET_LED_DEV(n, green_led), \
.dev_b = GET_LED_DEV(n, blue_led), \
.ch_r = GET_LED_IDX(n, red_led), \
.ch_g = GET_LED_IDX(n, green_led), \
.ch_b = GET_LED_IDX(n, blue_led), \
}; \
\
static const struct led_pixel_api api_pwm_##n = { \
.set_led_pixel = led_pixel_pwm_set, \
.close_led = led_pixel_pwm_off, \
.open_led = led_pixel_pwm_on, \
}; \
\
DEVICE_DT_INST_DEFINE(n, NULL, NULL, NULL, \
&config_pwm_##n, POST_KERNEL, 50, \
&api_pwm_##n);
static int led_pixel_pwm_on(const struct device *dev)
定义 led_pixel.c:69
#define GET_LED_IDX(inst, prop)
定义 led_pixel.c:99
#define GET_LED_DEV(inst, prop)
定义 led_pixel.c:96
static int led_pixel_pwm_set(const struct device *dev, const struct led_color color, const uint8_t bright_percent)
定义 led_pixel.c:20
static int led_pixel_pwm_off(const struct device *dev)
定义 led_pixel.c:45
定义 led_pixel.h:47
定义 led_pixel.c:15

函数说明

◆ DT_INST_FOREACH_STATUS_OKAY()

DT_INST_FOREACH_STATUS_OKAY ( INST_PWM )

◆ led_pixel_pwm_off()

static int led_pixel_pwm_off ( const struct device * dev)
static

◆ led_pixel_pwm_on()

static int led_pixel_pwm_on ( const struct device * dev)
static

◆ led_pixel_pwm_set()

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

◆ led_scale_int()

static uint8_t led_scale_int ( const uint16_t v,
const uint8_t p )
inlinestatic