diff options
| author | tangweikang <[email protected]> | 2019-08-21 10:40:20 +0800 |
|---|---|---|
| committer | tangweikang <[email protected]> | 2019-08-21 10:51:02 +0800 |
| commit | f9bad31d57132fce38cc1036efaec045ca21c79b (patch) | |
| tree | c46a9805dfd580661ed2eb1c379303e605d4e333 /components/drivers/include | |
| parent | e1587de6f77936a6795fc0d4042fb641e00ecba8 (diff) | |
[components][drivers] change name: capture -> inputcapture
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/rt_capture.h | 60 | ||||
| -rw-r--r-- | components/drivers/include/drivers/rt_inputcapture.h | 60 | ||||
| -rw-r--r-- | components/drivers/include/rtdevice.h | 4 |
3 files changed, 62 insertions, 62 deletions
diff --git a/components/drivers/include/drivers/rt_capture.h b/components/drivers/include/drivers/rt_capture.h deleted file mode 100644 index fe72997b43..0000000000 --- a/components/drivers/include/drivers/rt_capture.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-08-13 balanceTWK first version. - */ - -#ifndef __RT_CAPTURE_H__ -#define __RT_CAPTURE_H__ - -#include <rtthread.h> -#include <rtdevice.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* capture control command */ -#define CAPTURE_CMD_CLEAR_BUF (128 + 0) /* clear capture buf */ -#define CAPTURE_CMD_SET_WATERMARK (128 + 1) /* Set the callback threshold */ - -struct capture_data -{ - rt_uint32_t pulsewidth_us; - rt_bool_t is_high; -}; - -struct rt_capture_device -{ - struct rt_device parent; - - const struct rt_capture_ops *ops; - struct rt_ringbuffer *ringbuff; - rt_size_t watermark; -}; - -/** - * capture operators - */ -struct rt_capture_ops -{ - rt_err_t (*init)(struct rt_capture_device *capture); - rt_err_t (*open)(struct rt_capture_device *capture); - rt_err_t (*close)(struct rt_capture_device *capture); - rt_err_t (*get_pulsewidth)(struct rt_capture_device *capture, rt_uint32_t *pulsewidth_us); -}; - -void rt_hw_capture_isr(struct rt_capture_device *capture, rt_bool_t level); - -rt_err_t rt_device_capture_register(struct rt_capture_device *capture, - const char *name, - void *data); -#ifdef __cplusplus -} -#endif - -#endif /* __RT_CAPTURE_H__ */ diff --git a/components/drivers/include/drivers/rt_inputcapture.h b/components/drivers/include/drivers/rt_inputcapture.h new file mode 100644 index 0000000000..0cadf6444c --- /dev/null +++ b/components/drivers/include/drivers/rt_inputcapture.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-08-13 balanceTWK first version. + */ + +#ifndef __RT_INPUT_CAPTURE_H__ +#define __RT_INPUT_CAPTURE_H__ + +#include <rtthread.h> +#include <rtdevice.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* capture control command */ +#define INPUTCAPTURE_CMD_CLEAR_BUF (128 + 0) /* clear capture buf */ +#define INPUTCAPTURE_CMD_SET_WATERMARK (128 + 1) /* Set the callback threshold */ + +struct rt_inputcapture_data +{ + rt_uint32_t pulsewidth_us; + rt_bool_t is_high; +}; + +struct rt_inputcapture_device +{ + struct rt_device parent; + + const struct rt_inputcapture_ops *ops; + struct rt_ringbuffer *ringbuff; + rt_size_t watermark; +}; + +/** + * capture operators + */ +struct rt_inputcapture_ops +{ + rt_err_t (*init)(struct rt_inputcapture_device *inputcapture); + rt_err_t (*open)(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); +}; + +void rt_hw_capture_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); +#ifdef __cplusplus +} +#endif + +#endif /* __RT_INPUT_CAPTURE_H__ */ diff --git a/components/drivers/include/rtdevice.h b/components/drivers/include/rtdevice.h index 3ba7f72357..bb302ac2af 100644 --- a/components/drivers/include/rtdevice.h +++ b/components/drivers/include/rtdevice.h @@ -130,8 +130,8 @@ extern "C" { #include "drivers/encoder.h" #endif -#ifdef RT_USING_CAPTURE -#include "drivers/rt_capture.h" +#ifdef RT_USING_INPUT_CAPTURE +#include "drivers/rt_inputcapture.h" #endif #ifdef __cplusplus |
