CC26xx Driver Library
prcm.c
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: prcm.c
3 * Revised: 2016-08-15 10:30:38 +0200 (Mon, 15 Aug 2016)
4 * Revision: 47006
5 *
6 * Description: Driver for the PRCM.
7 *
8 * Copyright (c) 2015 - 2016, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 #include <driverlib/prcm.h>
40 
41 //*****************************************************************************
42 //
43 // Handle support for DriverLib in ROM:
44 // This section will undo prototype renaming made in the header file
45 //
46 //*****************************************************************************
47 #if !defined(DOXYGEN)
48  #undef PRCMInfClockConfigureSet
49  #define PRCMInfClockConfigureSet NOROM_PRCMInfClockConfigureSet
50  #undef PRCMInfClockConfigureGet
51  #define PRCMInfClockConfigureGet NOROM_PRCMInfClockConfigureGet
52  #undef PRCMAudioClockConfigSet
53  #define PRCMAudioClockConfigSet NOROM_PRCMAudioClockConfigSet
54  #undef PRCMAudioClockConfigSetOverride
55  #define PRCMAudioClockConfigSetOverride NOROM_PRCMAudioClockConfigSetOverride
56  #undef PRCMPowerDomainOn
57  #define PRCMPowerDomainOn NOROM_PRCMPowerDomainOn
58  #undef PRCMPowerDomainOff
59  #define PRCMPowerDomainOff NOROM_PRCMPowerDomainOff
60  #undef PRCMPeripheralRunEnable
61  #define PRCMPeripheralRunEnable NOROM_PRCMPeripheralRunEnable
62  #undef PRCMPeripheralRunDisable
63  #define PRCMPeripheralRunDisable NOROM_PRCMPeripheralRunDisable
64  #undef PRCMPeripheralSleepEnable
65  #define PRCMPeripheralSleepEnable NOROM_PRCMPeripheralSleepEnable
66  #undef PRCMPeripheralSleepDisable
67  #define PRCMPeripheralSleepDisable NOROM_PRCMPeripheralSleepDisable
68  #undef PRCMPeripheralDeepSleepEnable
69  #define PRCMPeripheralDeepSleepEnable NOROM_PRCMPeripheralDeepSleepEnable
70  #undef PRCMPeripheralDeepSleepDisable
71  #define PRCMPeripheralDeepSleepDisable NOROM_PRCMPeripheralDeepSleepDisable
72  #undef PRCMPowerDomainStatus
73  #define PRCMPowerDomainStatus NOROM_PRCMPowerDomainStatus
74  #undef PRCMDeepSleep
75  #define PRCMDeepSleep NOROM_PRCMDeepSleep
76 #endif
77 
78 
79 //*****************************************************************************
80 //
81 // Arrays that maps the "peripheral set" number (which is stored in the
82 // third nibble of the PRCM_PERIPH_* defines) to the PRCM register that
83 // contains the relevant bit for that peripheral.
84 //
85 //*****************************************************************************
86 
87 // Run mode registers
88 static const uint32_t g_pui32RCGCRegs[] =
89 {
97 };
98 
99 // Sleep mode registers
100 static const uint32_t g_pui32SCGCRegs[] =
101 {
109 };
110 
111 // Deep sleep mode registers
112 static const uint32_t g_pui32DCGCRegs[] =
113 {
121 };
122 
123 //*****************************************************************************
124 //
125 // This macro extracts the array index out of the peripheral number
126 //
127 //*****************************************************************************
128 #define PRCM_PERIPH_INDEX(a) (((a) >> 8) & 0xf)
129 
130 //*****************************************************************************
131 //
132 // This macro extracts the peripheral instance number and generates bit mask
133 //
134 //*****************************************************************************
135 #define PRCM_PERIPH_MASKBIT(a) (0x00000001 << ((a) & 0xf))
136 
137 
138 //*****************************************************************************
139 //
141 //
142 //*****************************************************************************
143 void
144 PRCMInfClockConfigureSet(uint32_t ui32ClkDiv, uint32_t ui32PowerMode)
145 {
146  uint32_t ui32Divisor;
147 
148  //
149  // Check the arguments.
150  //
151  ASSERT((ui32ClkDiv == PRCM_CLOCK_DIV_1) ||
152  (ui32ClkDiv == PRCM_CLOCK_DIV_2) ||
153  (ui32ClkDiv == PRCM_CLOCK_DIV_8) ||
154  (ui32ClkDiv == PRCM_CLOCK_DIV_32));
155  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
156  (ui32PowerMode == PRCM_SLEEP_MODE) ||
157  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
158 
159  ui32Divisor = 0;
160 
161  //
162  // Find the correct division factor.
163  //
164  if(ui32ClkDiv == PRCM_CLOCK_DIV_1)
165  {
166  ui32Divisor = 0x0;
167  }
168  else if(ui32ClkDiv == PRCM_CLOCK_DIV_2)
169  {
170  ui32Divisor = 0x1;
171  }
172  else if(ui32ClkDiv == PRCM_CLOCK_DIV_8)
173  {
174  ui32Divisor = 0x2;
175  }
176  else if(ui32ClkDiv == PRCM_CLOCK_DIV_32)
177  {
178  ui32Divisor = 0x3;
179  }
180 
181  //
182  // Determine the correct power mode set the division factor accordingly.
183  //
184  if(ui32PowerMode == PRCM_RUN_MODE)
185  {
186  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVR) = ui32Divisor;
187  }
188  else if(ui32PowerMode == PRCM_SLEEP_MODE)
189  {
190  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVS) = ui32Divisor;
191  }
192  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
193  {
194  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVDS) = ui32Divisor;
195  }
196 }
197 
198 //*****************************************************************************
199 //
201 //
202 //*****************************************************************************
203 uint32_t
204 PRCMInfClockConfigureGet(uint32_t ui32PowerMode)
205 {
206  uint32_t ui32ClkDiv;
207  uint32_t ui32Divisor;
208 
209  //
210  // Check the arguments.
211  //
212  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
213  (ui32PowerMode == PRCM_SLEEP_MODE) ||
214  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
215 
216  ui32ClkDiv = 0;
217  ui32Divisor = 0;
218 
219  //
220  // Determine the correct power mode.
221  //
222  if(ui32PowerMode == PRCM_RUN_MODE)
223  {
224  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVR);
225  }
226  else if(ui32PowerMode == PRCM_SLEEP_MODE)
227  {
228  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVS);
229  }
230  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
231  {
232  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVDS);
233  }
234 
235  //
236  // Find the correct division factor.
237  //
238  if(ui32ClkDiv == 0x0)
239  {
240  ui32Divisor = PRCM_CLOCK_DIV_1;
241  }
242  else if(ui32ClkDiv == 0x1)
243  {
244  ui32Divisor = PRCM_CLOCK_DIV_2;
245  }
246  else if(ui32ClkDiv == 0x2)
247  {
248  ui32Divisor = PRCM_CLOCK_DIV_8;
249  }
250  else if(ui32ClkDiv == 0x3)
251  {
252  ui32Divisor = PRCM_CLOCK_DIV_32;
253  }
254 
255  //
256  // Return the clock division factor.
257  //
258  return ui32Divisor;
259 }
260 
261 
262 //*****************************************************************************
263 //
265 //
266 //*****************************************************************************
267 void
268 PRCMAudioClockConfigSet(uint32_t ui32ClkConfig, uint32_t ui32SampleRate)
269 {
270  uint32_t ui32Reg;
271  uint32_t ui32MstDiv;
272  uint32_t ui32BitDiv;
273  uint32_t ui32WordDiv;
274 
275  //
276  // Check the arguments.
277  //
279  ASSERT((ui32SampleRate == I2S_SAMPLE_RATE_16K) ||
280  (ui32SampleRate == I2S_SAMPLE_RATE_24K) ||
281  (ui32SampleRate == I2S_SAMPLE_RATE_32K) ||
282  (ui32SampleRate == I2S_SAMPLE_RATE_48K));
283 
284  ui32MstDiv = 0;
285  ui32BitDiv = 0;
286  ui32WordDiv = 0;
287 
288  //
289  // Make sure the audio clock generation is disabled before reconfiguring.
290  //
292 
293  //
294  // Define the clock division factors for the audio interface.
295  //
296  switch(ui32SampleRate)
297  {
298  case I2S_SAMPLE_RATE_16K :
299  ui32MstDiv = 6;
300  ui32BitDiv = 60;
301  ui32WordDiv = 25;
302  break;
303  case I2S_SAMPLE_RATE_24K :
304  ui32MstDiv = 4;
305  ui32BitDiv = 40;
306  ui32WordDiv = 25;
307  break;
308  case I2S_SAMPLE_RATE_32K :
309  ui32MstDiv = 3;
310  ui32BitDiv = 30;
311  ui32WordDiv = 25;
312  break;
313  case I2S_SAMPLE_RATE_48K :
314  ui32MstDiv = 2;
315  ui32BitDiv = 20;
316  ui32WordDiv = 25;
317  break;
318  }
319 
320  //
321  // Make sure to compensate the Frame clock division factor if using single
322  // phase format.
323  //
324  if((ui32ClkConfig & PRCM_I2SCLKCTL_WCLK_PHASE_M) == PRCM_WCLK_SINGLE_PHASE)
325  {
326  ui32WordDiv -= 1;
327  }
328 
329  //
330  // Write the clock division factors.
331  //
332  HWREG(PRCM_BASE + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
333  HWREG(PRCM_BASE + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
334  HWREG(PRCM_BASE + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
335 
336  //
337  // Configure the Word clock format and polarity.
338  //
341  HWREG(PRCM_BASE + PRCM_O_I2SCLKCTL) = ui32Reg | ui32ClkConfig;
342 }
343 
344 //*****************************************************************************
345 //
347 //
348 //*****************************************************************************
349 void
350 PRCMAudioClockConfigSetOverride(uint32_t ui32ClkConfig, uint32_t ui32MstDiv,
351  uint32_t ui32BitDiv, uint32_t ui32WordDiv)
352 {
353  uint32_t ui32Reg;
354 
355  //
356  // Check the arguments.
357  //
359 
360  //
361  // Make sure the audio clock generation is disabled before reconfiguring.
362  //
364 
365  //
366  // Make sure to compensate the Frame clock division factor if using single
367  // phase format.
368  //
369  if((ui32ClkConfig & PRCM_I2SCLKCTL_WCLK_PHASE_M) == PRCM_WCLK_SINGLE_PHASE)
370  {
371  ui32WordDiv -= 1;
372  }
373 
374  //
375  // Write the clock division factors.
376  //
377  HWREG(PRCM_BASE + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
378  HWREG(PRCM_BASE + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
379  HWREG(PRCM_BASE + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
380 
381  //
382  // Configure the Word clock format and polarity.
383  //
386  HWREG(PRCM_BASE + PRCM_O_I2SCLKCTL) = ui32Reg | ui32ClkConfig;
387 }
388 
389 //*****************************************************************************
390 //
392 //
393 //*****************************************************************************
394 void
395 PRCMPowerDomainOn(uint32_t ui32Domains)
396 {
397  //
398  // Check the arguments.
399  //
400  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
401  (ui32Domains & PRCM_DOMAIN_SERIAL) ||
402  (ui32Domains & PRCM_DOMAIN_PERIPH) ||
403  (ui32Domains & PRCM_DOMAIN_CPU) ||
404  (ui32Domains & PRCM_DOMAIN_VIMS));
405 
406  //
407  // Assert the request to power on the right domains.
408  //
409  if(ui32Domains & PRCM_DOMAIN_RFCORE)
410  {
411  HWREG(PRCM_BASE + PRCM_O_PDCTL0RFC ) = 1;
412  HWREG(PRCM_BASE + PRCM_O_PDCTL1RFC ) = 1;
413  }
414  if(ui32Domains & PRCM_DOMAIN_SERIAL)
415  {
416  HWREG(PRCM_BASE + PRCM_O_PDCTL0SERIAL) = 1;
417  }
418  if(ui32Domains & PRCM_DOMAIN_PERIPH)
419  {
420  HWREG(PRCM_BASE + PRCM_O_PDCTL0PERIPH) = 1;
421  }
422  if(ui32Domains & PRCM_DOMAIN_VIMS)
423  {
424  HWREG(PRCM_BASE + PRCM_O_PDCTL1VIMS ) = 1;
425  }
426  if(ui32Domains & PRCM_DOMAIN_CPU)
427  {
428  HWREG(PRCM_BASE + PRCM_O_PDCTL1CPU ) = 1;
429  }
430 }
431 
432 //*****************************************************************************
433 //
435 //
436 //*****************************************************************************
437 void
438 PRCMPowerDomainOff(uint32_t ui32Domains)
439 {
440  //
441  // Check the arguments.
442  //
443  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
444  (ui32Domains & PRCM_DOMAIN_SERIAL) ||
445  (ui32Domains & PRCM_DOMAIN_PERIPH) ||
446  (ui32Domains & PRCM_DOMAIN_CPU) ||
447  (ui32Domains & PRCM_DOMAIN_VIMS));
448 
449  //
450  // Assert the request to power off the right domains.
451  //
452  if(ui32Domains & PRCM_DOMAIN_RFCORE)
453  {
454  HWREG(PRCM_BASE + PRCM_O_PDCTL0RFC ) = 0;
455  HWREG(PRCM_BASE + PRCM_O_PDCTL1RFC ) = 0;
456  }
457  if(ui32Domains & PRCM_DOMAIN_SERIAL)
458  {
459  HWREG(PRCM_BASE + PRCM_O_PDCTL0SERIAL) = 0;
460  }
461  if(ui32Domains & PRCM_DOMAIN_PERIPH)
462  {
463  HWREG(PRCM_BASE + PRCM_O_PDCTL0PERIPH) = 0;
464  }
465  if(ui32Domains & PRCM_DOMAIN_VIMS)
466  {
467  HWREG(PRCM_BASE + PRCM_O_PDCTL1VIMS ) = 0;
468  }
469  if(ui32Domains & PRCM_DOMAIN_CPU)
470  {
471  HWREG(PRCM_BASE + PRCM_O_PDCTL1CPU ) = 0;
472  }
473 }
474 
475 //*****************************************************************************
476 //
478 //
479 //*****************************************************************************
480 void
481 PRCMPeripheralRunEnable(uint32_t ui32Peripheral)
482 {
483  //
484  // Check the arguments.
485  //
486  ASSERT(PRCMPeripheralValid(ui32Peripheral));
487 
488  //
489  // Enable module in Run Mode.
490  //
491  HWREG(PRCM_BASE + g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
492  PRCM_PERIPH_MASKBIT(ui32Peripheral);
493 }
494 
495 //*****************************************************************************
496 //
498 //
499 //*****************************************************************************
500 void
501 PRCMPeripheralRunDisable(uint32_t ui32Peripheral)
502 {
503  //
504  // Check the arguments.
505  //
506  ASSERT(PRCMPeripheralValid(ui32Peripheral));
507 
508  //
509  // Disable module in Run Mode.
510  //
511  HWREG(PRCM_BASE + g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
512  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
513 }
514 
515 //*****************************************************************************
516 //
518 //
519 //*****************************************************************************
520 void
521 PRCMPeripheralSleepEnable(uint32_t ui32Peripheral)
522 {
523  //
524  // Check the arguments.
525  //
526  ASSERT(PRCMPeripheralValid(ui32Peripheral));
527 
528  //
529  // Enable this peripheral in sleep mode.
530  //
531  HWREG(PRCM_BASE + g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
532  PRCM_PERIPH_MASKBIT(ui32Peripheral);
533 }
534 
535 //*****************************************************************************
536 //
538 //
539 //*****************************************************************************
540 void
541 PRCMPeripheralSleepDisable(uint32_t ui32Peripheral)
542 {
543  //
544  // Check the arguments.
545  //
546  ASSERT(PRCMPeripheralValid(ui32Peripheral));
547 
548  //
549  // Disable this peripheral in sleep mode
550  //
551  HWREG(PRCM_BASE + g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
552  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
553 }
554 
555 //*****************************************************************************
556 //
558 //
559 //*****************************************************************************
560 void
561 PRCMPeripheralDeepSleepEnable(uint32_t ui32Peripheral)
562 {
563  //
564  // Check the arguments.
565  //
566  ASSERT(PRCMPeripheralValid(ui32Peripheral));
567 
568  //
569  // Enable this peripheral in deep-sleep mode.
570  //
571  HWREG(PRCM_BASE + g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
572  PRCM_PERIPH_MASKBIT(ui32Peripheral);
573 }
574 
575 //*****************************************************************************
576 //
578 //
579 //*****************************************************************************
580 void
581 PRCMPeripheralDeepSleepDisable(uint32_t ui32Peripheral)
582 {
583  //
584  // Check the arguments.
585  //
586  ASSERT(PRCMPeripheralValid(ui32Peripheral));
587 
588  //
589  // Disable this peripheral in Deep Sleep mode.
590  //
591  HWREG(PRCM_BASE + g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
592  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
593 }
594 
595 //*****************************************************************************
596 //
598 //
599 //*****************************************************************************
600 uint32_t
601 PRCMPowerDomainStatus(uint32_t ui32Domains)
602 {
603  bool bStatus;
604  uint32_t ui32StatusRegister0;
605  uint32_t ui32StatusRegister1;
606 
607  //
608  // Check the arguments.
609  //
610  ASSERT((ui32Domains & (PRCM_DOMAIN_RFCORE |
613 
614  bStatus = true;
615  ui32StatusRegister0 = HWREG(PRCM_BASE + PRCM_O_PDSTAT0);
616  ui32StatusRegister1 = HWREG(PRCM_BASE + PRCM_O_PDSTAT1);
617 
618  //
619  // Return the correct power status.
620  //
621  if(ui32Domains & PRCM_DOMAIN_RFCORE)
622  {
623  bStatus = bStatus &&
624  ((ui32StatusRegister0 & PRCM_PDSTAT0_RFC_ON) ||
625  (ui32StatusRegister1 & PRCM_PDSTAT1_RFC_ON));
626  }
627  if(ui32Domains & PRCM_DOMAIN_SERIAL)
628  {
629  bStatus = bStatus && (ui32StatusRegister0 & PRCM_PDSTAT0_SERIAL_ON);
630  }
631  if(ui32Domains & PRCM_DOMAIN_PERIPH)
632  {
633  bStatus = bStatus && (ui32StatusRegister0 & PRCM_PDSTAT0_PERIPH_ON);
634  }
635 
636  //
637  // Return the status.
638  //
639  return (bStatus ? PRCM_DOMAIN_POWER_ON : PRCM_DOMAIN_POWER_OFF);
640 }
641 
642 //*****************************************************************************
643 //
645 //
646 //*****************************************************************************
647 void
649 {
650  //
651  // Enable deep-sleep.
652  //
653  HWREG(NVIC_SYS_CTRL) |= NVIC_SYS_CTRL_SLEEPDEEP;
654 
655  //
656  // Wait for an interrupt.
657  //
658  CPUwfi();
659 
660  //
661  // Disable deep-sleep so that a future sleep will work correctly.
662  //
663  HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
664 }
#define I2S_SAMPLE_RATE_48K
Definition: prcm.h:172
#define I2S_SAMPLE_RATE_16K
Definition: prcm.h:169
static const uint32_t g_pui32RCGCRegs[]
Definition: prcm.c:88
uint32_t PRCMInfClockConfigureGet(uint32_t ui32PowerMode)
Use this function to get the infrastructure clock configuration.
Definition: prcm.c:204
#define I2S_SAMPLE_RATE_24K
Definition: prcm.h:170
#define PRCM_DEEP_SLEEP_MODE
Definition: prcm.h:111
uint32_t PRCMPowerDomainStatus(uint32_t ui32Domains)
Get the status for a specific power domain.
Definition: prcm.c:601
static const uint32_t g_pui32DCGCRegs[]
Definition: prcm.c:112
#define PRCM_CLOCK_DIV_8
Definition: prcm.h:121
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:142
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:165
void PRCMPeripheralSleepEnable(uint32_t ui32Peripheral)
Enables a peripheral in sleep mode.
Definition: prcm.c:521
void PRCMPeripheralSleepDisable(uint32_t ui32Peripheral)
Disables a peripheral in sleep mode.
Definition: prcm.c:541
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:138
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:135
#define I2S_SAMPLE_RATE_32K
Definition: prcm.h:171
void PRCMAudioClockConfigSetOverride(uint32_t ui32ClkConfig, uint32_t ui32MstDiv, uint32_t ui32BitDiv, uint32_t ui32WordDiv)
Configure the audio clock generation with manual setting of clock divider.
Definition: prcm.c:350
#define PRCM_CLOCK_DIV_32
Definition: prcm.h:123
static void CPUwfi(void)
Wait for interrupt.
Definition: cpu.h:165
static const uint32_t g_pui32SCGCRegs[]
Definition: prcm.c:100
#define ASSERT(expr)
Definition: debug.h:74
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:128
#define PRCM_SLEEP_MODE
Definition: prcm.h:110
void PRCMDeepSleep(void)
Put the processor into deep-sleep mode.
Definition: prcm.c:648
#define PRCM_CLOCK_DIV_1
Definition: prcm.h:118
void PRCMInfClockConfigureSet(uint32_t ui32ClkDiv, uint32_t ui32PowerMode)
Configure the infrastructure clock.
Definition: prcm.c:144
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:153
void PRCMPowerDomainOn(uint32_t ui32Domains)
Turn power on in power domains in the MCU domain.
Definition: prcm.c:395
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:136
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:134
void PRCMPeripheralRunDisable(uint32_t ui32Peripheral)
Disables a peripheral in Run mode.
Definition: prcm.c:501
#define PRCM_CLOCK_DIV_2
Definition: prcm.h:119
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:458
#define PRCM_DOMAIN_CPU
Definition: prcm.h:144
void PRCMPeripheralRunEnable(uint32_t ui32Peripheral)
Enables a peripheral in Run mode.
Definition: prcm.c:481
void PRCMPeripheralDeepSleepEnable(uint32_t ui32Peripheral)
Enables a peripheral in deep-sleep mode.
Definition: prcm.c:561
void PRCMPowerDomainOff(uint32_t ui32Domains)
Turn off a specific power domain.
Definition: prcm.c:438
void PRCMPeripheralDeepSleepDisable(uint32_t ui32Peripheral)
Disables a peripheral in deep-sleep mode.
Definition: prcm.c:581
void PRCMAudioClockConfigSet(uint32_t ui32ClkConfig, uint32_t ui32SampleRate)
Configure the audio clock generation.
Definition: prcm.c:268
#define PRCM_DOMAIN_POWER_OFF
Definition: prcm.h:152
#define PRCM_RUN_MODE
Definition: prcm.h:109