CC13xx Driver Library
[aon_rtc.h] AON Real Time Clock

Functions

static void AONRTCEnable (void)
 Enable the RTC. More...
 
static void AONRTCDisable (void)
 Disable the RTC. More...
 
static void AONRTCReset (void)
 Reset the RTC. More...
 
static bool AONRTCActive (void)
 Check if the RTC is active (enabled). More...
 
static bool AONRTCChannelActive (uint32_t ui32Channel)
 Check if an RTC channel is active (enabled). More...
 
static void AONRTCDelayConfig (uint32_t ui32Delay)
 Configure Event Delay for the RTC. More...
 
static void AONRTCCombinedEventConfig (uint32_t ui32Channels)
 Configure the source of the combined event. More...
 
static void AONRTCEventClear (uint32_t ui32Channel)
 Clear event from a specified channel. More...
 
static bool AONRTCEventGet (uint32_t ui32Channel)
 Get event status for a specified channel. More...
 
static uint32_t AONRTCSecGet (void)
 Get integer part (seconds) of RTC free-running timer. More...
 
static uint32_t AONRTCFractionGet (void)
 Get fractional part (sub-seconds) of RTC free-running timer. More...
 
static uint32_t AONRTCSubSecIncrGet (void)
 Get the sub second increment of the RTC. More...
 
static void AONRTCModeCh1Set (uint32_t ui32Mode)
 Set operational mode of channel 1. More...
 
static uint32_t AONRTCModeCh1Get (void)
 Get operational mode of channel 1. More...
 
static void AONRTCModeCh2Set (uint32_t ui32Mode)
 Set operational mode of channel 2. More...
 
static uint32_t AONRTCModeCh2Get (void)
 Get operational mode of channel 2. More...
 
static void AONRTCChannelEnable (uint32_t ui32Channel)
 Enable event operation for the specified channel. More...
 
static void AONRTCChannelDisable (uint32_t ui32Channel)
 Disable event operation for the specified channel. More...
 
static void AONRTCCompareValueSet (uint32_t ui32Channel, uint32_t ui32CompValue)
 Set the compare value for the given channel. More...
 
static uint32_t AONRTCCompareValueGet (uint32_t ui32Channel)
 Get the compare value for the given channel. More...
 
uint32_t AONRTCCurrentCompareValueGet (void)
 Get the current value of the RTC counter in a format that matches RTC compare values. More...
 
uint64_t AONRTCCurrent64BitValueGet (void)
 Get the current 64-bit value of the RTC counter. More...
 
static void AONRTCIncValueCh2Set (uint32_t ui32IncValue)
 Set the channel 2 increment value when operating in continuous mode. More...
 
static uint32_t AONRTCIncValueCh2Get (void)
 Get the channel2 increment value when operating in continuous mode. More...
 
static uint32_t AONRTCCaptureValueCh1Get (void)
 Get the channel 1 capture value. More...
 

Detailed Description

Introduction

Note
If using TI-RTOS then only TI-RTOS is allowed to configure the RTC timer!

Function Documentation

static bool AONRTCActive ( void  )
inlinestatic

Check if the RTC is active (enabled).

Returns
Returns the status of the RTC.
  • false : RTC is disabled
  • true : RTC is enabled
228 {
229  // Read if RTC is enabled
230  return(HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_EN_BITN));
231 }
static uint32_t AONRTCCaptureValueCh1Get ( void  )
inlinestatic

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.
897 {
898  return(HWREG(AON_RTC_BASE + AON_RTC_O_CH1CAPT));
899 }
static bool AONRTCChannelActive ( uint32_t  ui32Channel)
inlinestatic

Check if an RTC channel is active (enabled).

Parameters
ui32Channelspecifies the RTC channel to check status of. Parameter must be one (and only one) of the following:
Returns
Returns the status of the requested channel:
  • false : Channel is disabled
  • true : Channel is enabled
