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
17
extern
"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
24
struct
rt_inputcapture_data
25
{
26
rt_uint32_t
pulsewidth_us
;
27
rt_bool_t
is_high
;
28
};
29
30
struct
rt_inputcapture_device
31
{
32
struct
rt_device
parent
;
33
34
const
struct
rt_inputcapture_ops
*
ops
;
35
struct
rt_ringbuffer *
ringbuff
;
36
rt_size_t
watermark
;
37
};
38
42
struct
rt_inputcapture_ops
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
50
void
rt_hw_inputcapture_isr
(
struct
rt_inputcapture_device
*inputcapture,
rt_bool_t
level);
51
52
rt_err_t
rt_device_inputcapture_register
(
struct
rt_inputcapture_device
*inputcapture,
53
const
char
*name,
54
void
*data);
55
#ifdef __cplusplus
56
}
57
#endif
58
59
#endif
/* __RT_INPUT_CAPTURE_H__ */
rt_hw_inputcapture_isr
void rt_hw_inputcapture_isr(struct rt_inputcapture_device *inputcapture, rt_bool_t level)
rt_device_inputcapture_register
rt_err_t rt_device_inputcapture_register(struct rt_inputcapture_device *inputcapture, const char *name, void *data)
rtthread.h
rt_bool_t
int rt_bool_t
定义
rttypes.h:35
rt_err_t
rt_base_t rt_err_t
定义
rttypes.h:84
rt_size_t
rt_ubase_t rt_size_t
定义
rttypes.h:78
rt_uint32_t
unsigned int rt_uint32_t
定义
rttypes.h:53
rt_device
定义
rtdef.h:1370
rt_inputcapture_data
定义
rt_inputcapture.h:25
rt_inputcapture_data::pulsewidth_us
rt_uint32_t pulsewidth_us
定义
rt_inputcapture.h:26
rt_inputcapture_data::is_high
rt_bool_t is_high
定义
rt_inputcapture.h:27
rt_inputcapture_device
定义
rt_inputcapture.h:31
rt_inputcapture_device::ops
const struct rt_inputcapture_ops * ops
定义
rt_inputcapture.h:34
rt_inputcapture_device::watermark
rt_size_t watermark
定义
rt_inputcapture.h:36
rt_inputcapture_device::parent
struct rt_device parent
定义
rt_inputcapture.h:32
rt_inputcapture_device::ringbuff
struct rt_ringbuffer * ringbuff
定义
rt_inputcapture.h:35
rt_inputcapture_ops
定义
rt_inputcapture.h:43
rt_inputcapture_ops::init
rt_err_t(* init)(struct rt_inputcapture_device *inputcapture)
定义
rt_inputcapture.h:44
rt_inputcapture_ops::close
rt_err_t(* close)(struct rt_inputcapture_device *inputcapture)
定义
rt_inputcapture.h:46
rt_inputcapture_ops::get_pulsewidth
rt_err_t(* get_pulsewidth)(struct rt_inputcapture_device *inputcapture, rt_uint32_t *pulsewidth_us)
定义
rt_inputcapture.h:47
rt_inputcapture_ops::open
rt_err_t(* open)(struct rt_inputcapture_device *inputcapture)
定义
rt_inputcapture.h:45
components
drivers
include
drivers
rt_inputcapture.h
制作者
1.13.1