48 #define SYS_BOARD_OSCOUNT (CKGR_MOR_MOSCXTST(0x8U)) 49 #define SYS_BOARD_PLLAR (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(0x31U) | \ 50 CKGR_PLLAR_PLLACOUNT(0x3fU) | CKGR_PLLAR_DIVA(0x1U)) 51 #define SYS_BOARD_MCKR (PMC_MCKR_PRES_CLK_2 | PMC_MCKR_CSS_PLLA_CLK | (1<<8)) 139 SystemCoreClock *= 2U;
143 SystemCoreClock *= 3U;
167 SystemCoreClock *= 2U;
171 SystemCoreClock *= 3U;
192 SystemCoreClock /= 3U;
#define CKGR_MOR_MOSCSEL
(CKGR_MOR) Main Oscillator Selection
#define PMC
(PMC ) Base Address
#define CKGR_MOR_MOSCRCF_4_MHz
(CKGR_MOR) Fast RC oscillator frequency is at 4 MHz (default)
#define CKGR_MOR_MOSCRCF_Msk
(CKGR_MOR) Main On-Chip RC Oscillator Frequency Selection
#define CHIP_FREQ_CPU_MAX
#define CKGR_PLLAR_MULA_Msk
(CKGR_PLLAR) PLLA Multiplier
#define PMC_MCKR_CSS_SLOW_CLK
(PMC_MCKR) Slow Clock is selected
#define CKGR_MOR_MOSCRCEN
(CKGR_MOR) Main On-Chip RC Oscillator Enable
#define CHIP_FREQ_XTAL_32K
void SystemInit(void)
Setup the microcontroller system. Initialize the System and update the SystemFrequency variable...
#define PMC_SR_MOSCXTS
(PMC_SR) Main Crystal Oscillator Status
void SystemCoreClockUpdate(void)
Updates the SystemCoreClock with current core Clock retrieved from cpu registers. ...
#define CHIP_FREQ_FWS_0
Maximum operating frequency when FWS is 0.
#define PMC_MCKR_PRES_CLK_3
(PMC_MCKR) Selected clock divided by 3
#define CHIP_FREQ_XTAL_12M
#define EEFC_FMR_FWS(value)
#define PMC_MCKR_CSS_MAIN_CLK
(PMC_MCKR) Main Clock is selected
#define CHIP_FREQ_FWS_5
Maximum operating frequency when FWS is 5.
#define CKGR_MOR_MOSCXTEN
(CKGR_MOR) Main Crystal Oscillator Enable
#define CKGR_PLLAR_DIVA_Msk
(CKGR_PLLAR) PLLA Front End Divider
#define CKGR_MOR_MOSCRCF_12_MHz
(CKGR_MOR) Fast RC oscillator frequency is at 12 MHz
#define PMC_SR_LOCKA
(PMC_SR) PLLA Lock Status
void system_init_flash(uint32_t ul_clk)
#define CHIP_FREQ_FWS_3
Maximum operating frequency when FWS is 3.
#define EFC
(EFC ) Base Address
#define PMC_SR_MOSCSELS
(PMC_SR) Main Oscillator Selection Status
#define PMC_SR_MCKRDY
(PMC_SR) Master Clock Status
#define CHIP_FREQ_SLCK_RC
#define CHIP_FREQ_FWS_2
Maximum operating frequency when FWS is 2.
#define CHIP_FREQ_FWS_4
Maximum operating frequency when FWS is 4.
#define PMC_MCKR_CSS_PLLA_CLK
(PMC_MCKR) PLLA Clock is selected
#define SUPC
(SUPC ) Base Address
#define SYS_BOARD_OSCOUNT
#define PMC_MCKR_PRES_Msk
(PMC_MCKR) Processor Clock Prescaler
#define PMC_MCKR_PRES_Pos
#define CKGR_PLLAR_MULA_Pos
#define CKGR_MOR_MOSCRCF_8_MHz
(CKGR_MOR) Fast RC oscillator frequency is at 8 MHz
#define CKGR_PLLAR_DIVA_Pos
#define PMC_MCKR_CSS_Msk
(PMC_MCKR) Master Clock Source Selection
#define CHIP_FREQ_FWS_1
Maximum operating frequency when FWS is 1.
#define CHIP_FREQ_MAINCK_RC_4MHZ
#define SUPC_SR_OSCSEL
(SUPC_SR) 32-kHz Oscillator Selection Status
#define EEFC_FMR_CLOE
(EEFC_FMR) Code Loop Optimization Enable
#define CKGR_MOR_KEY_PASSWD