![]() |
Synergy Software Package User's Manual
|
Driver for the Realtime Clock (RTC). More...
Data Structures | |
| struct | rtc_instance_ctrl_t |
Enumerations | |
| enum | rtc_count_mode_t { RTC_CALENDAR_MODE = 0, RTC_BINARY_MODE = 1 } |
Functions | |
| ssp_err_t | R_RTC_Open (rtc_ctrl_t *const p_api_ctrl, rtc_cfg_t const *const p_cfg) |
| Open the RTC driver. More... | |
| ssp_err_t | R_RTC_Close (rtc_ctrl_t *const p_api_ctrl) |
| Close the RTC driver. More... | |
| ssp_err_t | R_RTC_Configure (rtc_ctrl_t *const p_api_ctrl, void *const p_extend) |
| Configure the RTC driver. More... | |
| ssp_err_t | R_RTC_CalendarTimeSet (rtc_ctrl_t *const p_api_ctrl, rtc_time_t *p_time, bool clock_start) |
| Set the calendar time. More... | |
| ssp_err_t | R_RTC_CalendarTimeGet (rtc_ctrl_t *const p_api_ctrl, rtc_time_t *p_time) |
| Get the calendar time. (Should not be called from critical section as it may return incorrect time) More... | |
| ssp_err_t | R_RTC_CalendarAlarmSet (rtc_ctrl_t *const p_api_ctrl, rtc_alarm_time_t *p_alarm, bool interrupt_enable_flag) |
| Set the calendar alarm time. More... | |
| ssp_err_t | R_RTC_CalendarAlarmGet (rtc_ctrl_t *const p_api_ctrl, rtc_alarm_time_t *p_alarm) |
| Get the calendar alarm time. More... | |
| ssp_err_t | R_RTC_CalendarCounterStart (rtc_ctrl_t *const p_api_ctrl) |
| Start the calendar counter. More... | |
| ssp_err_t | R_RTC_CalendarCounterStop (rtc_ctrl_t *const p_api_ctrl) |
| Stop the calendar counter. More... | |
| ssp_err_t | R_RTC_IrqEnable (rtc_ctrl_t *const p_api_ctrl, rtc_event_t event) |
| Enable the alarm interrupt. More... | |
| ssp_err_t | R_RTC_IrqDisable (rtc_ctrl_t *const p_api_ctrl, rtc_event_t event) |
| Disable the alarm interrupt. More... | |
| ssp_err_t | R_RTC_PeriodicIrqRateSet (rtc_ctrl_t *const p_api_ctrl, rtc_periodic_irq_select_t rate) |
| Set the periodic interrupt rate. More... | |
| ssp_err_t | R_RTC_InfoGet (rtc_ctrl_t *p_api_ctrl, rtc_info_t *p_rtc_info) |
| This function returns information about the driver clock source. More... | |
| ssp_err_t | R_RTC_ErrorAdjustmentModeSet (rtc_ctrl_t *p_api_ctrl, rtc_error_adjustment_mode_cfg_t *p_error_adjustment_mode) |
| This function sets time error adjustment mode. More... | |
| ssp_err_t | R_RTC_ErrorAdjustmentSet (rtc_ctrl_t *p_api_ctrl, rtc_error_adjustment_cfg_t *p_error_adjustment_config) |
| This function sets time error adjustment. More... | |
| ssp_err_t | R_RTC_VersionGet (ssp_version_t *p_version) |
| Get driver version based on compile time macros. More... | |
Driver for the Realtime Clock (RTC).
This module supports the Real Time Clock (RTC). It implements the following interfaces:
| enum rtc_count_mode_t |
| ssp_err_t R_RTC_CalendarAlarmGet | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_alarm_time_t * | p_alarm | ||
| ) |
Get the calendar alarm time.
Implements rtc_api_t::calendarAlarmGet
| SSP_SUCCESS | Calendar alarm time get operation was successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl, p_alarm or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
Get the alarm time
| ssp_err_t R_RTC_CalendarAlarmSet | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_alarm_time_t * | p_alarm, | ||
| bool | interrupt_enable_flag | ||
| ) |
Set the calendar alarm time.
Implements rtc_api_t::calendarAlarmSet.
| SSP_SUCCESS | Calendar alarm time set operation was successful. |
| SSP_ERR_INVALID_ARGUMENT | Invalid time parameter field. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl, p_alarm or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
Disable the ICU alarm interrupt request
Set alarm time
| ssp_err_t R_RTC_CalendarCounterStart | ( | rtc_ctrl_t *const | p_api_ctrl | ) |
Start the calendar counter.
Implements rtc_api_t::calendarCounterStart.
| SSP_SUCCESS | Calendar counter started. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| SSP_ERR_TIMEOUT | Start bit not set. |
Set the start bit.
| ssp_err_t R_RTC_CalendarCounterStop | ( | rtc_ctrl_t *const | p_api_ctrl | ) |
Stop the calendar counter.
Implements rtc_api_t::calendarCounterStop.
| SSP_SUCCESS | Calendar counter stopped. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| SSP_ERR_TIMEOUT | Start bit not cleared. |
Clear the start bit.
| ssp_err_t R_RTC_CalendarTimeGet | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_time_t * | p_time | ||
| ) |
Get the calendar time. (Should not be called from critical section as it may return incorrect time)
Implements rtc_api_t::calendarTimeGet
| SSP_SUCCESS | Calendar time get operation was successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl, p_time or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| SSP_ERR_TIMEOUT | IRQ enable operation timed out. |
Read all the time registers, if a carry irq occurred in-between read again
This flag will be set to 'true' in the carry ISR
Restore the state of carry IRQ.
| ssp_err_t R_RTC_CalendarTimeSet | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_time_t * | p_time, | ||
| bool | clock_start | ||
| ) |
Set the calendar time.
Implements rtc_api_t::calendarTimeSet.
| SSP_SUCCESS | Calendar time set operation was successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl, p_time or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| SSP_ERR_INVALID_ARGUMENT | Invalid time parameter field. |
| SSP_ERR_TIMEOUT | Software reset status check failed. |
| ssp_err_t R_RTC_Close | ( | rtc_ctrl_t *const | p_api_ctrl | ) |
Close the RTC driver.
Implements rtc_api_t::close
| SSP_SUCCESS | De-Initialization was successful and RTC driver closed. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for close. |
Disable the periodic interrupt, alarm interrupt, carry interrupts, and disable there interrupt priority and vector info.
| ssp_err_t R_RTC_Configure | ( | rtc_ctrl_t *const | p_api_ctrl, |
| void *const | p_extend | ||
| ) |
Configure the RTC driver.
Implements rtc_api_t::configure
| SSP_SUCCESS | RTC was successful configured. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| SSP_ERR_TIMEOUT | Status check for counter mode or reset timed out |
Parameter checking
p_extend is currently not used, reserved for future use
Set the clock source of the RTC block according to the UM
| ssp_err_t R_RTC_ErrorAdjustmentModeSet | ( | rtc_ctrl_t * | p_api_ctrl, |
| rtc_error_adjustment_mode_cfg_t * | p_error_adjustment_mode | ||
| ) |
This function sets time error adjustment mode.
Implements rtc_api_t::errorAdjustmentModeSet
| SSP_SUCCESS | Time error adjustment mode set successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or error_adjustment_mode pointer. |
| SSP_ERR_NOT_OPEN | Driver not open for operation. |
| SSP_ERR_UNSUPPORTED | The clock source is not SubClock. |
| SSP_ERR_INVALID_ARGUMENT | Invalid error adjustment period. |
| SSP_ERR_TIMEOUT | Time error adjustment get query timed out. |
| ssp_err_t R_RTC_ErrorAdjustmentSet | ( | rtc_ctrl_t * | p_api_ctrl, |
| rtc_error_adjustment_cfg_t * | p_error_adjustment_config | ||
| ) |
This function sets time error adjustment.
Implements rtc_api_t::errorAdjustmentSet
| SSP_SUCCESS | Time error adjustment successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_error_adjustment_config pointer. |
| SSP_ERR_NOT_OPEN | Driver not open for operation. |
| SSP_ERR_UNSUPPORTED | The clock source is not SubClock. |
| SSP_ERR_INVALID_ARGUMENT | Invalid error adjustment value. |
| SSP_ERR_TIMEOUT | Time error adjustment get query timed out. |
| ssp_err_t R_RTC_InfoGet | ( | rtc_ctrl_t * | p_api_ctrl, |
| rtc_info_t * | p_rtc_info | ||
| ) |
This function returns information about the driver clock source.
Implements rtc_api_t::infoGet
| SSP_SUCCESS | Get information Successful. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl, p_rtc_info or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| ssp_err_t R_RTC_IrqDisable | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_event_t | event | ||
| ) |
Disable the alarm interrupt.
Implements rtc_api_t::interruptDisable.
| SSP_SUCCESS | Alarm interrupt disabled. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_IRQ_BSP_DISABLED | User IRQ parameter not valid |
| SSP_ERR_INVALID_ARGUMENT | Invalid IRQ event |
| SSP_ERR_TIMEOUT | IRQ disable operation timed out. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| ssp_err_t R_RTC_IrqEnable | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_event_t | event | ||
| ) |
Enable the alarm interrupt.
Implements rtc_api_t::interruptEnable.
| SSP_SUCCESS | Alarm interrupt enabled. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_IRQ_BSP_DISABLED | User IRQ parameter not valid. |
| SSP_ERR_INVALID_ARGUMENT | Invalid IRQ event. |
| SSP_ERR_TIMEOUT | IRQ enable operation timed out. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| ssp_err_t R_RTC_Open | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_cfg_t const *const | p_cfg | ||
| ) |
Open the RTC driver.
Implements rtc_api_t::open.
Opens and configures the RTC driver module. Configuration includes clock source, and interrupt callback function. If the sub-clock oscillator is the clock source it is started in this function.
| SSP_SUCCESS | Initialization was successful and RTC has started. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_cfg pointer. |
| SSP_ERR_HW_LOCKED | Hardware in use |
| SSP_ERR_TIMEOUT | Status check for counter mode or reset timed out |
Mark driver as open by initializing it to "RTC" in its ASCII equivalent.
| ssp_err_t R_RTC_PeriodicIrqRateSet | ( | rtc_ctrl_t *const | p_api_ctrl, |
| rtc_periodic_irq_select_t | rate | ||
| ) |
Set the periodic interrupt rate.
Implements rtc_api_t::periodicInterruptRateSet.
| SSP_SUCCESS | The periodic interrupt rate was successfully set. |
| SSP_ERR_ASSERTION | Invalid p_api_ctrl or p_ctrl->p_reg member pointed by p_api_ctrl pointer. |
| SSP_ERR_TIMEOUT | Periodic interrupt rate get query timed out. |
| SSP_ERR_NOT_OPEN | Driver not open already for operation. |
| ssp_err_t R_RTC_VersionGet | ( | ssp_version_t * | p_version | ) |
Get driver version based on compile time macros.
Implements rtc_api_t::versionGet
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |