This driver works with a configurable time unit called tick. sl_status_t sl_sleeptimer_set_datetime(sl_sleeptimer_date_t *date).sl_status_t sl_sleeptimer_get_datetime(sl_sleeptimer_date_t *date).The previously described internal timestamp can also be accessed through a date format sl_sleeptimer_date_t. sl_status_t sl_sleeptimer_convert_zigbee_time_to_unix(uint32_t zigbee_time, sl_sleeptimer_timestamp_t *time).sl_status_t sl_sleeptimer_convert_unix_time_to_zigbee(sl_sleeptimer_timestamp_t time, uint32_t *zigbee_time).sl_status_t sl_sleeptimer_convert_ntp_time_to_unix(uint32_t ntp_time, sl_sleeptimer_timestamp_t *time). sl_status_t sl_sleeptimer_convert_unix_time_to_ntp(sl_sleeptimer_timestamp_t time, uint32_t *ntp_time).sl_status_t sl_sleeptimer_set_time(sl_sleeptimer_timestamp_t time) Ĭonvenience conversion functions are provided to convert UNIX timestamp to NTP and Zigbee cluster format :.sl_sleeptimer_timestamp_t sl_sleeptimer_get_time(void).This timestamp can also be accessed the following API: The SL_SLEEPTIMER_WALLCLOCK_CONFIG configuration enables a UNIX timestamp (seconds count since January 1, 1970, 00:00:00). It keeps the tick count since the initialization of the driver The callback function is called from within an interrupt handler with interrupts enabled.Ī 64-bits tick counter accessible through the uint64_t sl_sleeptimer_get_tick_count64(void) API. Timer structures must be allocated by the user. It will be called from when the timer expires. A user callback can be associated with a timer. This functionality allows the user to create periodic and one shot timers. Only one instance of this driver can be initialized by the application. The Sleeptimer driver provides software timers, delays, timekeeping and date functionalities based on the low-frequency real-time clock peripheral.Īll Silicon Laboratories microcontrollers equipped with the RTC or RTCC peripheral are currently supported. The sleeptimer.c and sleeptimer.h source files for the SLEEPTIMER device driver library are in the service/sleeptimer folder. Utilities (timer, delays and time keeping).
0 Comments
Leave a Reply. |