S32 SDK
Real Time Clock HAL

Detailed Description

Real Time Clock Hardware Abstraction Layer.

Enumerations

enum  rtc_second_int_cfg_t {
  RTC_INT_1HZ = 0x00U, RTC_INT_2HZ = 0x01U, RTC_INT_4HZ = 0x02U, RTC_INT_8HZ = 0x03U,
  RTC_INT_16HZ = 0x04U, RTC_INT_32HZ = 0x05U, RTC_INT_64HZ = 0x06U, RTC_INT_128HZ = 0x07U
}
 RTC Seconds interrupt configuration Implements : rtc_second_int_cfg_t_Class. More...
 
enum  rtc_clk_out_config_t { RTC_CLKOUT_DISABLED = 0x00U, RTC_CLKOUT_SRC_TSIC = 0x01U, RTC_CLKOUT_SRC_32KHZ = 0x02U }
 RTC CLKOUT pin configuration Implements : rtc_clk_out_config_t_Class. More...
 
enum  rtc_clk_select_t { RTC_CLK_SRC_OSC_32KHZ = 0x00U, RTC_CLK_SRC_LPO_1KHZ = 0x01U }
 RTC clock select Implements : rtc_clk_select_t_Class. More...
 
enum  rtc_lock_register_select_t { RTC_LOCK_REG_LOCK = 0x00U, RTC_STATUS_REG_LOCK = 0x01U, RTC_CTRL_REG_LOCK = 0x02U, RTC_TCL_REG_LOCK = 0x03U }
 RTC register lock Implements : rtc_lock_register_select_t_Class. More...
 

Configuration

status_t RTC_HAL_Init (RTC_Type *const base)
 Initialize RTC instance. More...
 
status_t RTC_HAL_Enable (RTC_Type *const base)
 Enable RTC instance counter. More...
 
status_t RTC_HAL_Disable (RTC_Type *const base)
 Disable RTC instance counter. More...
 
status_t RTC_HAL_ConfigureRegisterLock (RTC_Type *const base, rtc_lock_register_select_t registerToConfig)
 This function configures register lock status. More...
 
bool RTC_HAL_IsRegisterLocked (const RTC_Type *const base, rtc_lock_register_select_t reg)
 This function gets register lock status. More...
 
status_t RTC_HAL_ConfigureClockOut (RTC_Type *const base, rtc_clk_out_config_t config)
 This function configures the Clock Out pin source. More...
 
static uint32_t RTC_HAL_GetTimeSecondsRegister (const RTC_Type *const base)
 Get Time Seconds Register Value. More...
 
status_t RTC_HAL_SetTimeSecondsRegister (RTC_Type *const base, uint32_t seconds)
 Set Time Seconds Register. More...
 
static uint16_t RTC_HAL_GetTimePrescalerRegister (const RTC_Type *const base)
 Get Time Prescaler Register. More...
 
status_t RTC_HAL_SetTimePrescalerRegister (RTC_Type *const base, uint16_t value)
 Set Time Prescaler Register. More...
 
static uint32_t RTC_HAL_GetTimeAlarmRegister (const RTC_Type *const base)
 Get Time Alarm Register. More...
 
static void RTC_HAL_SetTimeAlarmRegister (RTC_Type *const base, uint32_t seconds)
 Set Time Alarm Register. More...
 
static void RTC_HAL_GetTimeCompensation (const RTC_Type *const base, int8_t *compensationValue, uint8_t *compensationInterval)
 Get Time Compensation Value and Interval. More...
 
static void RTC_HAL_SetTimeCompensation (RTC_Type *const base, int8_t compensationValue, uint8_t compensationInterval)
 Set Time Compensation. More...
 
static void RTC_HAL_GetCurrentTimeCompensation (const RTC_Type *const base, int8_t *compensationValue, uint8_t *compensationInterval)
 Get TimeCompensation Value and Interval. More...
 
static void RTC_HAL_SetLPOSelect (RTC_Type *const base, rtc_clk_select_t clk_select)
 Select clock source for RTC prescaler. More...
 
static rtc_clk_select_t RTC_HAL_GetLPOSelect (const RTC_Type *const base)
 Get the selected clock source for RTC prescaler. More...
 
static void RTC_HAL_SetUpdateMode (RTC_Type *const base, bool updateEnable)
 Set Update Mode of the registers when locked. More...
 
static bool RTC_HAL_GetUpdateMode (const RTC_Type *const base)
 Get the Update Mode of the registers when locked. More...
 
static void RTC_HAL_SetNonSupervisorAccess (RTC_Type *const base, bool enable)
 Set Non-Supervisor access mode. More...
 
static bool RTC_HAL_GetNonSupervisorAccess (const RTC_Type *const base)
 Get Non-Supervisor access mode. More...
 
static void RTC_HAL_SetSoftwareReset (RTC_Type *const base)
 Trigger a software reset. More...
 
static void RTC_HAL_ClearSoftwareReset (RTC_Type *const base)
 Clear Software reset flag. More...
 
static void RTC_HAL_SetTimeCounterEnable (RTC_Type *const base, bool enable)
 Enable or disable the Time counter. More...
 
static bool RTC_HAL_GetTimeCounterEnable (const RTC_Type *const base)
 Get the Time Counter Enable value. More...
 
static bool RTC_HAL_GetTimeAlarmFlag (const RTC_Type *const base)
 Get the Time alarm flag. More...
 
static bool RTC_HAL_GetTimeOverflowFlag (const RTC_Type *const base)
 Get Time Overflow Flag. More...
 
static bool RTC_HAL_GetTimeInvalidFlag (const RTC_Type *const base)
 Get Time Invalid flag. More...
 
static void RTC_HAL_LockRegisterLock (RTC_Type *const base)
 Lock the Lock Register. More...
 
static bool RTC_HAL_GetLockRegisterLock (const RTC_Type *const base)
 Get the Lock Register Lock state. More...
 
static void RTC_HAL_StatusRegisterLock (RTC_Type *const base)
 Lock the Status Register. More...
 
static bool RTC_HAL_GetStatusRegisterLock (const RTC_Type *const base)
 Get the Status Register Lock state. More...
 
static bool RTC_HAL_GetControlRegisterLock (const RTC_Type *const base)
 Get the Control Register Lock state. More...
 
static void RTC_HAL_ControlRegisterLock (RTC_Type *const base)
 Lock the Control Register. More...
 
static bool RTC_HAL_GetTimeCompensationLock (const RTC_Type *const base)
 Get the TimeCompensation Register Lock state. More...
 
static void RTC_HAL_TimeCompensationLock (RTC_Type *const base)
 Lock the TimeCompensation Register. More...
 
static void RTC_HAL_SetTimeSecondsIntConf (RTC_Type *const base, rtc_second_int_cfg_t intCfg)
 Configure Time Seconds interrupt. More...
 
static rtc_second_int_cfg_t RTC_HAL_GetTimeSecondsIntConf (const RTC_Type *const base)
 Get Time Seconds interrupt configuration. More...
 
static void RTC_HAL_SetTimeSecondsIntEnable (RTC_Type *const base, bool enable)
 Enable TimeSeconds interrupt. More...
 
static bool RTC_HAL_GetTimeSecondsIntEnable (const RTC_Type *const base)
 Get the TimeSeconds interrupt enable status. More...
 
static void RTC_HAL_SetTimeAlarmIntEnable (RTC_Type *const base, bool enable)
 Enable TimeAlarm interrupt. More...
 
static bool RTC_HAL_GetTimeAlarmIntEnable (const RTC_Type *const base)
 Get the TimeAlarm interrupt enable status. More...
 
static void RTC_HAL_SetTimeOverflowIntEnable (RTC_Type *const base, bool enable)
 Enable TimeOverflow interrupt. More...
 
static bool RTC_HAL_GetTimeOverflowIntEnable (const RTC_Type *const base)
 Get the TimeAlarm interrupt enable status. More...
 
static void RTC_HAL_SetTimeInvalidIntEnable (RTC_Type *const base, bool enable)
 Enable TimeInvalid interrupt. More...
 
static bool RTC_HAL_GetTimeInvalidIntEnable (const RTC_Type *const base)
 Get the TimeInvalid interrupt enable status. More...
 

Enumeration Type Documentation

RTC CLKOUT pin configuration Implements : rtc_clk_out_config_t_Class.

Enumerator
RTC_CLKOUT_DISABLED 

Clock out pin is disabled

RTC_CLKOUT_SRC_TSIC 

Output on RTC_CLKOUT as configured on Time seconds interrupt

RTC_CLKOUT_SRC_32KHZ 

Output on RTC_CLKOUT of the 32KHz clock

Definition at line 68 of file rtc_hal.h.

RTC clock select Implements : rtc_clk_select_t_Class.

Enumerator
RTC_CLK_SRC_OSC_32KHZ 

RTC Prescaler increments using 32 KHz crystal

RTC_CLK_SRC_LPO_1KHZ 

RTC Prescaler increments using 1KHz LPO

Definition at line 79 of file rtc_hal.h.

RTC register lock Implements : rtc_lock_register_select_t_Class.

Enumerator
RTC_LOCK_REG_LOCK 

RTC Lock Register lock

RTC_STATUS_REG_LOCK 

RTC Status Register lock

RTC_CTRL_REG_LOCK 

RTC Control Register lock

RTC_TCL_REG_LOCK 

RTC Time Compensation Reg lock

Definition at line 89 of file rtc_hal.h.

RTC Seconds interrupt configuration Implements : rtc_second_int_cfg_t_Class.

Enumerator
RTC_INT_1HZ 

RTC seconds interrupt occurs at 1 Hz

RTC_INT_2HZ 

RTC seconds interrupt occurs at 2 Hz

RTC_INT_4HZ 

RTC seconds interrupt occurs at 4 Hz

RTC_INT_8HZ 

RTC seconds interrupt occurs at 8 Hz

RTC_INT_16HZ 

RTC seconds interrupt occurs at 16 Hz

RTC_INT_32HZ 

RTC seconds interrupt occurs at 32 Hz

RTC_INT_64HZ 

RTC seconds interrupt occurs at 64 Hz

RTC_INT_128HZ 

RTC seconds interrupt occurs at 128 Hz

Definition at line 52 of file rtc_hal.h.

Function Documentation

static void RTC_HAL_ClearSoftwareReset ( RTC_Type *const  base)
inlinestatic

Clear Software reset flag.

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_ClearSoftwareReset_Activity

Definition at line 498 of file rtc_hal.h.

status_t RTC_HAL_ConfigureClockOut ( RTC_Type *const  base,
rtc_clk_out_config_t  config 
)

This function configures the Clock Out pin source.

Parameters
[in]baseRTC base pointer
[in]configSource for the Clock Out pin
Returns
Returns the status of the operation, STATUS_SUCCESS if the configuration was successful, STATUS_ERROR if the Control Register is locked.

Definition at line 293 of file rtc_hal.c.

status_t RTC_HAL_ConfigureRegisterLock ( RTC_Type *const  base,
rtc_lock_register_select_t  registerToConfig 
)

This function configures register lock status.

Parameters
[in]baseRTC base pointer
[in]registerToConfigRegister to configure
Returns
STATUS_SUCCESS if the lock was successful or if the register was already locked, STATUS_ERROR if the Lock Register is already locked or if the registerToConfig parameter is not a valid register.

Definition at line 210 of file rtc_hal.c.

