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

宏定义

#define DT_DRV_COMPAT   status_leds
 
#define STATUS_LEDS_DEFINE(inst)
 

函数

 LOG_MODULE_REGISTER (status_leds, CONFIG_STATUS_LEDS_LOG_LEVEL)
 
static void heartbeat_timer_handler (const struct k_timer *timer)
 
static void error_single_blink_handler (const struct k_timer *timer)
 
static void error_blink_timer_handler (const struct k_timer *timer)
 错误闪烁定时器处理函数
 
static void status_set_heartbeat (const struct device *dev)
 
static void status_set_heartbeat_always_on (const struct device *dev)
 
static int status_leds_set_error_always_on (const struct device *dev)
 
static int status_leds_set_error_blink (const struct device *dev, const uint8_t times)
 
static void status_leds_remove_error (const struct device *dev)
 
static int status_leds_init (const struct device *dev)
 

变量

static const struct status_leds_api status_leds_funcs
 

宏定义说明

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   status_leds

◆ STATUS_LEDS_DEFINE

#define STATUS_LEDS_DEFINE ( inst)
值:
static struct status_leds_data data##inst; \
static struct status_leds_config config##inst = { \
.leds = DEVICE_DT_GET(DT_INST_PHANDLE(inst, leds)), \
.heartbeat_led_index = DT_INST_PROP_OR(inst, heartbeat_led_index, 0U), \
.error_led_index = DT_INST_PROP_OR(inst, error_led_index, 0U), \
.heartbeat_blink_interval_ms = CONFIG_HEARTBEAT_LED_BLINK_INTERVAL, \
.error_interval_ms = CONFIG_ERROR_LED_INTERVAL, \
}; \
DEVICE_DT_INST_DEFINE(inst, status_leds_init, NULL, &data##inst, &config##inst, POST_KERNEL, \
CONFIG_STATUS_LEDS_INIT_PRIORITY, &status_leds_funcs);
static int status_leds_init(const struct device *dev)
定义 status_leds.c:181
static const struct status_leds_api status_leds_funcs
定义 status_leds.c:173
定义 status_leds.h:7
定义 status_leds.h:16

函数说明

◆ error_blink_timer_handler()

static void error_blink_timer_handler ( const struct k_timer * timer)
static

错误闪烁定时器处理函数

参数
timerk_timer 定时器指针

◆ error_single_blink_handler()

static void error_single_blink_handler ( const struct k_timer * timer)
static

◆ heartbeat_timer_handler()

static void heartbeat_timer_handler ( const struct k_timer * timer)
static

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( status_leds ,
CONFIG_STATUS_LEDS_LOG_LEVEL  )

◆ status_leds_init()

static int status_leds_init ( const struct device * dev)
static

◆ status_leds_remove_error()

static void status_leds_remove_error ( const struct device * dev)
static

◆ status_leds_set_error_always_on()

static int status_leds_set_error_always_on ( const struct device * dev)
static

◆ status_leds_set_error_blink()

static int status_leds_set_error_blink ( const struct device * dev,
const uint8_t times )
static

◆ status_set_heartbeat()

static void status_set_heartbeat ( const struct device * dev)
static

◆ status_set_heartbeat_always_on()

static void status_set_heartbeat_always_on ( const struct device * dev)
static

变量说明

◆ status_leds_funcs

const struct status_leds_api status_leds_funcs
static
初始值:
= {
.set_heartbeat = &status_set_heartbeat,
.set_heartbeat_always_on = &status_set_heartbeat_always_on,
.set_error_always_on = &status_leds_set_error_always_on,
.set_error_blink = &status_leds_set_error_blink,
.remove_error = &status_leds_remove_error,
}
static void status_set_heartbeat_always_on(const struct device *dev)
定义 status_leds.c:107
static int status_leds_set_error_blink(const struct device *dev, const uint8_t times)
定义 status_leds.c:124
static void status_leds_remove_error(const struct device *dev)
定义 status_leds.c:143
static void status_set_heartbeat(const struct device *dev)
定义 status_leds.c:101
static int status_leds_set_error_always_on(const struct device *dev)
定义 status_leds.c:113