Real-Time Clock & Calendar. More...
Data Structures | |
struct | rtc_datetime_attr_t |
struct | rtc_alarm_attr_t |
struct | rtc_channel_attr_t |
struct | rtc_handle_t |
Typedefs | |
typedef void(* | hal_rtc_callback) (const uint8_t channel) |
RTC alarm callback function prototype. | |
Enumerations | |
enum | rtc_result_t { RTC_RESULT_OK , RTC_RESULT_INVALID , RTC_RESULT_UNSUPPORTED , RTC_RESULT_ERR , TOTAL_RTC_RESULT } |
enum | rtc_status_t { RTC_STATUS_UNKNOWN , RTC_STATUS_OK , RTC_STATUS_BUSY , RTC_STATUS_STOP , RTC_STATUS_ERR , TOTAL_RTC_STATUS } |
enum | rtc_time_format_t { RTC_TIME_FORMAT_12H , RTC_TIME_FORMAT_24H , TOTAL_RTC_TIME_FORMAT } |
Functions | |
rtc_result_t | hal_rtc_init (rtc_handle_t *handle, const rtc_channel_attr_t attr) |
Initialize RTC channel. | |
rtc_result_t | hal_rtc_start (rtc_handle_t *handle) |
Start RTC channel. | |
rtc_result_t | hal_rtc_get_datetime (rtc_handle_t *handle, rtc_datetime_attr_t *datetime) |
Retrieve current date and time. | |
rtc_result_t | hal_rtc_set_alarm (rtc_handle_t *handle, const rtc_alarm_attr_t attr, const hal_rtc_callback callback) |
Set alarm date and time. | |
rtc_result_t | hal_rtc_stop (rtc_handle_t *handle) |
Stop RTC channel. | |
Real-Time Clock & Calendar.
typedef void(* hal_rtc_callback) (const uint8_t channel) |
#include <rtc/public_inc/hal_rtc.h>
RTC alarm callback function prototype.
[in] | channel | RTC channel |
enum rtc_result_t |
#include <rtc/public_inc/hal_rtc.h>
Enumerator | |
---|---|
RTC_RESULT_OK | No error. |
RTC_RESULT_INVALID | Operation invalid. |
RTC_RESULT_UNSUPPORTED | Operation not supported. |
RTC_RESULT_ERR | Error occurred. |
TOTAL_RTC_RESULT |
enum rtc_status_t |
#include <rtc/public_inc/hal_rtc.h>
Enumerator | |
---|---|
RTC_STATUS_UNKNOWN | RTC status unknown. |
RTC_STATUS_OK | No error. |
RTC_STATUS_BUSY | RTC busy. |
RTC_STATUS_STOP | RTC stopped. |
RTC_STATUS_ERR | Error occurred. |
TOTAL_RTC_STATUS |
enum rtc_time_format_t |
#include <rtc/public_inc/hal_rtc.h>
Enumerator | |
---|---|
RTC_TIME_FORMAT_12H | |
RTC_TIME_FORMAT_24H | |
TOTAL_RTC_TIME_FORMAT |
rtc_result_t hal_rtc_get_datetime | ( | rtc_handle_t * | handle, |
rtc_datetime_attr_t * | datetime ) |
#include <rtc/public_inc/hal_rtc.h>
Retrieve current date and time.
[in,out] | handle | RTC handler |
[out] | datetime | Pointer to current datetime |
RTC_RESULT_OK | Successfully retrieve datetime |
RTC_RESULT_ERR | Failed to get datetime |
rtc_result_t hal_rtc_init | ( | rtc_handle_t * | handle, |
const rtc_channel_attr_t | attr ) |
#include <rtc/public_inc/hal_rtc.h>
Initialize RTC channel.
[in,out] | handle | RTC handler |
[in] | attr | RTC channel attribute |
RTC_RESULT_OK | Success configure RTC channel setup |
RTC_RESULT_INVALID | Configuration attributes invalid |
RTC_RESULT_UNSUPPORTED | Operation not supported |
RTC_RESULT_ERR | Failed configure RTC channel |
rtc_result_t hal_rtc_set_alarm | ( | rtc_handle_t * | handle, |
const rtc_alarm_attr_t | attr, | ||
const hal_rtc_callback | callback ) |
#include <rtc/public_inc/hal_rtc.h>
Set alarm date and time.
[in,out] | handle | RTC handler |
[in] | attr | Alarm occurence, start time and frequency |
[in] | callback | Callback function when alarm timeout |
RTC_RESULT_OK | New alarm time set successfully |
RTC_RESULT_ERR | Failed to set new alarm time |
rtc_result_t hal_rtc_start | ( | rtc_handle_t * | handle | ) |
#include <rtc/public_inc/hal_rtc.h>
Start RTC channel.
[in,out] | handle | RTC handler |
RTC_RESULT_OK | RTC successfully started |
RTC_RESULT_ERR | Failed to start RTC count |
rtc_result_t hal_rtc_stop | ( | rtc_handle_t * | handle | ) |
#include <rtc/public_inc/hal_rtc.h>
Stop RTC channel.
[in,out] | handle | RTC handler |
RTC_RESULT_OK | RTC stopped successfully |
RTC_RESULT_ERR | Failed to stop RTC count |