250 {
251  uint32_t uint32Status = 0;
252 
253  if(ui32Channel & AON_RTC_CH0)
254  {
255  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH0_EN_BITN);
256  }
257 
258  if(ui32Channel & AON_RTC_CH1)
259  {
260  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH1_EN_BITN);
261  }
262 
263  if(ui32Channel & AON_RTC_CH2)
264  {
265  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH2_EN_BITN);
266  }
267 
268  return(uint32Status);
269 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
static void AONRTCChannelDisable ( uint32_t  ui32Channel)
inlinestatic

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 one or more channels to disable:
Returns
None
See also
AONRTCDisable()
692 {
693  // Check the arguments.
694  ASSERT((ui32Channel == AON_RTC_CH0) ||
695  (ui32Channel == AON_RTC_CH1) ||
696  (ui32Channel == AON_RTC_CH2));
697 
698  if(ui32Channel & AON_RTC_CH0)
699  {
701  }
702 
703  if(ui32Channel & AON_RTC_CH1)
704  {
706  }
707 
708  if(ui32Channel & AON_RTC_CH2)
709  {
711  }
712 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static void AONRTCChannelEnable ( uint32_t  ui32Channel)
inlinestatic

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 one or more channels to enable:
Returns
None
See also
AONRTCEnable()
649 {
650  // Check the arguments.
651  ASSERT((ui32Channel == AON_RTC_CH0) ||
652  (ui32Channel == AON_RTC_CH1) ||
653  (ui32Channel == AON_RTC_CH2));
654 
655  if(ui32Channel & AON_RTC_CH0)
656  {
658  }
659 
660  if(ui32Channel & AON_RTC_CH1)
661  {
663  }
664 
665  if(ui32Channel & AON_RTC_CH2)
666  {
668  }
669 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static void AONRTCCombinedEventConfig ( uint32_t  ui32Channels)
inlinestatic

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
338 {
339  uint32_t ui32Cfg;
340 
341  // Check the arguments.
342  ASSERT( (ui32Channels & (AON_RTC_CH0 | AON_RTC_CH1 | AON_RTC_CH2)) ||
343  (ui32Channels == AON_RTC_CH_NONE) );
344 
345  ui32Cfg = HWREG(AON_RTC_BASE + AON_RTC_O_CTL);
346  ui32Cfg &= ~(AON_RTC_CTL_COMB_EV_MASK_M);
347  ui32Cfg |= (ui32Channels << AON_RTC_CTL_COMB_EV_MASK_S);
348 
349  HWREG(AON_RTC_BASE + AON_RTC_O_CTL) = ui32Cfg;
350 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH_NONE
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static uint32_t AONRTCCompareValueGet ( uint32_t  ui32Channel)
inlinestatic

Get the compare value for the given channel.

Get compare value for the specified channel.

Parameters
ui32Channelspecifies a channel. The parameter must be one (and only one) of the following:
Returns
Returns the stored compare value for the given channel.
778 {
779  uint32_t ui32Value = 0;
780 
781  // Check the arguments
782  ASSERT((ui32Channel == AON_RTC_CH0) ||
783  (ui32Channel == AON_RTC_CH1) ||
784  (ui32Channel == AON_RTC_CH2));
785 
786  if(ui32Channel & AON_RTC_CH0)
787  {
788  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH0CMP);
789  }
790 
791  if(ui32Channel & AON_RTC_CH1)
792  {
793  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH1CMP);
794  }
795 
796  if(ui32Channel & AON_RTC_CH2)
797  {
798  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMP);
799  }
800 
801  return(ui32Value);
802 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static void AONRTCCompareValueSet ( uint32_t  ui32Channel,
uint32_t  ui32CompValue 
)
inlinestatic

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 one or more channels to set compare value for:
ui32CompValueis the compare value to set for the specified channel.
  • Format: <16 sec.16 subsec>
Returns
None
See also
AONRTCCurrentCompareValueGet()
739 {
740  // Check the arguments.
741  ASSERT((ui32Channel == AON_RTC_CH0) ||
742  (ui32Channel == AON_RTC_CH1) ||
743  (ui32Channel == AON_RTC_CH2));
744 
745  if(ui32Channel & AON_RTC_CH0)
746  {
747  HWREG(AON_RTC_BASE + AON_RTC_O_CH0CMP) = ui32CompValue;
748  }
749 
750  if(ui32Channel & AON_RTC_CH1)
751  {
752  HWREG(AON_RTC_BASE + AON_RTC_O_CH1CMP) = ui32CompValue;
753  }
754 
755  if(ui32Channel & AON_RTC_CH2)
756  {
757  HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMP) = ui32CompValue;
758  }
759 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
uint64_t AONRTCCurrent64BitValueGet ( void  )

Get the current 64-bit value of the RTC counter.

Note
Reading SEC both before and after SUBSEC in order to detect if SEC incremented while reading SUBSEC. If SEC incremented, we can't be sure which SEC the SUBSEC belongs to, so repeating the sequence then.
Returns
Returns the current value of the RTC counter in a 64-bits format (SEC[31:0].SUBSEC[31:0]).
86 {
87  union {
88  uint64_t returnValue ;
89  uint32_t secAndSubSec[ 2 ] ;
90  } currentRtc ;
91  uint32_t ui32SecondSecRead ;
92 
93  // Reading SEC both before and after SUBSEC in order to detect if SEC incremented while reading SUBSEC
94  // If SEC incremented, we can't be sure which SEC the SUBSEC belongs to, so repeating the sequence then.
95  do {
96  currentRtc.secAndSubSec[ 1 ] = HWREG( AON_RTC_BASE + AON_RTC_O_SEC );
97  currentRtc.secAndSubSec[ 0 ] = HWREG( AON_RTC_BASE + AON_RTC_O_SUBSEC );
98  ui32SecondSecRead = HWREG( AON_RTC_BASE + AON_RTC_O_SEC );
99  } while ( currentRtc.secAndSubSec[ 1 ] != ui32SecondSecRead );
100 
101  return ( currentRtc.returnValue );
102 }
uint32_t AONRTCCurrentCompareValueGet ( void  )

Get the current value of the RTC counter in a format that matches RTC compare values.

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

Note
Reading SEC both before and after SUBSEC in order to detect if SEC incremented while reading SUBSEC. If SEC incremented, we can't be sure which SEC the SUBSEC belongs to, so repeating the sequence then.
Returns
Returns the current value of the RTC counter in a <16.16> format (SEC[15:0].SUBSEC[31:16]).
See also
AONRTCCompareValueSet()

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

63 {
64  uint32_t ui32CurrentSec ;
65  uint32_t ui32CurrentSubSec ;
66  uint32_t ui32SecondSecRead ;
67 
68  // Reading SEC both before and after SUBSEC in order to detect if SEC incremented while reading SUBSEC
69  // If SEC incremented, we can't be sure which SEC the SUBSEC belongs to, so repeating the sequence then.
70  do {
71  ui32CurrentSec = HWREG( AON_RTC_BASE + AON_RTC_O_SEC );
72  ui32CurrentSubSec = HWREG( AON_RTC_BASE + AON_RTC_O_SUBSEC );
73  ui32SecondSecRead = HWREG( AON_RTC_BASE + AON_RTC_O_SEC );
74  } while ( ui32CurrentSec != ui32SecondSecRead );
75 
76  return (( ui32CurrentSec << 16 ) | ( ui32CurrentSubSec >> 16 ));
77 }
static void AONRTCDelayConfig ( uint32_t  ui32Delay)
inlinestatic

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.
303 {
304  uint32_t ui32Cfg;
305 
306  // Check the arguments.
307  ASSERT(ui32Delay <= AON_RTC_CONFIG_DELAY_144);
308 
309 
310  ui32Cfg = HWREG(AON_RTC_BASE + AON_RTC_O_CTL);
311  ui32Cfg &= ~(AON_RTC_CTL_EV_DELAY_M);
312  ui32Cfg |= (ui32Delay << AON_RTC_CTL_EV_DELAY_S);
313 
314  HWREG(AON_RTC_BASE + AON_RTC_O_CTL) = ui32Cfg;
315 }
#define AON_RTC_CONFIG_DELAY_144
Definition: aon_rtc.h:117
#define ASSERT(expr)
Definition: debug.h:73
static void AONRTCDisable ( void  )
inlinestatic

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()
196 {
197  // Disable RTC
199 }
static void AONRTCEnable ( void  )
inlinestatic

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()
175 {
176  // Enable RTC.
178 }
static void AONRTCEventClear ( uint32_t  ui32Channel)
inlinestatic

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 or more RTC channels:
Returns
None
369 {
370  // Check the arguments.
371  ASSERT((ui32Channel == AON_RTC_CH0) ||
372  (ui32Channel == AON_RTC_CH1) ||
373  (ui32Channel == AON_RTC_CH2));
374 
375  if(ui32Channel & AON_RTC_CH0)
376  {
378  }
379 
380  if(ui32Channel & AON_RTC_CH1)
381  {
383  }
384 
385  if(ui32Channel & AON_RTC_CH2)
386  {
388  }
389 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static bool AONRTCEventGet ( uint32_t  ui32Channel)
inlinestatic

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.
410 {
411  uint32_t uint32Event = 0;
412 
413  // Check the arguments.
414  ASSERT((ui32Channel == AON_RTC_CH0) ||
415  (ui32Channel == AON_RTC_CH1) ||
416  (ui32Channel == AON_RTC_CH2));
417 
418  if(ui32Channel & AON_RTC_CH0)
419  {
420  uint32Event = HWREGBITW(AON_RTC_BASE + AON_RTC_O_EVFLAGS, AON_RTC_EVFLAGS_CH0_BITN);
421  }
422 
423  if(ui32Channel & AON_RTC_CH1)
424  {
425  uint32Event = HWREGBITW(AON_RTC_BASE + AON_RTC_O_EVFLAGS, AON_RTC_EVFLAGS_CH1_BITN);
426  }
427 
428  if(ui32Channel & AON_RTC_CH2)
429  {
430  uint32Event = HWREGBITW(AON_RTC_BASE + AON_RTC_O_EVFLAGS, AON_RTC_EVFLAGS_CH2_BITN);
431  }
432 
433  return(uint32Event);
434 }
#define AON_RTC_CH1
Definition: aon_rtc.h:95
#define AON_RTC_CH2
Definition: aon_rtc.h:96
#define AON_RTC_CH0
Definition: aon_rtc.h:94
#define ASSERT(expr)
Definition: debug.h:73
static uint32_t AONRTCFractionGet ( void  )
inlinestatic

Get fractional part (sub-seconds) of RTC free-running timer.

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

Note
It is recommended to use AONRTCCurrentCompareValueGet() instead of this function if the <16.16> format is sufficient.
To read a consistent pair of integer and fractional parts, AONRTCSecGet() must be called first to trigger latching of the fractional part, which is then read by AONRTCFractionGet(). Interrupts must be disabled to ensure that these operations are performed atomically.
Returns
Returns the fractional part of RTC free running timer.
See also
AONRTCSecGet() AONRTCCurrentCompareValueGet()
486 {
487  // Note1: It is recommended to use AON RTCCurrentCompareValueGet() instead
488  // of this function if the <16.16> format is sufficient.
489  // Note2: AONRTCSecGet() must be called before this function to get a
490  // consistent reading.
491  // Note3: Interrupts must be disabled between the call to AONRTCSecGet() and this
492  // call since there are interrupt functions that reads AON_RTC_O_SEC
493  return(HWREG(AON_RTC_BASE + AON_RTC_O_SUBSEC));
494 }
static uint32_t AONRTCIncValueCh2Get ( void  )
inlinestatic

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()
879 {
880  return(HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMPINC));
881 }
static void AONRTCIncValueCh2Set ( uint32_t  ui32IncValue)
inlinestatic

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()
857 {
858  HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMPINC) = ui32IncValue;
859 }
static uint32_t AONRTCModeCh1Get ( void  )
inlinestatic

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()
567 {
569 }
static void AONRTCModeCh1Set ( uint32_t  ui32Mode)
inlinestatic

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()
542 {
543  // Check the arguments.
544  ASSERT((ui32Mode == AON_RTC_MODE_CH1_CAPTURE) ||
545  (ui32Mode == AON_RTC_MODE_CH1_COMPARE));
546 
548 }
#define AON_RTC_MODE_CH1_CAPTURE
Definition: aon_rtc.h:125
#define ASSERT(expr)
Definition: debug.h:73
#define AON_RTC_MODE_CH1_COMPARE
Definition: aon_rtc.h:126
static uint32_t AONRTCModeCh2Get ( void  )
inlinestatic

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()
624 {
626 }
static void AONRTCModeCh2Set ( uint32_t  ui32Mode)
inlinestatic

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()
596 {
597  // Check the arguments.
598  ASSERT((ui32Mode == AON_RTC_MODE_CH2_CONTINUOUS) ||
599  (ui32Mode == AON_RTC_MODE_CH2_NORMALCOMPARE));
600 
602 }
#define AON_RTC_MODE_CH2_NORMALCOMPARE
Definition: aon_rtc.h:135
#define ASSERT(expr)
Definition: debug.h:73
#define AON_RTC_MODE_CH2_CONTINUOUS
Definition: aon_rtc.h:134
static void AONRTCReset ( void  )
inlinestatic

