RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
led.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2022, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2022-3-08 GuEe-GUI the first version
9 */
10
11#ifndef __LED_H__
12#define __LED_H__
13
14#include <rthw.h>
15#include <rtdef.h>
16
17struct rt_led_ops;
18
28
30{
32
33 const struct rt_led_ops *ops;
34
36
37 void *sysdata;
38 void *priv;
39};
40
42{
43 rt_err_t (*set_state)(struct rt_led_device *led, enum rt_led_state state);
44 rt_err_t (*get_state)(struct rt_led_device *led, enum rt_led_state *out_state);
45 rt_err_t (*set_period)(struct rt_led_device *led, rt_uint32_t period_ms);
46 rt_err_t (*set_brightness)(struct rt_led_device *led, rt_uint32_t brightness);
47};
48
51
56
57#endif /* __LED_H__ */
rt_err_t rt_led_set_state(struct rt_led_device *led, enum rt_led_state state)
rt_err_t rt_led_set_period(struct rt_led_device *led, rt_uint32_t period_ms)
rt_err_t rt_hw_led_register(struct rt_led_device *led)
rt_err_t rt_led_set_brightness(struct rt_led_device *led, rt_uint32_t brightness)
rt_err_t rt_hw_led_unregister(struct rt_led_device *led)
rt_led_state
定义 led.h:20
@ RT_LED_S_ON
定义 led.h:22
@ RT_LED_STATE_NR
定义 led.h:26
@ RT_LED_S_BLINK
定义 led.h:24
@ RT_LED_S_TOGGLE
定义 led.h:23
@ RT_LED_S_OFF
定义 led.h:21
rt_err_t rt_led_get_state(struct rt_led_device *led, enum rt_led_state *out_state)
rt_base_t rt_err_t
unsigned int rt_uint32_t
const struct rt_led_ops * ops
定义 led.h:33
void * priv
定义 led.h:38
struct rt_device parent
定义 led.h:31
struct rt_spinlock spinlock
定义 led.h:35
void * sysdata
定义 led.h:37
rt_err_t(* set_period)(struct rt_led_device *led, rt_uint32_t period_ms)
定义 led.h:45
rt_err_t(* get_state)(struct rt_led_device *led, enum rt_led_state *out_state)
定义 led.h:44
rt_err_t(* set_state)(struct rt_led_device *led, enum rt_led_state state)
定义 led.h:43
rt_err_t(* set_brightness)(struct rt_led_device *led, rt_uint32_t brightness)
定义 led.h:46