static void RTC_HAL_ControlRegisterLock ( RTC_Type *const  base)
inlinestatic

Lock the Control Register.

This method locks the Control Register. If the register is locked, it can be unlocked only with power-on reset(POR).

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_ControlRegisterLock_Activity

Definition at line 698 of file rtc_hal.h.

status_t RTC_HAL_Disable ( RTC_Type *const  base)

Disable RTC instance counter.

Parameters
[in]baseRTC base pointer
Returns
STATUS_SUCCESS if the operation was successful, STATUS_ERROR if the counter was not disabled.

Definition at line 125 of file rtc_hal.c.

status_t RTC_HAL_Enable ( RTC_Type *const  base)

Enable RTC instance counter.

Parameters
[in]baseRTC base pointer
Returns
STATUS_SUCCESS if the operation was successful, STATUS_ERROR if the counter is enabled or if the time invalid flag is set.

Definition at line 95 of file rtc_hal.c.

static bool RTC_HAL_GetControlRegisterLock ( const RTC_Type *const  base)
inlinestatic

Get the Control Register Lock state.

Parameters
[in]baseRTC base pointer
Returns
State of the Control register lock
  • true if register is locked
  • false if the register is not locked Implements : RTC_HAL_GetControlRegisterLock_Activity

Definition at line 682 of file rtc_hal.h.

static void RTC_HAL_GetCurrentTimeCompensation ( const RTC_Type *const  base,
int8_t *  compensationValue,
uint8_t *  compensationInterval 
)
inlinestatic

Get TimeCompensation Value and Interval.

Returns current value used by the compensation logic for the present second interval. Updated once a second if the CIC equals 0 with the contents of the TCR field. If the CIC does not equal zero then it is loaded with zero.

Parameters
[in]baseRTC base pointer
[out]compensationValue- Current value which is subtracted from the counter valid range -128, +127
[out]compensationIntervalCurrent Compensation interval at which the compensation value is added to the prescaler register
Returns
Current value used by the compensation logic for the present second interval Implements : RTC_HAL_GetCurrentTimeCompensation_Activity

Definition at line 359 of file rtc_hal.h.

static bool RTC_HAL_GetLockRegisterLock ( const RTC_Type *const  base)
inlinestatic

Get the Lock Register Lock state.

Parameters
[in]baseRTC base pointer
Returns
State of the lock register lock
  • true if register is locked
  • false if the register is not locked Implements : RTC_HAL_GetLockRegisterLock_Activity

Definition at line 634 of file rtc_hal.h.

static rtc_clk_select_t RTC_HAL_GetLPOSelect ( const RTC_Type *const  base)
inlinestatic

Get the selected clock source for RTC prescaler.

When set, the RTC prescaler increments using the LPO 1kHz clock and not the RTC 32kHz crystal clock. The LPO increments the prescaler from bit TPR[5] (TPR[4:0] are ignored), supporting close to 1 second increment of the seconds register.

Parameters
[in]baseRTC base pointer
Returns
Selected clock source for RTC Implements : RTC_HAL_GetLPOSelect_Activity

Definition at line 404 of file rtc_hal.h.

static bool RTC_HAL_GetNonSupervisorAccess ( const RTC_Type *const  base)
inlinestatic

Get Non-Supervisor access mode.

Parameters
[in]baseRTC base pointer
Returns
supervisor access mode
  • true if Non-supervisor mode write accesses are supported.
  • false if Non-supervisor mode write accesses are not supported. Implements : RTC_HAL_GetNonSupervisorAccess_Activity

Definition at line 471 of file rtc_hal.h.

static bool RTC_HAL_GetStatusRegisterLock ( const RTC_Type *const  base)
inlinestatic

Get the Status Register Lock state.

Parameters
[in]baseRTC base pointer
Returns
State of the status register lock
  • true if register is locked
  • false if the register is not locked Implements : RTC_HAL_GetStatusRegisterLock_Activity

