CC26xx 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...
 
static 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

§ AONRTCActive()

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
226 {
227  // Read if RTC is enabled
228  return(HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_EN_BITN));
229 }

§ AONRTCCaptureValueCh1Get()

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.
895 {
896  return(HWREG(AON_RTC_BASE + AON_RTC_O_CH1CAPT + NONSECURE_OFFSET));
897 }

§ AONRTCChannelActive()

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
248 {
249  uint32_t uint32Status = 0;
250 
251  if(ui32Channel & AON_RTC_CH0)
252  {
253  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH0_EN_BITN);
254  }
255 
256  if(ui32Channel & AON_RTC_CH1)
257  {
258  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH1_EN_BITN);
259  }
260 
261  if(ui32Channel & AON_RTC_CH2)
262  {
263  uint32Status = HWREGBITW(AON_RTC_BASE + AON_RTC_O_CHCTL, AON_RTC_CHCTL_CH2_EN_BITN);
264  }
265 
266  return(uint32Status);
267 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92

§ AONRTCChannelDisable()

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()
690 {
691  // Check the arguments.
692  ASSERT((ui32Channel == AON_RTC_CH0) ||
693  (ui32Channel == AON_RTC_CH1) ||
694  (ui32Channel == AON_RTC_CH2));
695 
696  if(ui32Channel & AON_RTC_CH0)
697  {
699  }
700 
701  if(ui32Channel & AON_RTC_CH1)
702  {
704  }
705 
706  if(ui32Channel & AON_RTC_CH2)
707  {
709  }
710 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCChannelEnable()

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()
647 {
648  // Check the arguments.
649  ASSERT((ui32Channel == AON_RTC_CH0) ||
650  (ui32Channel == AON_RTC_CH1) ||
651  (ui32Channel == AON_RTC_CH2));
652 
653  if(ui32Channel & AON_RTC_CH0)
654  {
656  }
657 
658  if(ui32Channel & AON_RTC_CH1)
659  {
661  }
662 
663  if(ui32Channel & AON_RTC_CH2)
664  {
666  }
667 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCCombinedEventConfig()

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

Referenced by SetupTrimDevice().

336 {
337  uint32_t ui32Cfg;
338 
339  // Check the arguments.
340  ASSERT( (ui32Channels & (AON_RTC_CH0 | AON_RTC_CH1 | AON_RTC_CH2)) ||
341  (ui32Channels == AON_RTC_CH_NONE) );
342 
343  ui32Cfg = HWREG(AON_RTC_BASE + AON_RTC_O_CTL);
344  ui32Cfg &= ~(AON_RTC_CTL_COMB_EV_MASK_M);
345  ui32Cfg |= (ui32Channels << AON_RTC_CTL_COMB_EV_MASK_S);
346 
347  HWREG(AON_RTC_BASE + AON_RTC_O_CTL) = ui32Cfg;
348 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH_NONE
Definition: aon_rtc.h:91
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCCompareValueGet()

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.
776 {
777  uint32_t ui32Value = 0;
778 
779  // Check the arguments
780  ASSERT((ui32Channel == AON_RTC_CH0) ||
781  (ui32Channel == AON_RTC_CH1) ||
782  (ui32Channel == AON_RTC_CH2));
783 
784  if(ui32Channel & AON_RTC_CH0)
785  {
786  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH0CMP + NONSECURE_OFFSET);
787  }
788 
789  if(ui32Channel & AON_RTC_CH1)
790  {
791  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH1CMP + NONSECURE_OFFSET);
792  }
793 
794  if(ui32Channel & AON_RTC_CH2)
795  {
796  ui32Value = HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMP + NONSECURE_OFFSET);
797  }
798 
799  return(ui32Value);
800 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCCompareValueSet()

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()
737 {
738  // Check the arguments.
739  ASSERT((ui32Channel == AON_RTC_CH0) ||
740  (ui32Channel == AON_RTC_CH1) ||
741  (ui32Channel == AON_RTC_CH2));
742 
743  if(ui32Channel & AON_RTC_CH0)
744  {
745  HWREG(AON_RTC_BASE + AON_RTC_O_CH0CMP + NONSECURE_OFFSET) = ui32CompValue;
746  }
747 
748  if(ui32Channel & AON_RTC_CH1)
749  {
750  HWREG(AON_RTC_BASE + AON_RTC_O_CH1CMP + NONSECURE_OFFSET) = ui32CompValue;
751  }
752 
753  if(ui32Channel & AON_RTC_CH2)
754  {
755  HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMP + NONSECURE_OFFSET) = ui32CompValue;
756  }
757 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCCurrent64BitValueGet()

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]).

Referenced by AONRTCCurrentCompareValueGet().

59 {
60  union {
61  uint64_t returnValue ;
62  uint32_t secAndSubSec[ 2 ] ;
63  } currentRtc ;
64  uint32_t ui32SecondSecRead ;
65 
66  // Reading SEC both before and after SUBSEC in order to detect if SEC incremented while reading SUBSEC
67  // If SEC incremented, we can't be sure which SEC the SUBSEC belongs to, so repeating the sequence then.
68  do {
69  currentRtc.secAndSubSec[ 1 ] = HWREG( AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SEC );
70  currentRtc.secAndSubSec[ 0 ] = HWREG( AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SUBSEC );
71  ui32SecondSecRead = HWREG( AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SEC );
72  } while ( currentRtc.secAndSubSec[ 1 ] != ui32SecondSecRead );
73 
74  return ( currentRtc.returnValue );
75 }

§ AONRTCCurrentCompareValueGet()

static uint32_t AONRTCCurrentCompareValueGet ( void  )
inlinestatic

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.

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().

819 {
820  return ( HWREG( AON_RTC_BASE + AON_RTC_O_TIME + NONSECURE_OFFSET ));
821 }
Here is the call graph for this function:

§ AONRTCDelayConfig()

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

§ AONRTCDisable()

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()
194 {
195  // Disable RTC
197 }

§ AONRTCEnable()

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()

Referenced by SetupTrimDevice().

173 {
174  // Enable RTC.
176 }

§ AONRTCEventClear()

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
367 {
368  // Check the arguments.
369  ASSERT((ui32Channel == AON_RTC_CH0) ||
370  (ui32Channel == AON_RTC_CH1) ||
371  (ui32Channel == AON_RTC_CH2));
372 
373  if(ui32Channel & AON_RTC_CH0)
374  {
375  HWREG(AON_RTC_BASE + AON_RTC_O_EVFLAGS + NONSECURE_OFFSET) = AON_RTC_EVFLAGS_CH0;
376  }
377 
378  if(ui32Channel & AON_RTC_CH1)
379  {
380  HWREG(AON_RTC_BASE + AON_RTC_O_EVFLAGS + NONSECURE_OFFSET) = AON_RTC_EVFLAGS_CH1;
381  }
382 
383  if(ui32Channel & AON_RTC_CH2)
384  {
385  HWREG(AON_RTC_BASE + AON_RTC_O_EVFLAGS + NONSECURE_OFFSET) = AON_RTC_EVFLAGS_CH2;
386  }
387 }
#define AON_RTC_CH1
Definition: aon_rtc.h:93
#define AON_RTC_CH2
Definition: aon_rtc.h:94
#define AON_RTC_CH0
Definition: aon_rtc.h:92
#define ASSERT(expr)
Definition: debug.h:71

§ AONRTCEventGet()

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

§ AONRTCFractionGet()

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()
484 {
485  // Note1: It is recommended to use AON RTCCurrentCompareValueGet() instead
486  // of this function if the <16.16> format is sufficient.
487  // Note2: AONRTCSecGet() must be called before this function to get a
488  // consistent reading.
489  // Note3: Interrupts must be disabled between the call to AONRTCSecGet() and this
490  // call since there are interrupt functions that reads AON_RTC_O_SEC
491  return(HWREG(AON_RTC_BASE + AON_RTC_O_SUBSEC + NONSECURE_OFFSET));
492 }

§ AONRTCIncValueCh2Get()

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()
877 {
878  return(HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMPINC + NONSECURE_OFFSET));
879 }

§ AONRTCIncValueCh2Set()

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()
855 {
856  HWREG(AON_RTC_BASE + AON_RTC_O_CH2CMPINC + NONSECURE_OFFSET) = ui32IncValue;
857 }

§ AONRTCModeCh1Get()

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()
565 {
567 }

