CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
[aonrtc] AON Real Time Clock

Functions

__STATIC_INLINE void AONRTCEnable (void)
 Enable the RTC. More...
 
__STATIC_INLINE void AONRTCDisable (void)
 Disable the RTC. More...
 
uint32_t AONRTCStatus (void)
 Check if the AON Real Time Clock is running. More...
 
__STATIC_INLINE void AONRTCReset (void)
 Reset the RTC. More...
 
__STATIC_INLINE void AONRTCDelayConfig (uint32_t ui32Delay)
 Configure Event Delay for the RTC. More...
 
__STATIC_INLINE void AONRTCCombinedEventConfig (uint32_t ui32Channels)
 Configure the source of the combined event. More...
 
void AONRTCEventClear (uint32_t ui32Channel)
 Clear event from a specified channel. More...
 
bool AONRTCEventGet (uint32_t ui32Channel)
 Get event status for a specified channel. More...
 
__STATIC_INLINE uint32_t AONRTCSecGet (void)
 Get nominal seconds of RTC free-running timer. More...
 
__STATIC_INLINE uint32_t AONRTCFractionGet (void)
 Get fractional part of RTC free-running timer. More...
 
__STATIC_INLINE uint32_t AONRTCSubSecIncrGet (void)
 Get the sub second increment of the RTC. More...
 
void AONRTCModeCh1Set (uint32_t ui32Mode)
 Set operational mode of channel 1. More...
 
uint32_t AONRTCModeCh1Get (void)
 Get operational mode of channel 1. More...
 
void AONRTCModeCh2Set (uint32_t ui32Mode)
 Set operational mode of channel 2. More...
 
uint32_t AONRTCModeCh2Get (void)
 Get operational mode of channel 2. More...
 
void AONRTCChannelEnable (uint32_t ui32Channel)
 Enable event operation for the specified channel. More...
 
void AONRTCChannelDisable (uint32_t ui32Channel)
 Disable event operation for the specified channel. More...
 
void AONRTCCompareValueSet (uint32_t ui32Channel, uint32_t ui32CompValue)
 Set the compare value for the given channel. More...
 
uint32_t AONRTCCompareValueGet (uint32_t ui32Channel)
 Get the compare value for the given channel. More...
 
__STATIC_INLINE uint32_t AONRTCCurrentCompareValueGet (void)
 Get the current value of the RTC counter in a format compatible to the compare registers. More...
 
__STATIC_INLINE void AONRTCIncValueCh2Set (uint32_t ui32IncValue)
 Set the channel 2 increment value when operating in continuous mode. More...
 
__STATIC_INLINE uint32_t AONRTCIncValueCh2Get (void)
 Get the channel2 increment value when operating in continuous mode. More...
 
__STATIC_INLINE uint32_t AONRTCCaptureValueCh1Get (void)
 Get the channel 1 capture value. More...
 

Detailed Description

Function Documentation

__STATIC_INLINE uint32_t AONRTCCaptureValueCh1Get ( void  )

Get the channel 1 capture value.

Get the channel 1 capture value. The upper 16 bits of the returned value is the lower 16 bits of the integer part of the RTC timer. The lower 16 bits of the returned part is the upper 16 bits of the fractional part.

Returns
Returns the channel 1 capture value.

Definition at line 704 of file aon_rtc.h.

void AONRTCChannelDisable ( uint32_t  ui32Channel)

Disable event operation for the specified channel.

Disable the event generation for the specified channel.

Note
The RTC free running clock can also be disabled globally using the AONRTCDisable() call.
Parameters
ui32Channelspecifies the channel from which to disable events. The parameter must be one of the following:
Returns
None
See also
AONRTCDisable()

Definition at line 284 of file aon_rtc.c.

void AONRTCChannelEnable ( uint32_t  ui32Channel)

Enable event operation for the specified channel.

Enable the event generation for the specified channel.