Definition at line 666 of file rtc_hal.h.

static bool RTC_HAL_GetTimeAlarmFlag ( const RTC_Type *const  base)
inlinestatic

Get the Time alarm flag.

The alarm flag is cleared after a write in Time Alarm Register

Parameters
[in]baseRTC base pointer
Returns
: State of the alarm flag
  • true if an alarm occurred
  • false if an alarm was not occurred Implements : RTC_HAL_GetTimeAlarmFlag_Activity

Definition at line 558 of file rtc_hal.h.

static bool RTC_HAL_GetTimeAlarmIntEnable ( const RTC_Type *const  base)
inlinestatic

Get the TimeAlarm interrupt enable status.

Parameters
[in]baseRTC base pointer
Returns
The TimeAlarm interrupt enablement
  • true if interrupt is enabled
  • false if interrupt is disabled Implements : RTC_HAL_GetTimeAlarmIntEnable_Activity

Definition at line 864 of file rtc_hal.h.

static uint32_t RTC_HAL_GetTimeAlarmRegister ( const RTC_Type *const  base)
inlinestatic

Get Time Alarm Register.

Parameters
[in]baseRTC base pointer
Returns
Value in seconds of the Time Alarm Register Implements : RTC_HAL_GetTimeAlarmRegister_Activity

Definition at line 253 of file rtc_hal.h.

static void RTC_HAL_GetTimeCompensation ( const RTC_Type *const  base,
int8_t *  compensationValue,
uint8_t *  compensationInterval 
)
inlinestatic

Get Time Compensation Value and Interval.

The Time Prescaler register overflows at every 32768 - (compRegister) cycles. For example if the compRegister is -128 TPR overflows at 32768 - (-128) = 32896 cycles. Else if compRegister is 127 TPR overflows at 32641 cycles. This correction is made at the interval configured by Compensation Interval

Parameters
[in]baseRTC base pointer
[out]compensationValueCompensation value
[out]compensationIntervalCompensation Interval
Returns
None

Implements : RTC_HAL_GetTimeCompensation_Activity

Definition at line 295 of file rtc_hal.h.

static bool RTC_HAL_GetTimeCompensationLock ( const RTC_Type *const  base)
inlinestatic

Get the TimeCompensation Register Lock state.

Parameters
[in]baseRTC base pointer
Returns
State of the Time Compensation register lock
  • true if register is locked
  • false if the register is not locked Implements : RTC_HAL_GetTimeCompensationLock_Activity

Definition at line 714 of file rtc_hal.h.

static bool RTC_HAL_GetTimeCounterEnable ( const RTC_Type *const  base)
inlinestatic

Get the Time Counter Enable value.

Parameters
[in]baseRTC base pointer
Returns
State of the counter enable bit
  • true if the counter is enabled
  • false if the counter is disabled Implements : RTC_HAL_GetTimeCounterEnable_Activity

Definition at line 540 of file rtc_hal.h.

static bool RTC_HAL_GetTimeInvalidFlag ( const RTC_Type *const  base)
inlinestatic

Get Time Invalid flag.

The time invalid flag is set on POR or software reset. The TSR and TPR do not increment and read as zero when this bit is set. This bit is cleared by writing the TSR register when the time counter is disabled.

Parameters
[in]baseRTC base pointer
Returns
State of the time invalid flag
  • true if TIF is set
  • false if TIF is clear Implements : RTC_HAL_GetTimeInvalidFlag_Activity

Definition at line 598 of file rtc_hal.h.

static bool RTC_HAL_GetTimeInvalidIntEnable ( const RTC_Type *const  base)
inlinestatic

Get the TimeInvalid interrupt enable status.

Parameters
[in]baseRTC base pointer
Returns
The TimeInvalid interrupt enablement
  • true if interrupt is enabled
  • false if interrupt is disabled Implements : RTC_HAL_GetTimeInvalidIntEnable_Activity

