mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-06 21:44:34 +08:00
[components][rtc] Add microsecond resolution support with RTC framework V2.0
This commit is contained in:
parent
e62943abd2
commit
2bd7e04827
@ -27,6 +27,8 @@ struct rt_rtc_ops
|
|||||||
rt_err_t (*set_secs)(void *arg);
|
rt_err_t (*set_secs)(void *arg);
|
||||||
rt_err_t (*get_alarm)(void *arg);
|
rt_err_t (*get_alarm)(void *arg);
|
||||||
rt_err_t (*set_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
|
typedef struct rt_rtc_device
|
||||||
|
@ -61,6 +61,12 @@ static rt_err_t rt_rtc_core_control(struct rt_device *dev,
|
|||||||
case RT_DEVICE_CTRL_RTC_SET_TIME:
|
case RT_DEVICE_CTRL_RTC_SET_TIME:
|
||||||
ret = TRY_DO_RTC_FUNC(rtc_core, set_secs, args);
|
ret = TRY_DO_RTC_FUNC(rtc_core, set_secs, args);
|
||||||
break;
|
break;
|
||||||
|
case RT_DEVICE_CTRL_RTC_GET_TIME_US:
|
||||||
|
ret = TRY_DO_RTC_FUNC(rtc_core, get_usecs, args);
|
||||||
|
break;
|
||||||
|
case RT_DEVICE_CTRL_RTC_SET_TIME_US:
|
||||||
|
ret = TRY_DO_RTC_FUNC(rtc_core, set_usecs, args);
|
||||||
|
break;
|
||||||
case RT_DEVICE_CTRL_RTC_GET_ALARM:
|
case RT_DEVICE_CTRL_RTC_GET_ALARM:
|
||||||
ret = TRY_DO_RTC_FUNC(rtc_core, get_alarm, args);
|
ret = TRY_DO_RTC_FUNC(rtc_core, get_alarm, args);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user