Note
The RTC free running clock must also be enabled globally using the AONRTCEnable() call.
Parameters
ui32Channelspecifies the channel from which to enable events. The parameter must be one of the following:
Returns
None
See also
AONRTCEnable()

Definition at line 255 of file aon_rtc.c.

__STATIC_INLINE void AONRTCCombinedEventConfig ( uint32_t  ui32Channels)

Configure the source of the combined event.

A combined delayed event can be generated from a combination of the three delayed events. Delayed events form the specified channels are OR'ed together to generate the combined event.

Parameters
ui32Channelsspecifies the channels that are to be used for generating the combined event. The parameter must be the bitwise OR of any of the following:
Returns
None

Definition at line 312 of file aon_rtc.h.

uint32_t AONRTCCompareValueGet ( uint32_t  ui32Channel)

Get the compare value for the given channel.

Get compare value for the specified channel.

Parameters
ui32Channelspecifies a channel. The parameter must be one of the following:
Returns
Returns the stored compare value for the given channel

Definition at line 342 of file aon_rtc.c.

void AONRTCCompareValueSet ( uint32_t  ui32Channel,
uint32_t  ui32CompValue 
)

Set the compare value for the given channel.

Set compare value for the specified channel.

The format of the compare value is a 16 bit integer and 16 bit fractional format <16 sec.16 subsec>. The current value of the RTC counter can be retrieved in a format compatible to the compare register using AONRTCCurrentCompareValueGet()

Parameters
ui32Channelspecifies a compare channel and must be one of the following:
ui32CompValueis the compare value to set for the specified channel.
  • Format: <16 sec.16 subsec>
Returns
None
See also
AONRTCCurrentCompareValueGet()

Definition at line 313 of file aon_rtc.c.

__STATIC_INLINE uint32_t AONRTCCurrentCompareValueGet ( void  )

Get the current value of the RTC counter in a format compatible to the compare registers.

The compare value registers contains the 16 integer and 16 fractional bits. This function will return the current value of the RTC counter in an identical format.

Returns
Returns the current value of the RTC counter in a <16.16> fractional format.
See also
AONRTCCompareValueSet()

Definition at line 631 of file aon_rtc.h.

Referenced by OSCHF_AttemptToSwitchToXosc(), OSCHF_GetStartupTime(), OSCHF_SwitchToRcOscTurnOffXosc(), and OSCHF_TurnOnXosc().

__STATIC_INLINE void AONRTCDelayConfig ( uint32_t  ui32Delay)

Configure Event Delay for the RTC.

Each event from the three individual channels can generate a delayed event. The delay time for these events is set using this function. The delay is measured in clock cycles.

Note
There is only one delay setting shared for all three channels.
Parameters
ui32Delayspecifies the delay time for delayed events. Parameter must be one of the following:
Returns
None.

Definition at line 275 of file aon_rtc.h.

__STATIC_INLINE void AONRTCDisable ( void  )

Disable the RTC.

Disable the AON Real Time Clock.

Note
Event generation for each of the three channels can also be disabled using the function AONRTCChannelDisable().
Returns
None
See also
AONRTCChannelDisable()

Definition at line 192 of file aon_rtc.h.

__STATIC_INLINE void AONRTCEnable ( void  )

Enable the RTC.

Enable the AON Real Time Clock.

Note
Event generation for each of the three channels must also be enabled using the function AONRTCChannelEnable().
Returns
None
See also
AONRTCChannelEnable()

Definition at line 169 of file aon_rtc.h.

void AONRTCEventClear ( uint32_t  ui32Channel)

Clear event from a specified channel.

In case of an active event from the specified channel, the event will be cleared (de-asserted).

Parameters
ui32Channelclears the event from one (and only one) of the following channels:
Returns
None

Definition at line 108 of file aon_rtc.c.

bool AONRTCEventGet ( uint32_t  ui32Channel)

Get event status for a specified channel.

In case of an active event from the specified channel, this call will return true otherwise false.

Parameters
ui32Channelspecifies the channel from which to query the event state. The parameter must be one (and only one) of the following:
Returns
Returns true if an event has occurred for the given channel, otherwise false.

Definition at line 137 of file aon_rtc.c.

__STATIC_INLINE uint32_t AONRTCFractionGet ( void  )

Get fractional part of RTC free-running timer.

Get the value of the fractional part of RTC free-running timer, i.e. the sub-second part.

Note
To read a consistent pair of integer and fractional part, the AONRTCSecGet() call must be done before this call. Since reading the integer part latches the fractional part as a side effect.
Returns
Returns the fractional part of RTC free running timer.
See also
AONRTCSecGet()

Definition at line 407 of file aon_rtc.h.

__STATIC_INLINE uint32_t AONRTCIncValueCh2Get ( void  )

Get the channel2 increment value when operating in continuous mode.

Get the channel 2 increment value, when channel 2 is operating in continuous mode. This value is automatically incremented to the channel 2 compare register, upon a channel 2 compare event. This allows channel 2 to generate a series of completely equidistant events.

Returns
Returns the channel 2 increment value when operating in continuous mode.
See also
AONRTCIncValueCh2Set()

Definition at line 686 of file aon_rtc.h.

__STATIC_INLINE void AONRTCIncValueCh2Set ( uint32_t  ui32IncValue)

Set the channel 2 increment value when operating in continuous mode.

Set the channel 2 increment value when operating in continuous mode. The specified value is automatically incremented to the channel 2 compare register, upon a channel 2 compare event. This allows channel 2 to generate a series of completely equidistant events.

Parameters
ui32IncValueis the increment value when operating in continuous mode.
Returns
None
See also
AONRTCIncValueCh2Get()

Definition at line 664 of file aon_rtc.h.

uint32_t AONRTCModeCh1Get ( void  )

Get operational mode of channel 1.

Get the operational mode of channel 1. It can be capture or compare mode. In capture mode, an external event causes the value of the free running counter to be stored, to remember the time of the event.

Returns
Returns the operational mode of channel 1, one of:
See also
AONRTCModeCh1Set()

Definition at line 195 of file aon_rtc.c.

void AONRTCModeCh1Set ( uint32_t  ui32Mode)

Set operational mode of channel 1.

Set the operational mode of channel 1. It can be capture or compare mode. In capture mode, an external event causes the value of the free running counter to be stored, to remember the time of the event.

Note
The default mode is compare.
Parameters
ui32Modespecifies the mode for channel 1. The parameter must be one of the following:
Returns
None
See also
AONRTCModeCh1Get()

Definition at line 171 of file aon_rtc.c.

uint32_t AONRTCModeCh2Get ( void  )

Get operational mode of channel 2.

Get the operational mode of channel 2. It can be in continuous compare mode or normal compare mode. In continuous mode, a value is automatically incremented to the channel 2 compare register, upon a channel 2 compare event. This allows channel 2 to generate a series of completely equidistant events. The increment value is set by the AONRTCIncValueCh2Set() call.

Returns
Returns the operational mode of channel 2, i.e. one of:
See also
AONRTCIncValueCh2Set(), AONRTCIncValueCh2Get()

Definition at line 237 of file aon_rtc.c.

void AONRTCModeCh2Set ( uint32_t  ui32Mode)

Set operational mode of channel 2.

Set the operational mode of channel 2. It can be in continuous compare mode or normal compare mode. In continuous mode, a value is automatically incremented to the channel 2 compare register, upon a channel 2 compare event. This allows channel 2 to generate a series of completely equidistant events. The increment value is set by the AONRTCIncValueCh2Set() call.

Note
The default mode is normal compare.
Parameters
ui32Modespecifies the mode for channel 2. The parameter must be one of the following:
Returns
None
See also
AONRTCIncValueCh2Set(), AONRTCIncValueCh2Get()

Definition at line 213 of file aon_rtc.c.

__STATIC_INLINE void AONRTCReset ( void  )

Reset the RTC.

Reset the AON Real Time Clock.

Returns
None

Definition at line 234 of file aon_rtc.h.

__STATIC_INLINE uint32_t AONRTCSecGet ( void  )

Get nominal seconds of RTC free-running timer.

Get the value in seconds of RTC free-running timer, i.e. the integer part. The fractional part is returned from a call to AONRTCFractionGet().

Note
To read a consistent pair of integer and fractional part, the AONRTCSecGet() call must be done first. Since reading the integer part latches the fractional part as a side effect.
Returns
Returns the integer part of RTC free running timer.
See also
AONRTCFractionGet().

Definition at line 381 of file aon_rtc.h.

uint32_t AONRTCStatus ( void  )

Check if the AON Real Time Clock is running.

Use this function to check if the RTC is enabled. This can be relevant when recovering from powerdown mode. In powerdown the AON domain is still active and therefore the configuration of the RTC is not lost. The application code can poll the RTC with this function to check if the RTC is active before trying to (re)configure the RTC.

Note
An enabled channel in the return value does not indicate that the RTC is running. The AON_RTC_ACTIVE must be set as well.
Returns
Returns a bitwise combination of values indicating if the the RTC is active and which channels are enabled. The returned value will be a bitwise OR'ed combination of the following:

Definition at line 78 of file aon_rtc.c.

__STATIC_INLINE uint32_t AONRTCSubSecIncrGet ( void  )

Get the sub second increment of the RTC.

Get the value of the sub-second increment which is added to the RTC absolute time on every clock tick.

Note
For a precise and temperature independent LF clock (e.g. an LF XTAL) this value would stay the same across temperature. For temperatue dependent clock sources like an RC oscillator, this value will change over time if the application includes functionality for doing temperature compensation of the RTC clock source. The default value corresponds to a LF clock frequency of exactly 32.768 kHz.
Returns
Returns the sub-second increment of the RTC added to the overall value on every RTC clock tick.

Definition at line 435 of file aon_rtc.h.

Macro Definition Documentation

#define AON_RTC_ACTIVE   0x8

Definition at line 106 of file aon_rtc.h.

Referenced by AONRTCStatus().

#define AON_RTC_CH_NONE   0x0

Definition at line 102 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_1   1

Definition at line 114 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_112   11

Definition at line 124 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_128   12

Definition at line 125 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_144   13

Definition at line 126 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_16   5

Definition at line 118 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_160   14

Definition at line 127 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_176   15

Definition at line 128 of file aon_rtc.h.

Referenced by AONRTCDelayConfig().

#define AON_RTC_CONFIG_DELAY_2   2

Definition at line 115 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_32   6

Definition at line 119 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_4   3

Definition at line 116 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_48   7

Definition at line 120 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_64   8

Definition at line 121 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_8   4

Definition at line 117 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_80   9

Definition at line 122 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_96   10

Definition at line 123 of file aon_rtc.h.

#define AON_RTC_CONFIG_DELAY_NODELAY   0

Definition at line 113 of file aon_rtc.h.

#define AON_RTC_MODE_CH1_CAPTURE   1

Definition at line 136 of file aon_rtc.h.

Referenced by AONRTCModeCh1Get(), and AONRTCModeCh1Set().

#define AON_RTC_MODE_CH1_COMPARE   0

Definition at line 137 of file aon_rtc.h.

Referenced by AONRTCModeCh1Get(), and AONRTCModeCh1Set().

#define AON_RTC_MODE_CH2_CONTINUOUS   1

Definition at line 145 of file aon_rtc.h.

Referenced by AONRTCModeCh2Get(), and AONRTCModeCh2Set().

#define AON_RTC_MODE_CH2_NORMALCOMPARE   0

Definition at line 146 of file aon_rtc.h.

Referenced by AONRTCModeCh2Get(), and AONRTCModeCh2Set().