CC26xx Driver Library
[aux_wuc.h] AUX Wake Up Controller

Functions

void AUXWUCClockEnable (uint32_t ui32Clocks)
 Enable clocks for peripherals in the AUX domain. More...
 
void AUXWUCClockDisable (uint32_t ui32Clocks)
 Disable clocks for peripherals in the AUX domain. More...
 
uint32_t AUXWUCClockStatus (uint32_t ui32Clocks)
 Get the status of a clock. More...
 
static void AUXWUCClockFreqReq (uint32_t ui32ClockFreq)
 Request a high or low frequency clock source. More...
 
void AUXWUCPowerCtrl (uint32_t ui32PowerMode)
 Control the power to the AUX domain. More...
 
static void AUXWUCFreezeEnable (void)
 Freeze the AUX IOs. More...
 
static void AUXWUCFreezeDisable (void)
 Unfreeze the AUX IOs. More...
 

Detailed Description

Function Documentation

void AUXWUCClockDisable ( uint32_t  ui32Clocks)

Disable clocks for peripherals in the AUX domain.

Use this function to enable specific clocks in the AUX domain.

Parameters
ui32Clocksa bitmap of clocks to disable. Use a bitwise OR combination of the following values:
Returns
None
See also
AUXWUCClockEnable()
108 {
109  // Check the arguments.
110  ASSERT((ui32Clocks & AUX_WUC_ADI_CLOCK) ||
111  (ui32Clocks & AUX_WUC_OSCCTRL_CLOCK) ||
112  (ui32Clocks & AUX_WUC_TDCIF_CLOCK) ||
113  (ui32Clocks & AUX_WUC_ANAIF_CLOCK) ||
114  (ui32Clocks & AUX_WUC_TIMER_CLOCK) ||
115  (ui32Clocks & AUX_WUC_AIODIO0_CLOCK) ||
116  (ui32Clocks & AUX_WUC_AIODIO1_CLOCK) ||
117  (ui32Clocks & AUX_WUC_SMPH_CLOCK) ||
118  (ui32Clocks & AUX_WUC_TDC_CLOCK) ||
119  (ui32Clocks & AUX_WUC_ADC_CLOCK) ||
120  (ui32Clocks & AUX_WUC_REF_CLOCK));
121 
122  // Disable some of the clocks in the clock register.
123  HWREG(AUX_WUC_BASE + AUX_WUC_O_MODCLKEN0) &= ~(ui32Clocks &
125 
126  // Check the rest.
127  if(ui32Clocks & AUX_WUC_ADC_CLOCK)
128  {
131  }
132  if(ui32Clocks & AUX_WUC_TDC_CLOCK)
133  {
136  }
137  if(ui32Clocks & AUX_WUC_REF_CLOCK)
138  {
141  }
142 }
#define AUX_WUC_TDC_CLOCK
Definition: aux_wuc.h:113
#define AUX_WUC_OSCCTRL_CLOCK
Definition: aux_wuc.h:109
#define AUX_WUC_AIODIO0_CLOCK
Definition: aux_wuc.h:104
#define AUX_WUC_ADI_CLOCK
Definition: aux_wuc.h:110
#define AUX_WUC_AIODIO1_CLOCK
Definition: aux_wuc.h:105
#define AUX_WUC_SMPH_CLOCK
Definition: aux_wuc.h:103
#define ASSERT(expr)
Definition: debug.h:73
#define AUX_WUC_REF_CLOCK
Definition: aux_wuc.h:115
#define AUX_WUC_TDCIF_CLOCK
Definition: aux_wuc.h:108
#define AUX_WUC_MODCLK_MASK
Definition: aux_wuc.h:111
#define AUX_WUC_ANAIF_CLOCK
Definition: aux_wuc.h:107
#define AUX_WUC_ADC_CLOCK
Definition: aux_wuc.h:114
#define AUX_WUC_TIMER_CLOCK
Definition: aux_wuc.h:106
void AUXWUCClockEnable ( uint32_t  ui32Clocks)

Enable clocks for peripherals in the AUX domain.

Use this function to enable specific clocks in the AUX domain.

Parameters
ui32Clocksis a bitmap of clocks to enable. Use a bitwise OR combination of the following values:
Returns
None
See also
AUXWUCClockDisable()
65 {
66  // Check the arguments.
67  ASSERT((ui32Clocks & AUX_WUC_ADI_CLOCK) ||
68  (ui32Clocks & AUX_WUC_OSCCTRL_CLOCK) ||
69  (ui32Clocks & AUX_WUC_TDCIF_CLOCK) ||
70  (ui32Clocks & AUX_WUC_ANAIF_CLOCK) ||
71  (ui32Clocks & AUX_WUC_TIMER_CLOCK) ||
72  (ui32Clocks & AUX_WUC_AIODIO0_CLOCK) ||
73  (ui32Clocks & AUX_WUC_AIODIO1_CLOCK) ||
74  (ui32Clocks & AUX_WUC_SMPH_CLOCK) ||
75  (ui32Clocks & AUX_WUC_TDC_CLOCK) ||
76  (ui32Clocks & AUX_WUC_ADC_CLOCK) ||
77  (ui32Clocks & AUX_WUC_REF_CLOCK));
78 
79  // Enable some of the clocks in the clock register.
80  HWREG(AUX_WUC_BASE + AUX_WUC_O_MODCLKEN0) |= (ui32Clocks &
82 
83  // Check the rest.
84  if(ui32Clocks & AUX_WUC_ADC_CLOCK)
85  {
88  }
89  if(ui32Clocks & AUX_WUC_TDC_CLOCK)
90  {
93  }
94  if(ui32Clocks & AUX_WUC_REF_CLOCK)
95  {
98  }
99 }
#define AUX_WUC_TDC_CLOCK
Definition: aux_wuc.h:113
#define AUX_WUC_OSCCTRL_CLOCK
Definition: aux_wuc.h:109
#define AUX_WUC_AIODIO0_CLOCK
Definition: aux_wuc.h:104
#define AUX_WUC_ADI_CLOCK
Definition: aux_wuc.h:110
#define AUX_WUC_AIODIO1_CLOCK
Definition: aux_wuc.h:105
#define AUX_WUC_SMPH_CLOCK
Definition: aux_wuc.h:103
#define ASSERT(expr)
Definition: debug.h:73
#define AUX_WUC_REF_CLOCK
Definition: aux_wuc.h:115
#define AUX_WUC_TDCIF_CLOCK
Definition: aux_wuc.h:108
#define AUX_WUC_MODCLK_MASK
Definition: aux_wuc.h:111
#define AUX_WUC_ANAIF_CLOCK
Definition: aux_wuc.h:107
#define AUX_WUC_ADC_CLOCK
Definition: aux_wuc.h:114
#define AUX_WUC_TIMER_CLOCK
Definition: aux_wuc.h:106
static void AUXWUCClockFreqReq ( uint32_t  ui32ClockFreq)
inlinestatic

Request a high or low frequency clock source.

Using this function it is possible to make a request to the System Control to use a high or low frequency clock as clock source for the AUX domain.

Note
A low frequency clock is always 32 kHz, while a high frequency clock is really a large span of frequencies determined by the clock source (High Frequency or Medium Frequency) and the setting for the clock divider for the AUX domain in the System Control.
Parameters
ui32ClockFreqdetermines the clock source frequency.
Returns
233 {
234  // Check the arguments.
235  ASSERT((ui32ClockFreq == AUX_WUC_CLOCK_HIFREQ) ||
236  (ui32ClockFreq == AUX_WUC_CLOCK_LOFREQ));
237 
238  // Set the request
239  HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFREQ) = ui32ClockFreq;
240 }
#define AUX_WUC_CLOCK_LOFREQ
Definition: aux_wuc.h:122
#define AUX_WUC_CLOCK_HIFREQ
Definition: aux_wuc.h:121
#define ASSERT(expr)
Definition: debug.h:73
uint32_t AUXWUCClockStatus ( uint32_t  ui32Clocks)

Get the status of a clock.

Use this function to poll the status of a specific clock in the AUX domain.

Parameters
ui32Clocksis the clock for which to return status.
Returns
Returns the status of the clock as one of two states:
151 {
152  bool bClockStatus;
153  uint32_t ui32ClockRegister;
154 
155  // Check the arguments.
156  ASSERT((ui32Clocks & AUX_WUC_ADI_CLOCK) ||
157  (ui32Clocks & AUX_WUC_OSCCTRL_CLOCK) ||
158  (ui32Clocks & AUX_WUC_TDCIF_CLOCK) ||
159  (ui32Clocks & AUX_WUC_ANAIF_CLOCK) ||
160  (ui32Clocks & AUX_WUC_TIMER_CLOCK) ||
161  (ui32Clocks & AUX_WUC_AIODIO0_CLOCK) ||
162  (ui32Clocks & AUX_WUC_AIODIO1_CLOCK) ||
163  (ui32Clocks & AUX_WUC_SMPH_CLOCK) ||
164  (ui32Clocks & AUX_WUC_TDC_CLOCK) ||
165  (ui32Clocks & AUX_WUC_ADC_CLOCK) ||
166  (ui32Clocks & AUX_WUC_REF_CLOCK));
167 
168  bClockStatus = true;
169 
170  // Read the status registers.
171  ui32ClockRegister = HWREG(AUX_WUC_BASE + AUX_WUC_O_MODCLKEN0);
172 
173  // Check all requested clocks
174  if(ui32Clocks & AUX_WUC_ADI_CLOCK)
175  {
176  bClockStatus = bClockStatus && (ui32ClockRegister &
178  true : false);
179  }
180  if(ui32Clocks & AUX_WUC_OSCCTRL_CLOCK)
181  {
182  bClockStatus = bClockStatus && (ui32ClockRegister &
184  true : false);
185  }
186  if(ui32Clocks & AUX_WUC_TDCIF_CLOCK)
187  {
188  bClockStatus = bClockStatus && (ui32ClockRegister &
190  true : false);
191  }
192  if(ui32Clocks & AUX_WUC_ANAIF_CLOCK)
193  {
194  bClockStatus = bClockStatus && (ui32ClockRegister &
196  true : false);
197  }
198  if(ui32Clocks & AUX_WUC_TIMER_CLOCK)
199  {
200  bClockStatus = bClockStatus && (ui32ClockRegister &
202  true : false);
203  }
204  if(ui32Clocks & AUX_WUC_AIODIO0_CLOCK)
205  {
206  bClockStatus = bClockStatus && (ui32ClockRegister &
208  true : false);
209  }
210  if(ui32Clocks & AUX_WUC_AIODIO1_CLOCK)
211  {
212  bClockStatus = bClockStatus && (ui32ClockRegister &
214  true : false);
215  }
216  if(ui32Clocks & AUX_WUC_SMPH_CLOCK)
217  {
218  bClockStatus = bClockStatus && (ui32ClockRegister &
220  true : false);
221  }
222  if(ui32Clocks & AUX_WUC_ADC_CLOCK)
223  {
224  ui32ClockRegister = HWREG(AUX_WUC_BASE + AUX_WUC_O_ADCCLKCTL);
225  bClockStatus = bClockStatus && (ui32ClockRegister &
227  true : false);
228  }
229  if(ui32Clocks & AUX_WUC_TDC_CLOCK)
230  {
231  ui32ClockRegister = HWREG(AUX_WUC_BASE + AUX_WUC_O_TDCCLKCTL);
232  bClockStatus = bClockStatus && (ui32ClockRegister &
234  true : false);
235  }
236  if(ui32Clocks & AUX_WUC_REF_CLOCK)
237  {
238  ui32ClockRegister = HWREG(AUX_WUC_BASE + AUX_WUC_O_REFCLKCTL);
239  bClockStatus = bClockStatus && (ui32ClockRegister &
241  true : false);
242  }
243 
244  // Return the clock status.
245  return bClockStatus ? AUX_WUC_CLOCK_READY : AUX_WUC_CLOCK_OFF;
246 }
#define AUX_WUC_TDC_CLOCK
Definition: aux_wuc.h:113
#define AUX_WUC_OSCCTRL_CLOCK
Definition: aux_wuc.h:109
#define AUX_WUC_CLOCK_READY
Definition: aux_wuc.h:119
#define AUX_WUC_AIODIO0_CLOCK
Definition: aux_wuc.h:104
#define AUX_WUC_ADI_CLOCK
Definition: aux_wuc.h:110
#define AUX_WUC_AIODIO1_CLOCK
Definition: aux_wuc.h:105
#define AUX_WUC_SMPH_CLOCK
Definition: aux_wuc.h:103
#define ASSERT(expr)
Definition: debug.h:73
#define AUX_WUC_REF_CLOCK
Definition: aux_wuc.h:115
#define AUX_WUC_TDCIF_CLOCK
Definition: aux_wuc.h:108
#define AUX_WUC_ANAIF_CLOCK
Definition: aux_wuc.h:107
#define AUX_WUC_ADC_CLOCK
Definition: aux_wuc.h:114
#define AUX_WUC_CLOCK_OFF
Definition: aux_wuc.h:117
#define AUX_WUC_TIMER_CLOCK
Definition: aux_wuc.h:106
static void AUXWUCFreezeDisable ( void  )
inlinestatic

Unfreeze the AUX IOs.

When restarting the AUX domain after it has entered powerdown mode, the software can regain control of the IOs by setting the IO latches as transparent.

Note
The IOs should not be unfrozen before software has restored the functionality of the IO.
Returns
None
See also
AUXWUCFreezeEnable()
299 {
300  // Set the AUX WUC latches as transparent.
302 }
static void AUXWUCFreezeEnable ( void  )
inlinestatic

Freeze the AUX IOs.

To retain the values of the output IOs during a powerdown of the AUX domain all IO latches in the AUX domain should be frozen in their current state. This ensures that software can regain control of the IOs after a powerdown without the IOs first falling back to the default values (i.e. input and pull-up).

Returns
None
See also
AUXWUCFreezeDisable()
276 {
277  // Set the AUX WUC latches as static.
278  HWREG(AUX_WUC_BASE + AUX_WUC_O_AUXIOLATCH) = 0x0;
279 }
void AUXWUCPowerCtrl ( uint32_t  ui32PowerMode)

Control the power to the AUX domain.

Use this function to set the power mode of the entire AUX domain.

Parameters
ui32PowerModecontrol the desired power mode for the AUX domain. The domain has three different power modes:
Returns
None

Referenced by TrimAfterColdResetWakeupFromShutDown().

255 {
256  // Check the arguments.
257  ASSERT((ui32PowerMode == AUX_WUC_POWER_OFF) ||
258  (ui32PowerMode == AUX_WUC_POWER_DOWN) ||
259  (ui32PowerMode == AUX_WUC_POWER_ACTIVE));
260 
261  // Power on/off.
262  if(ui32PowerMode == AUX_WUC_POWER_OFF)
263  {
266  return;
267  }
268  else
269  {
270  HWREG(AUX_WUC_BASE + AUX_WUC_O_PWROFFREQ) = 0x0;
271  }
272 
273  // Power down/active.
274  if(ui32PowerMode == AUX_WUC_POWER_DOWN)
275  {
278  }
279  else
280  {
281  HWREG(AUX_WUC_BASE + AUX_WUC_O_PWRDWNREQ) = 0x0;
282  }
283 }
#define AUX_WUC_POWER_DOWN
Definition: aux_wuc.h:95
#define AUX_WUC_POWER_OFF
Definition: aux_wuc.h:94
#define ASSERT(expr)
Definition: debug.h:73
#define AUX_WUC_POWER_ACTIVE
Definition: aux_wuc.h:96

Macro Definition Documentation

#define AUX_WUC_ADC_CLOCK   0x00000200
#define AUX_WUC_ADI_CLOCK   (AUX_WUC_MODCLKEN0_AUX_ADI4_EN)
#define AUX_WUC_AIODIO0_CLOCK   (AUX_WUC_MODCLKEN0_AIODIO0_EN)
#define AUX_WUC_AIODIO1_CLOCK   (AUX_WUC_MODCLKEN0_AIODIO1_EN)
#define AUX_WUC_ANAIF_CLOCK   (AUX_WUC_MODCLKEN0_ANAIF_EN)
#define AUX_WUC_CLOCK_HIFREQ   0x00000000

Referenced by AUXWUCClockFreqReq().

#define AUX_WUC_CLOCK_LOFREQ   0x00000001

Referenced by AUXWUCClockFreqReq().

#define AUX_WUC_CLOCK_OFF   0x00000000

Referenced by AUXWUCClockStatus().

#define AUX_WUC_CLOCK_READY   0x00000011

Referenced by AUXWUCClockStatus().

#define AUX_WUC_CLOCK_UNSTABLE   0x00000001
#define AUX_WUC_MODCLK_MASK   0x000000FF
#define AUX_WUC_OSCCTRL_CLOCK   (AUX_WUC_MODCLKEN0_AUX_DDI0_OSC_EN)
#define AUX_WUC_POWER_ACTIVE   0x00000004

Referenced by AUXWUCPowerCtrl().

#define AUX_WUC_POWER_DOWN   0x00000002
#define AUX_WUC_POWER_OFF   0x00000001

Referenced by AUXWUCPowerCtrl().

#define AUX_WUC_REF_CLOCK   0x00000400
#define AUX_WUC_SMPH_CLOCK   (AUX_WUC_MODCLKEN0_SMPH_EN)
#define AUX_WUC_TDC_CLOCK   0x00000100
#define AUX_WUC_TDCIF_CLOCK   (AUX_WUC_MODCLKEN0_TDC_EN)
#define AUX_WUC_TIMER_CLOCK   (AUX_WUC_MODCLKEN0_TIMER_EN)