diff options
| author | xqyjlj <[email protected]> | 2023-07-17 20:11:58 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-17 20:11:58 +0800 |
| commit | 0eb75ced70a514051fcc6a8f1d232e195b15b4a0 (patch) | |
| tree | a025fe349198fa0fe6f972ea1100ac31ba64787a /components/drivers/include | |
| parent | b424169e1742c1b19d039f9871dd3c672ea7b729 (diff) | |
[time]时钟框架重构 (#7794)
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/rtc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/rtc.h index ce364d79a8..0aacc4665f 100644 --- a/components/drivers/include/drivers/rtc.h +++ b/components/drivers/include/drivers/rtc.h @@ -27,6 +27,9 @@ extern "C" { #define RT_DEVICE_CTRL_RTC_SET_TIMEVAL (RT_DEVICE_CTRL_BASE(RTC) + 0x04) /**< set timeval for gettimeofday */ #define RT_DEVICE_CTRL_RTC_GET_ALARM (RT_DEVICE_CTRL_BASE(RTC) + 0x05) /**< get alarm */ #define RT_DEVICE_CTRL_RTC_SET_ALARM (RT_DEVICE_CTRL_BASE(RTC) + 0x06) /**< set alarm */ +#define RT_DEVICE_CTRL_RTC_GET_TIMESPEC (RT_DEVICE_CTRL_BASE(RTC) + 0x07) /**< get timespec for clock_gettime */ +#define RT_DEVICE_CTRL_RTC_SET_TIMESPEC (RT_DEVICE_CTRL_BASE(RTC) + 0x08) /**< set timespec for clock_settime */ +#define RT_DEVICE_CTRL_RTC_GET_TIMERES (RT_DEVICE_CTRL_BASE(RTC) + 0x09) /**< get resolution for clock_getres */ /* used for alarm function */ struct rt_rtc_wkalarm @@ -64,6 +67,11 @@ rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second); rt_err_t set_timestamp(time_t timestamp); rt_err_t get_timestamp(time_t *timestamp); +#ifdef RT_USING_SYSTEM_WORKQUEUE +rt_err_t rt_soft_rtc_sync(); +rt_err_t rt_soft_rtc_set_source(const char *name); +#endif + #ifdef __cplusplus } #endif |