Definition at line 930 of file rtc_hal.h.

static bool RTC_HAL_GetTimeOverflowFlag ( const RTC_Type *const  base)
inlinestatic

Get Time Overflow Flag.

The TOF is set when Time Seconds Register overflows. Disable the counter and write TSR to clear this bit

Parameters
[in]baseRTC base pointer
Returns
State of the Time overflow flag
  • true if an overflow has occurred
  • false if an overflow has not occurred Implements : RTC_HAL_GetTimeOverflowFlag_Activity

Definition at line 577 of file rtc_hal.h.

static bool RTC_HAL_GetTimeOverflowIntEnable ( const RTC_Type *const  base)
inlinestatic

Get the TimeAlarm interrupt enable status.

Parameters
[in]baseRTC base pointer
Returns
The TimeOverflow interrupt enablement
  • true if interrupt is enabled
  • false if interrupt is disabled Implements : RTC_HAL_GetTimeOverflowIntEnable_Activity

Definition at line 897 of file rtc_hal.h.

static uint16_t RTC_HAL_GetTimePrescalerRegister ( const RTC_Type *const  base)
inlinestatic

Get Time Prescaler Register.

Parameters
[in]baseRTC base pointer
Returns
Value stored in the Time Prescaler Register Implements : RTC_HAL_GetTimePrescalerRegister_Activity

Definition at line 219 of file rtc_hal.h.

static rtc_second_int_cfg_t RTC_HAL_GetTimeSecondsIntConf ( const RTC_Type *const  base)
inlinestatic

Get Time Seconds interrupt configuration.

Parameters
[in]baseRTC base pointer
Returns
Time Seconds interrupt configuration Implements : RTC_HAL_GetTimeSecondsIntConf_Activity

Definition at line 765 of file rtc_hal.h.

static bool RTC_HAL_GetTimeSecondsIntEnable ( const RTC_Type *const  base)
inlinestatic

Get the TimeSeconds interrupt enable status.

Parameters
[in]baseRTC base pointer
Returns
The TimeSeconds interrupt enablement
  • true if interrupt is enabled
  • false if interrupt is disabled Implements : RTC_HAL_GetTimeSecondsIntEnable_Activity

Definition at line 831 of file rtc_hal.h.

static uint32_t RTC_HAL_GetTimeSecondsRegister ( const RTC_Type *const  base)
inlinestatic

Get Time Seconds Register Value.

Parameters
[in]baseRTC base pointer
Returns
Number of seconds passed Implements : RTC_HAL_GetTimeSecondsRegister_Activity

Definition at line 186 of file rtc_hal.h.

static bool RTC_HAL_GetUpdateMode ( const RTC_Type *const  base)
inlinestatic

Get the Update Mode of the registers when locked.

Parameters
[in]baseRTC base pointer
Returns
Update mode value
  • true if writing of the registers when locked is enabled
  • false if writing of the registers when locked is disabled Implements : RTC_HAL_GetUpdateMode_Activity

Definition at line 437 of file rtc_hal.h.

status_t RTC_HAL_Init ( RTC_Type *const  base)

Initialize RTC instance.

Parameters
[in]baseRTC base pointer
Returns
STATUS_SUCCESS if the operation was successful, STATUS_ERROR if at least one register is locked.

Definition at line 47 of file rtc_hal.c.

bool RTC_HAL_IsRegisterLocked ( const RTC_Type *const  base,
rtc_lock_register_select_t  reg 
)

This function gets register lock status.

Parameters
[in]baseRTC base pointer
[in]regThe register for which to check lock status
Returns
Return true if the register is locked, false if it is not locked

Definition at line 258 of file rtc_hal.c.

static void RTC_HAL_LockRegisterLock ( RTC_Type *const  base)
inlinestatic

Lock the Lock Register.

