[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 (*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
|
||||
|
|
|
@ -61,6 +61,12 @@ static rt_err_t rt_rtc_core_control(struct rt_device *dev,
|
|||
case RT_DEVICE_CTRL_RTC_SET_TIME:
|
||||
ret = TRY_DO_RTC_FUNC(rtc_core, set_secs, args);
|
||||
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:
|
||||
ret = TRY_DO_RTC_FUNC(rtc_core, get_alarm, args);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue