diff options
| author | Lim-LinYuanbo <[email protected]> | 2021-08-15 14:50:31 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-15 14:50:31 +0800 |
| commit | 7c5f552103f82d37d694c6d2c1c60e35a4503f72 (patch) | |
| tree | eef14793c2f0f196ead869341afbe06ab9b7944e /components/drivers/include | |
| parent | 0e28321c2cfe8273234135a78ce78ac0c4d1d505 (diff) | |
| parent | fea12e0903bf0d2e6efed7aa6838c28d1006e1f5 (diff) | |
Merge branch 'RT-Thread:master' into master
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/mmcsd_core.h | 1 | ||||
| -rw-r--r-- | components/drivers/include/drivers/rtc.h | 34 | ||||
| -rw-r--r-- | components/drivers/include/drivers/rtc_core.h | 45 | ||||
| -rw-r--r-- | components/drivers/include/ipc/workqueue.h | 14 |
4 files changed, 35 insertions, 59 deletions
diff --git a/components/drivers/include/drivers/mmcsd_core.h b/components/drivers/include/drivers/mmcsd_core.h index 11b1386b23..51263d35f2 100644 --- a/components/drivers/include/drivers/mmcsd_core.h +++ b/components/drivers/include/drivers/mmcsd_core.h @@ -234,7 +234,6 @@ struct rt_mmcsd_host *mmcsd_alloc_host(void); void mmcsd_free_host(struct rt_mmcsd_host *host); int rt_mmcsd_core_init(void); -int rt_mmcsd_blk_init(void); rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card); void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card); diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/rtc.h index 9eddf801b7..0bafbad7ad 100644 --- a/components/drivers/include/drivers/rtc.h +++ b/components/drivers/include/drivers/rtc.h @@ -6,13 +6,43 @@ * Change Logs: * Date Author Notes * 2012-10-10 aozima first version. + * 2021-06-11 iysheng implement RTC framework V2.0 + * 2021-07-30 Meco Man move rtc_core.h to rtc.h */ #ifndef __RTC_H__ #define __RTC_H__ -#include <rtconfig.h> -#include <drivers/rtc_core.h> +#include <rtdef.h> + +#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10 /**< get second time */ +#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11 /**< set second time */ +#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12 /**< get microsecond time */ +#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13 /**< set microsecond time */ +#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14 /**< get alarm */ +#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15 /**< set alarm */ + +struct rt_rtc_ops +{ + rt_err_t (*init)(void); + rt_err_t (*get_secs)(void *arg); + rt_err_t (*set_secs)(void *arg); + rt_err_t (*get_alarm)(void *arg); + rt_err_t (*set_alarm)(void *arg); + rt_err_t (*get_usecs)(void *arg); + rt_err_t (*set_usecs)(void *arg); +}; + +typedef struct rt_rtc_device +{ + struct rt_device parent; + const struct rt_rtc_ops *ops; +} rt_rtc_dev_t; + +rt_err_t rt_hw_rtc_register(rt_rtc_dev_t *rtc, + const char *name, + rt_uint32_t flag, + void *data); rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day); rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second); diff --git a/components/drivers/include/drivers/rtc_core.h b/components/drivers/include/drivers/rtc_core.h deleted file mode 100644 index f0c7b64e94..0000000000 --- a/components/drivers/include/drivers/rtc_core.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021-06-11 iysheng first version. - */ - -#ifndef __RTC_CORE_H__ -#define __RTC_CORE_H__ - -#include <rtthread.h> - -#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10 /**< get second time */ -#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11 /**< set second time */ -#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12 /**< get microsecond time */ -#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13 /**< set microsecond time */ -#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14 /**< get alarm */ -#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15 /**< set alarm */ - -struct rt_rtc_ops -{ - rt_err_t (*init)(void); - rt_err_t (*get_secs)(void *arg); - rt_err_t (*set_secs)(void *arg); - rt_err_t (*get_alarm)(void *arg); - rt_err_t (*set_alarm)(void *arg); - rt_err_t (*get_usecs)(void *arg); - rt_err_t (*set_usecs)(void *arg); -}; - -typedef struct rt_rtc_device -{ - struct rt_device parent; - const struct rt_rtc_ops *ops; -} rt_rtc_dev_t; - -rt_err_t rt_rtc_dev_register(rt_rtc_dev_t *rtc, - const char *name, - rt_uint32_t flag, - void *data); - -#endif /* __RTC_CORE_H__ */ diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h index 03d38b2f4d..03904d852e 100644 --- a/components/drivers/include/ipc/workqueue.h +++ b/components/drivers/include/ipc/workqueue.h @@ -5,6 +5,7 @@ * * Change Logs: * Date Author Notes + * 2021-08-01 Meco Man remove rt_delayed_work_init() and rt_delayed_work structure */ #ifndef WORKQUEUE_H__ #define WORKQUEUE_H__ @@ -48,11 +49,6 @@ struct rt_work struct rt_workqueue *workqueue; }; -struct rt_delayed_work -{ - struct rt_work work; -}; - #ifdef RT_USING_HEAP /** * WorkQueue for DeviceDriver @@ -69,7 +65,7 @@ rt_err_t rt_workqueue_critical_work(struct rt_workqueue *queue, struct rt_work * #ifdef RT_USING_SYSTEM_WORKQUEUE rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time); rt_err_t rt_work_cancel(struct rt_work *work); -#endif +#endif /* RT_USING_SYSTEM_WORKQUEUE */ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data), void *work_data) @@ -82,10 +78,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo work->type = 0; } -void rt_delayed_work_init(struct rt_delayed_work *work, void (*work_func)(struct rt_work *work, - void *work_data), void *work_data); - -int rt_work_sys_workqueue_init(void); -#endif +#endif /* RT_USING_HEAP */ #endif |
