brazos-trapezoidal
system_nebo40_64.c
Go to the documentation of this file.
1
34#include <stdint.h>
35#include "nebo40_64.h"
36
37
38/*----------------------------------------------------------------------------
39 DEFINES
40 *----------------------------------------------------------------------------*/
41
42/*----------------------------------------------------------------------------
43 Define clocks
44 *----------------------------------------------------------------------------*/
45/* ToDo: add here your necessary defines for device initialization
46 following is an example for different system frequencies */
47#define __SYSTEM_CLOCK (40000000)
48
49
50/*----------------------------------------------------------------------------
51 Clock Variable definitions
52 *----------------------------------------------------------------------------*/
53/* ToDo: initialize SystemCoreClock with the system core clock frequency value
54 achieved after system intitialization.
55 This means system core clock frequency after call to SystemInit() */
56uint32_t SystemCoreClock = __SYSTEM_CLOCK;
59/*----------------------------------------------------------------------------
60 Clock functions
61 *----------------------------------------------------------------------------*/
62void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
63{
64/* TODO: add code to calculate the system frequency based upon the current
65 register settings.
66 This function can be used to retrieve the system core clock frequeny
67 after user changed register sittings. */
68 SystemCoreClock = __SYSTEM_CLOCK;
69 //return;
70}
71
87unsigned int __attribute ((weak)) SystemInit (void)
88{
89 /* Set the default system frequency to 40MHz clock */
90 CMU->HSOSC_CFG_b.FREQ_SEL = 1;
91 CMU->CFG_b.SYSCLK_SEL = 0;
92 CMU->CFG_b.SYSCLK_DIV = 0;
93
94 /* check if the silicon is out of shutdown */
95 if (PMU->STS_b.SHUTWU == 1)
96 {
97 /* If Nebo has woken from low power mode, then return 1; else return 0 */
98 return (1);
99 }
100
101 return(0);
102}
103
unsigned int __attribute((weak))
Setup the microcontroller system. Initialize the System. This function checks whether the MCU has ini...
uint32_t SystemCoreClock