This method locks the Lock Register. If the register is locked, it can be unlocked only with power-on reset(POR) or a software reset.

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_LockRegisterLock_Activity

Definition at line 618 of file rtc_hal.h.

static void RTC_HAL_SetLPOSelect ( RTC_Type *const  base,
rtc_clk_select_t  clk_select 
)
inlinestatic

Select clock source for RTC prescaler.

When set, the RTC prescaler increments using the LPO 1kHz clock and not the RTC 32kHz crystal clock. The LPO increments the prescaler from bit TPR[5] (TPR[4:0] are ignored), supporting close to 1 second increment of the seconds register.

Parameters
[in]baseRTC base pointer
[in]clk_selectclock source Implements : RTC_HAL_SetLPOSelect_Activity

Definition at line 384 of file rtc_hal.h.

static void RTC_HAL_SetNonSupervisorAccess ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Set Non-Supervisor access mode.

Parameters
[in]baseRTC base pointer
[in]enablesupervisor access
  • if true Non-supervisor mode write accesses are supported.
  • if false Non-supervisor mode write accesses are not supported and generate a bus error. Implements : RTC_HAL_SetNonSupervisorAccess_Activity

Definition at line 454 of file rtc_hal.h.

static void RTC_HAL_SetSoftwareReset ( RTC_Type *const  base)
inlinestatic

Trigger a software reset.

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_SetSoftwareReset_Activity

Definition at line 484 of file rtc_hal.h.

static void RTC_HAL_SetTimeAlarmIntEnable ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Enable TimeAlarm interrupt.

Parameters
[in]baseRTC base pointer
[in]enableWrite
  • true to enable the interrupt
  • false to disable it Implements : RTC_HAL_SetTimeAlarmIntEnable_Activity

Definition at line 847 of file rtc_hal.h.

static void RTC_HAL_SetTimeAlarmRegister ( RTC_Type *const  base,
uint32_t  seconds 
)
inlinestatic

Set Time Alarm Register.

Parameters
[in]baseRTC base pointer
[in]secondsNumber of seconds at which the alarm is triggered. The TAR value is correct only if the value is greater than current time (Time seconds register) Implements : RTC_HAL_SetTimeAlarmRegister_Activity

Definition at line 269 of file rtc_hal.h.

static void RTC_HAL_SetTimeCompensation ( RTC_Type *const  base,
int8_t  compensationValue,
uint8_t  compensationInterval 
)
inlinestatic

Set Time Compensation.

Configure the frequency of the Time Seconds counter together with Compensation Interval register.

The Time Prescaler register overflows at every 32768 - (compValue) cycles. For example if the compValue is -128 TPR overflows at 32768 - (-128) = 32896 cycles

Else if compValue is 127 TPR overflows at 32641 cycles

The compensation interval in seconds from 1 to 256 is used to control how frequently the TCR should adjust the number of 32.768 kHz cycles in each second. The value written should be one less than the number of seconds. For example, write zero to configure for a compensation interval of one second. This register is double buffered and writes do not take affect until the end of the current compensation interval.

Parameters
[in]baseRTC base pointer
[in]compensationValue- the value which is subtracted from the counter valid range -128, +127
[in]compensationIntervalCompensation interval at which the compensation value is added to the prescaler register
Returns
None Implements : RTC_HAL_SetTimeCompensation_Activity

Definition at line 332 of file rtc_hal.h.

static void RTC_HAL_SetTimeCounterEnable ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Enable or disable the Time counter.

When time counter is disabled the TSR register and TPR register are writable, but do not increment. When time counter is enabled the TSR register and TPR register are not writable, but increment.

Parameters
[in]baseRTC base pointer
[in]enable:
  • true to enable the counter
  • false to disable the counter Implements : RTC_HAL_SetTimeCounterEnable_Activity

Definition at line 523 of file rtc_hal.h.

static void RTC_HAL_SetTimeInvalidIntEnable ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Enable TimeInvalid interrupt.