§ AONRTCModeCh1Set()

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()
540 {
541  // Check the arguments.
542  ASSERT((ui32Mode == AON_RTC_MODE_CH1_CAPTURE) ||
543  (ui32Mode == AON_RTC_MODE_CH1_COMPARE));
544 
546 }
#define AON_RTC_MODE_CH1_CAPTURE
Definition: aon_rtc.h:123
#define ASSERT(expr)
Definition: debug.h:71
#define AON_RTC_MODE_CH1_COMPARE
Definition: aon_rtc.h:124

§ AONRTCModeCh2Get()

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()
622 {
624 }

§ AONRTCModeCh2Set()

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()
594 {
595  // Check the arguments.
596  ASSERT((ui32Mode == AON_RTC_MODE_CH2_CONTINUOUS) ||
597  (ui32Mode == AON_RTC_MODE_CH2_NORMALCOMPARE));
598 
600 }
#define AON_RTC_MODE_CH2_NORMALCOMPARE
Definition: aon_rtc.h:133
#define ASSERT(expr)
Definition: debug.h:71
#define AON_RTC_MODE_CH2_CONTINUOUS
Definition: aon_rtc.h:132

§ AONRTCReset()

static void AONRTCReset ( void  )
inlinestatic

Reset the RTC.

Reset the AON Real Time Clock.

Returns
None

Referenced by SetupTrimDevice().

210 {
211  // Reset RTC.
213 }

§ AONRTCSecGet()

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()
456 {
457  // The following read gets the seconds, but also latches the fractional
458  // part.
459  return(HWREG(AON_RTC_BASE + AON_RTC_O_SEC + NONSECURE_OFFSET));
460 }

§ AONRTCSubSecIncrGet()

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

Macro Definition Documentation

§ AON_RTC_ACTIVE

#define AON_RTC_ACTIVE   0x8

§ AON_RTC_CH0

§ AON_RTC_CH1

§ AON_RTC_CH2

§ AON_RTC_CH_NONE

#define AON_RTC_CH_NONE   0x0

§ AON_RTC_CONFIG_DELAY_1

#define AON_RTC_CONFIG_DELAY_1   1

§ AON_RTC_CONFIG_DELAY_112

#define AON_RTC_CONFIG_DELAY_112   11

§ AON_RTC_CONFIG_DELAY_128

#define AON_RTC_CONFIG_DELAY_128   12

§ AON_RTC_CONFIG_DELAY_144

#define AON_RTC_CONFIG_DELAY_144   13

Referenced by AONRTCDelayConfig().

§ AON_RTC_CONFIG_DELAY_16

#define AON_RTC_CONFIG_DELAY_16   5

§ AON_RTC_CONFIG_DELAY_2

#define AON_RTC_CONFIG_DELAY_2   2

§ AON_RTC_CONFIG_DELAY_32

#define AON_RTC_CONFIG_DELAY_32   6

§ AON_RTC_CONFIG_DELAY_4

#define AON_RTC_CONFIG_DELAY_4   3

§ AON_RTC_CONFIG_DELAY_48

#define AON_RTC_CONFIG_DELAY_48   7

§ AON_RTC_CONFIG_DELAY_64

#define AON_RTC_CONFIG_DELAY_64   8

§ AON_RTC_CONFIG_DELAY_8

#define AON_RTC_CONFIG_DELAY_8   4

§ AON_RTC_CONFIG_DELAY_80

#define AON_RTC_CONFIG_DELAY_80   9

§ AON_RTC_CONFIG_DELAY_96

#define AON_RTC_CONFIG_DELAY_96   10

§ AON_RTC_CONFIG_DELAY_NODELAY

#define AON_RTC_CONFIG_DELAY_NODELAY   0

§ AON_RTC_MODE_CH1_CAPTURE

#define AON_RTC_MODE_CH1_CAPTURE   1

Referenced by AONRTCModeCh1Set().

§ AON_RTC_MODE_CH1_COMPARE

#define AON_RTC_MODE_CH1_COMPARE   0

Referenced by AONRTCModeCh1Set().

§ AON_RTC_MODE_CH2_CONTINUOUS

#define AON_RTC_MODE_CH2_CONTINUOUS   1

Referenced by AONRTCModeCh2Set().

§ AON_RTC_MODE_CH2_NORMALCOMPARE

#define AON_RTC_MODE_CH2_NORMALCOMPARE   0

Referenced by AONRTCModeCh2Set().

§ FACTOR_SEC_TO_COMP_VAL_FORMAT

#define FACTOR_SEC_TO_COMP_VAL_FORMAT   0x00010000