FreeRTOS:
Common I/O
AWS IoT Common I/O library
|
Return to main page ↑ |
Data Structures | |
struct | IotRtcDatetime_t |
RTC date and time format info. More... | |
Macros | |
#define | IOT_RTC_SUCCESS ( 0 ) |
Return values used by RTC driver. More... | |
#define | IOT_RTC_INVALID_VALUE ( 1 ) |
#define | IOT_RTC_NOT_STARTED ( 2 ) |
#define | IOT_RTC_GET_FAILED ( 3 ) |
#define | IOT_RTC_SET_FAILED ( 4 ) |
#define | IOT_RTC_FUNCTION_NOT_SUPPORTED ( 5 ) |
Typedefs | |
typedef struct IotRtcDescriptor_t * | IotRtcHandle_t |
IotRtcHandle_t type is the RTC handle returned by calling iot_rtc_open() this is initialized in open and returned to caller. Caller must pass this pointer to the rest of the APIs. | |
typedef void(* | IotRtcCallback_t) (IotRtcStatus_t xStatus, void *pvUserContext) |
RTC notification callback type. This callback is passed to the driver by using iot_rtc_set_callback API. The callback is used to get the notifications for Alarm and Wakeup timers. More... | |
Enumerations | |
enum | IotRtcStatus_t { eRtcTimerStopped, eRtcTimerRunning, eRtcTimerAlarmTriggered, eRtcTimerWakeupTriggered } |
RTC driver status values. More... | |
enum | IotRtcIoctlRequest_t { eSetRtcAlarm, eGetRtcAlarm, eCancelRtcAlarm, eSetRtcWakeupTime, eGetRtcWakeupTime, eCancelRtcWakeup, eGetRtcStatus } |
Ioctl request types. More... | |
Functions | |
IotRtcHandle_t | iot_rtc_open (int32_t lRtcInstance) |
iot_rtc_open is used to initialize the RTC timer. It usually resets the RTC timer, sets up the clock for RTC etc... More... | |
void | iot_rtc_set_callback (IotRtcHandle_t const pxRtcHandle, IotRtcCallback_t xCallback, void *pvUserContext) |
iot_rtc_set_callback is used to set the callback to be called when alarmTime triggers. The caller must set the Alarm time using IOCTL to get the callback. More... | |
int32_t | iot_rtc_ioctl (IotRtcHandle_t const pxRtcHandle, IotRtcIoctlRequest_t xRequest, void *const pvBuffer) |
iot_rtc_ioctl is used to set RTC configuration and RTC properties like Wakeup time, alarms etc. Supported IOCTL requests are defined in iot_RtcIoctlRequest_t More... | |
int32_t | iot_rtc_set_datetime (IotRtcHandle_t const pxRtcHandle, const IotRtcDatetime_t *pxDatetime) |
iot_rtc_set_date_time is used to set the current time as a reference in RTC timer counter. More... | |
int32_t | iot_rtc_get_datetime (IotRtcHandle_t const pxRtcHandle, IotRtcDatetime_t *pxDatetime) |
iot_rtc_get_datetime is used to get the current time from the RTC counter. The time must be set first as a reference to get the time. More... | |
int32_t | iot_rtc_close (IotRtcHandle_t const pxRtcHandle) |
iot_rtc_close is used to de-Initialize RTC Timer. it resets the RTC timer and may stop the timer. More... | |
#define IOT_RTC_SUCCESS ( 0 ) |
Return values used by RTC driver.
RTC operation completed successfully.
#define IOT_RTC_INVALID_VALUE ( 1 ) |
At least one parameter is invalid.
#define IOT_RTC_NOT_STARTED ( 2 ) |
RTC not started.
#define IOT_RTC_GET_FAILED ( 3 ) |
RTC get operation failed.
#define IOT_RTC_SET_FAILED ( 4 ) |
RTC set operation failed.
#define IOT_RTC_FUNCTION_NOT_SUPPORTED ( 5 ) |
RTC operation not supported.
typedef void( * IotRtcCallback_t) (IotRtcStatus_t xStatus, void *pvUserContext) |
RTC notification callback type. This callback is passed to the driver by using iot_rtc_set_callback API. The callback is used to get the notifications for Alarm and Wakeup timers.
[out] | xStatus | RTC timer status. |
[in] | pvUserContext | User Context passed when setting the callback. This is not used by the driver, but just passed back to the user in the callback. |
enum IotRtcStatus_t |
enum IotRtcIoctlRequest_t |
Ioctl request types.
Enumerator | |
---|---|
eSetRtcAlarm | Set Alarm, date&time when Alarm need to occur. Takes input type IotRtcDatetime_t
|
eGetRtcAlarm | Get Alarm, gives the date&time when Alarm will occur. Returns IotRtcDatetime_t |
eCancelRtcAlarm | Cancel any scheduled Alarm |
eSetRtcWakeupTime | Set Wakeup time in miliseconds. Maximum number of miliseconds depend on the platform. Value is uint32_t |
eGetRtcWakeupTime | Get Wakeup time in milli-seconds |
eCancelRtcWakeup | Cancel any scheduled wake-up |
eGetRtcStatus | Get the RTC timer status value. Returns IotRtcStatus_t type |
IotRtcHandle_t iot_rtc_open | ( | int32_t | lRtcInstance | ) |
iot_rtc_open is used to initialize the RTC timer. It usually resets the RTC timer, sets up the clock for RTC etc...
[in] | lRtcInstance | The instance of the RTC timer to initialize. |
void iot_rtc_set_callback | ( | IotRtcHandle_t const | pxRtcHandle, |
IotRtcCallback_t | xCallback, | ||
void * | pvUserContext | ||
) |
iot_rtc_set_callback is used to set the callback to be called when alarmTime triggers. The caller must set the Alarm time using IOCTL to get the callback.
[in] | pxRtcHandle | handle to RTC driver returned in iot_rtc_open() |
[in] | xCallback | callback function to be called. |
[in] | pvUserContext | user context to be passed when callback is called. |
int32_t iot_rtc_ioctl | ( | IotRtcHandle_t const | pxRtcHandle, |
IotRtcIoctlRequest_t | xRequest, | ||
void *const | pvBuffer | ||
) |
iot_rtc_ioctl is used to set RTC configuration and RTC properties like Wakeup time, alarms etc. Supported IOCTL requests are defined in iot_RtcIoctlRequest_t
[in] | pxRtcHandle | handle to RTC driver returned in iot_rtc_open() |
[in] | xRequest | configuration request of type IotRtcIoctlRequest_t |
[in,out] | pvBuffer | buffer holding RTC set and get values. |
int32_t iot_rtc_set_datetime | ( | IotRtcHandle_t const | pxRtcHandle, |
const IotRtcDatetime_t * | pxDatetime | ||
) |
iot_rtc_set_date_time is used to set the current time as a reference in RTC timer counter.
[in] | pxRtcHandle | handle to RTC driver returned in iot_rtc_open() |
[in] | pxDatetime | pointer to IotRtcDatetime_t structure to set the date&time to be set in RTC counter. |
int32_t iot_rtc_get_datetime | ( | IotRtcHandle_t const | pxRtcHandle, |
IotRtcDatetime_t * | pxDatetime | ||
) |
iot_rtc_get_datetime is used to get the current time from the RTC counter. The time must be set first as a reference to get the time.
[in] | pxRtcHandle | handle to RTC driver returned in iot_rtc_open() |
[in] | pxDatetime | pointer to IotRtcDatetime_t structure to get the date&time from RTC counter. |
int32_t iot_rtc_close | ( | IotRtcHandle_t const | pxRtcHandle | ) |
iot_rtc_close is used to de-Initialize RTC Timer. it resets the RTC timer and may stop the timer.
[in] | pxRtcHandle | handle to RTC interface. |