Parameters
[in]baseRTC base pointer
[in]enableWrite
  • true to enable the interrupt
  • false to disable it Implements : RTC_HAL_SetTimeInvalidIntEnable_Activity

Definition at line 913 of file rtc_hal.h.

static void RTC_HAL_SetTimeOverflowIntEnable ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Enable TimeOverflow interrupt.

Parameters
[in]baseRTC base pointer
[in]enableWrite
  • true to enable the interrupt
  • false to disable it Implements : RTC_HAL_SetTimeOverflowIntEnable_Activity

Definition at line 880 of file rtc_hal.h.

status_t RTC_HAL_SetTimePrescalerRegister ( RTC_Type *const  base,
uint16_t  value 
)

Set Time Prescaler Register.

This function along with SetTimeSecondsRegister will help you set the starting time at a specified value. The write will fail if the Time Counter is enabled and will return STATUS_ERROR, otherwise the return will be STATUS_SUCCESS

Parameters
[in]baseRTC base pointer
[in]valueNumber of RTC CLK IN periods
Returns
STATUS_SUCCESS if the write is succeeded or STATUS_ERROR if the counter is enabled.

Definition at line 179 of file rtc_hal.c.

static void RTC_HAL_SetTimeSecondsIntConf ( RTC_Type *const  base,
rtc_second_int_cfg_t  intCfg 
)
inlinestatic

Configure Time Seconds interrupt.

Parameters
[in]baseRTC base pointer
[in]intCfgSelect at which frequency the interrupt will occur. Implements : RTC_HAL_SetTimeSecondsIntConf_Activity

Definition at line 750 of file rtc_hal.h.

static void RTC_HAL_SetTimeSecondsIntEnable ( RTC_Type *const  base,
bool  enable 
)
inlinestatic

Enable TimeSeconds interrupt.

Parameters
[in]baseRTC base pointer
[in]enableWrite:
  • true to enable the interrupt
  • false to disable it Implements : RTC_HAL_SetTimeSecondsIntEnable_Activity

Definition at line 814 of file rtc_hal.h.

status_t RTC_HAL_SetTimeSecondsRegister ( RTC_Type *const  base,
uint32_t  seconds 
)

Set Time Seconds Register.

This function along with SetTimePrescalerRegister will help you set the starting time at a specified value. The write will fail if the Time Counter is enabled and will return STATUS_ERROR, otherwise the return will be STATUS_SUCCESS

Parameters
[in]baseRTC base pointer
[in]secondsnumber of seconds passed
Returns
STATUS_SUCCESS if the write is succeeded or STATUS_ERROR if the counter is enabled.

Definition at line 151 of file rtc_hal.c.

static void RTC_HAL_SetUpdateMode ( RTC_Type *const  base,
bool  updateEnable 
)
inlinestatic

Set Update Mode of the registers when locked.

Parameters
[in]baseRTC base pointer
[in]updateEnablevalue to be written in the register field
  • true to enable writing of the registers when locked
  • false to disable writing of the registers when locked Implements : RTC_HAL_SetUpdateMode_Activity

Definition at line 420 of file rtc_hal.h.

static void RTC_HAL_StatusRegisterLock ( RTC_Type *const  base)
inlinestatic

Lock the Status Register.

This method locks the Status Register. If the register is locked, it can be unlocked only with power-on reset(POR) or a software reset.

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_StatusRegisterLock_Activity

Definition at line 650 of file rtc_hal.h.

static void RTC_HAL_TimeCompensationLock ( RTC_Type *const  base)
inlinestatic

Lock the TimeCompensation Register.

This method locks the TimeCompensation Register. If the register is locked, it can be unlocked only with power-on reset(POR) or a software reset.

Parameters
[in]baseRTC base pointer Implements : RTC_HAL_TimeCompensationLock_Activity

Definition at line 731 of file rtc_hal.h.