From f9bad31d57132fce38cc1036efaec045ca21c79b Mon Sep 17 00:00:00 2001 From: tangweikang Date: Wed, 21 Aug 2019 10:40:20 +0800 Subject: [components][drivers] change name: capture -> inputcapture --- components/drivers/include/drivers/rt_capture.h | 60 ---------------------- .../drivers/include/drivers/rt_inputcapture.h | 60 ++++++++++++++++++++++ components/drivers/include/rtdevice.h | 4 +- 3 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 components/drivers/include/drivers/rt_capture.h create mode 100644 components/drivers/include/drivers/rt_inputcapture.h (limited to 'components/drivers/include') 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 -#include - -#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 +#include + +#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 -- cgit v1.3.1