![]() |
RZV Flexible Software Package Documentation
Release v2.0.0
|
|
Interface for accessing the Realtime Clock.
The RTC Interface is for configuring Real Time Clock (RTC) functionality including alarm, periodic notiification and error adjustment.
The Real Time Clock Interface can be implemented by:
Data Structures | |
struct | rtc_callback_args_t |
struct | rtc_error_adjustment_cfg_t |
struct | rtc_alarm_time_t |
struct | rtc_info_t |
struct | rtc_cfg_t |
struct | rtc_api_t |
struct | rtc_instance_t |
Typedefs | |
typedef struct tm | rtc_time_t |
typedef void | rtc_ctrl_t |
Enumerations | |
enum | rtc_event_t |
enum | rtc_alarm_channel_t |
enum | rtc_clock_source_t |
enum | rtc_status_t |
enum | rtc_error_adjustment_t |
enum | rtc_error_adjustment_mode_t |
enum | rtc_error_adjustment_period_t |
enum | rtc_periodic_irq_select_t |
struct rtc_callback_args_t |
Callback function parameter data
Data Fields | ||
---|---|---|
rtc_event_t | event | The event can be used to identify what caused the callback (compare match or error). |
void const * | p_context | Placeholder for user data. |
struct rtc_error_adjustment_cfg_t |
Time error adjustment value configuration
Data Fields | ||
---|---|---|
rtc_error_adjustment_mode_t | adjustment_mode | Automatic Adjustment Enable/Disable. |
rtc_error_adjustment_period_t | adjustment_period | Error Adjustment period. |
rtc_error_adjustment_t | adjustment_type | Time error adjustment setting. |
uint32_t | adjustment_value | Value of the prescaler for error adjustment. |
struct rtc_alarm_time_t |
Alarm time setting structure
Data Fields | ||
---|---|---|
rtc_time_t | time | Time structure. |
bool | sec_match | Enable the alarm based on a match of the seconds field. |
bool | min_match | Enable the alarm based on a match of the minutes field. |
bool | hour_match | Enable the alarm based on a match of the hours field. |
bool | mday_match | Enable the alarm based on a match of the days field. |
bool | mon_match | Enable the alarm based on a match of the months field. |
bool | year_match | Enable the alarm based on a match of the years field. |
bool | dayofweek_match | Enable the alarm based on a match of the dayofweek field. |
rtc_alarm_channel_t | channel | Select alarm 0 or alarm 1. |
struct rtc_info_t |
RTC Information Structure for information returned by infoGet()
Data Fields | ||
---|---|---|
rtc_clock_source_t | clock_source | Clock source for the RTC block. |
rtc_status_t | status | RTC run status. |
struct rtc_cfg_t |
User configuration structure, used in open function
Data Fields | |
rtc_clock_source_t | clock_source |
Clock source for the RTC block. | |
uint32_t | freq_compare_value_loco |
The frequency comparison value for LOCO. | |
rtc_error_adjustment_cfg_t const *const | p_err_cfg |
Pointer to Error Adjustment configuration. | |
uint8_t | alarm_ipl |
Alarm interrupt priority. | |
IRQn_Type | alarm_irq |
Alarm interrupt vector. | |
uint8_t | periodic_ipl |
Periodic interrupt priority. | |
IRQn_Type | periodic_irq |
Periodic interrupt vector. | |
uint8_t | carry_ipl |
Carry interrupt priority. | |
IRQn_Type | carry_irq |
Carry interrupt vector. | |
void(* | p_callback )(rtc_callback_args_t *p_args) |
Called from the ISR. | |
void const * | p_context |
User defined context passed into callback function. | |
void const * | p_extend |
RTC hardware dependant configuration. | |
struct rtc_api_t |
RTC driver structure. General RTC functions implemented at the HAL layer follow this API.
Data Fields | |
fsp_err_t(* | open )(rtc_ctrl_t *const p_ctrl, rtc_cfg_t const *const p_cfg) |
fsp_err_t(* | close )(rtc_ctrl_t *const p_ctrl) |
fsp_err_t(* | clockSourceSet )(rtc_ctrl_t *const p_ctrl) |
fsp_err_t(* | calendarTimeSet )(rtc_ctrl_t *const p_ctrl, rtc_time_t *const p_time) |
fsp_err_t(* | calendarTimeGet )(rtc_ctrl_t *const p_ctrl, rtc_time_t *const p_time) |
fsp_err_t(* | calendarAlarmSet )(rtc_ctrl_t *const p_ctrl, rtc_alarm_time_t *const p_alarm) |
fsp_err_t(* | calendarAlarmGet )(rtc_ctrl_t *const p_ctrl, rtc_alarm_time_t *const p_alarm) |
fsp_err_t(* | periodicIrqRateSet )(rtc_ctrl_t *const p_ctrl, rtc_periodic_irq_select_t const rate) |
fsp_err_t(* | errorAdjustmentSet )(rtc_ctrl_t *const p_ctrl, rtc_error_adjustment_cfg_t const *const err_adj_cfg) |
fsp_err_t(* | callbackSet )(rtc_ctrl_t *const p_ctrl, void(*p_callback)(rtc_callback_args_t *), void const *const p_context, rtc_callback_args_t *const p_callback_memory) |
fsp_err_t(* | infoGet )(rtc_ctrl_t *const p_ctrl, rtc_info_t *const p_rtc_info) |
fsp_err_t(* rtc_api_t::open) (rtc_ctrl_t *const p_ctrl, rtc_cfg_t const *const p_cfg) |
Open the RTC driver.
[in] | p_ctrl | Pointer to RTC device handle |
[in] | p_cfg | Pointer to the configuration structure |
fsp_err_t(* rtc_api_t::close) (rtc_ctrl_t *const p_ctrl) |
Close the RTC driver.
[in] | p_ctrl | Pointer to RTC device handle. |
fsp_err_t(* rtc_api_t::clockSourceSet) (rtc_ctrl_t *const p_ctrl) |
Sets the RTC clock source.
[in] | p_ctrl | Pointer to RTC device handle |
fsp_err_t(* rtc_api_t::calendarTimeSet) (rtc_ctrl_t *const p_ctrl, rtc_time_t *const p_time) |
Set the calendar time and start the calender counter
[in] | p_ctrl | Pointer to RTC device handle |
[in] | p_time | Pointer to a time structure that contains the time to set |
[in] | clock_start | Flag that starts the clock right after it is set |
fsp_err_t(* rtc_api_t::calendarTimeGet) (rtc_ctrl_t *const p_ctrl, rtc_time_t *const p_time) |
Get the calendar time.
[in] | p_ctrl | Pointer to RTC device handle |
[out] | p_time | Pointer to a time structure that contains the time to get |
fsp_err_t(* rtc_api_t::calendarAlarmSet) (rtc_ctrl_t *const p_ctrl, rtc_alarm_time_t *const p_alarm) |
Set the calendar alarm time and enable the alarm interrupt.
[in] | p_ctrl | Pointer to RTC device handle |
[in] | p_alarm | Pointer to an alarm structure that contains the alarm time to set |
[in] | irq_enable_flag | Enable the ALARM irq if set |
fsp_err_t(* rtc_api_t::calendarAlarmGet) (rtc_ctrl_t *const p_ctrl, rtc_alarm_time_t *const p_alarm) |
Get the calendar alarm time.
[in] | p_ctrl | Pointer to RTC device handle |
[out] | p_alarm | Pointer to an alarm structure to fill up with the alarm time |
fsp_err_t(* rtc_api_t::periodicIrqRateSet) (rtc_ctrl_t *const p_ctrl, rtc_periodic_irq_select_t const rate) |
Set the periodic irq rate
[in] | p_ctrl | Pointer to RTC device handle |
[in] | rate | Rate of periodic interrupts |
fsp_err_t(* rtc_api_t::errorAdjustmentSet) (rtc_ctrl_t *const p_ctrl, rtc_error_adjustment_cfg_t const *const err_adj_cfg) |
Set time error adjustment.
[in] | p_ctrl | Pointer to control handle structure |
[in] | err_adj_cfg | Pointer to the Error Adjustment Config |
fsp_err_t(* rtc_api_t::callbackSet) (rtc_ctrl_t *const p_ctrl, void(*p_callback)(rtc_callback_args_t *), void const *const p_context, rtc_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
[in] | p_ctrl | Pointer to the RTC control block. |
[in] | p_callback | Callback function |
[in] | p_context | Pointer to send to callback function |
[in] | p_working_memory | Pointer to volatile memory where callback structure can be allocated |
fsp_err_t(* rtc_api_t::infoGet) (rtc_ctrl_t *const p_ctrl, rtc_info_t *const p_rtc_info) |
Return the currently configure clock source for the RTC
[in] | p_ctrl | Pointer to control handle structure |
[out] | p_rtc_info | Pointer to RTC information structure |
struct rtc_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
rtc_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
rtc_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
rtc_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef struct tm rtc_time_t |
Date and time structure defined in C standard library <time.h>
typedef void rtc_ctrl_t |
RTC control block. Allocate an instance specific control block to pass into the RTC API calls.
enum rtc_event_t |
enum rtc_alarm_channel_t |
RTC alarm channel
enum rtc_clock_source_t |
enum rtc_status_t |
Periodic Interrupt select