Reset the RTC.

Reset the AON Real Time Clock.

Returns
None
212 {
213  // Reset RTC.
215 }
static uint32_t AONRTCSecGet ( void  )
inlinestatic

Get integer part (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
It is recommended to use AONRTCCurrentCompareValueGet() instead of this function if the <16.16> format is sufficient.
To read a consistent pair of integer and fractional parts, AONRTCSecGet() must be called first to trigger latching of the fractional part, which is then read by AONRTCFractionGet(). Interrupts must be disabled to ensure that these operations are performed atomically.
Returns
Returns the integer part of RTC free running timer.
See also
AONRTCFractionGet() AONRTCCurrentCompareValueGet()
458 {
459  // The following read gets the seconds, but also latches the fractional
460  // part.
461  return(HWREG(AON_RTC_BASE + AON_RTC_O_SEC));
462 }
static uint32_t AONRTCSubSecIncrGet ( void  )
inlinestatic

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.
516 {
517  return(HWREG(AON_RTC_BASE + AON_RTC_O_SUBSECINC));
518 }

Macro Definition Documentation

#define AON_RTC_ACTIVE   0x8
#define AON_RTC_CH_NONE   0x0
#define AON_RTC_CONFIG_DELAY_1   1
#define AON_RTC_CONFIG_DELAY_112   11
#define AON_RTC_CONFIG_DELAY_128   12
#define AON_RTC_CONFIG_DELAY_144   13

Referenced by AONRTCDelayConfig().

#define AON_RTC_CONFIG_DELAY_16   5
#define AON_RTC_CONFIG_DELAY_2   2
#define AON_RTC_CONFIG_DELAY_32   6
#define AON_RTC_CONFIG_DELAY_4   3
#define AON_RTC_CONFIG_DELAY_48   7
#define AON_RTC_CONFIG_DELAY_64   8
#define AON_RTC_CONFIG_DELAY_8   4
#define AON_RTC_CONFIG_DELAY_80   9
#define AON_RTC_CONFIG_DELAY_96   10
#define AON_RTC_CONFIG_DELAY_NODELAY   0
#define AON_RTC_MODE_CH1_CAPTURE   1

Referenced by AONRTCModeCh1Set().

#define AON_RTC_MODE_CH1_COMPARE   0

Referenced by AONRTCModeCh1Set().

#define AON_RTC_MODE_CH2_CONTINUOUS   1

Referenced by AONRTCModeCh2Set().

#define AON_RTC_MODE_CH2_NORMALCOMPARE   0

Referenced by AONRTCModeCh2Set().

#define FACTOR_SEC_TO_COMP_VAL_FORMAT   0x00010000