RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
rt_inputcapture.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2019-08-13 balanceTWK first version.
9 */
10
11#ifndef __RT_INPUT_CAPTURE_H__
12#define __RT_INPUT_CAPTURE_H__
13
14#include <rtthread.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/* capture control command */
21#define INPUTCAPTURE_CMD_CLEAR_BUF (128 + 0) /* clear capture buf */
22#define INPUTCAPTURE_CMD_SET_WATERMARK (128 + 1) /* Set the callback threshold */
23
29
31{
33
34 const struct rt_inputcapture_ops *ops;
35 struct rt_ringbuffer *ringbuff;
37};
38
43{
44 rt_err_t (*init)(struct rt_inputcapture_device *inputcapture);
45 rt_err_t (*open)(struct rt_inputcapture_device *inputcapture);
46 rt_err_t (*close)(struct rt_inputcapture_device *inputcapture);
47 rt_err_t (*get_pulsewidth)(struct rt_inputcapture_device *inputcapture, rt_uint32_t *pulsewidth_us);
48};
49
51
53 const char *name,
54 void *data);
55#ifdef __cplusplus
56}
57#endif
58
59#endif /* __RT_INPUT_CAPTURE_H__ */
void rt_hw_inputcapture_isr(struct rt_inputcapture_device *inputcapture, rt_bool_t level)
rt_err_t rt_device_inputcapture_register(struct rt_inputcapture_device *inputcapture, const char *name, void *data)
int rt_bool_t
rt_base_t rt_err_t
rt_ubase_t rt_size_t
unsigned int rt_uint32_t
const struct rt_inputcapture_ops * ops
struct rt_ringbuffer * ringbuff
rt_err_t(* init)(struct rt_inputcapture_device *inputcapture)
rt_err_t(* close)(struct rt_inputcapture_device *inputcapture)
rt_err_t(* get_pulsewidth)(struct rt_inputcapture_device *inputcapture, rt_uint32_t *pulsewidth_us)
rt_err_t(* open)(struct rt_inputcapture_device *inputcapture)