cpu/cc26x0: implement setuptrimdevice function for cc26x0
This commit is contained in:
parent
30575f9db8
commit
b8a8875086
@ -21,6 +21,7 @@
|
|||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/init.h"
|
#include "periph/init.h"
|
||||||
#include "stdio_base.h"
|
#include "stdio_base.h"
|
||||||
|
#include "vendor/driverlib/setup.h"
|
||||||
|
|
||||||
#ifndef HF_CLOCK_SOURCE
|
#ifndef HF_CLOCK_SOURCE
|
||||||
#define HF_CLOCK_SOURCE DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_RCOSC /* set 48MHz RCOSC */
|
#define HF_CLOCK_SOURCE DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_RCOSC /* set 48MHz RCOSC */
|
||||||
@ -29,11 +30,6 @@
|
|||||||
#define LF_CLOCK_SOURCE DDI_0_OSC_CTL0_SCLK_LF_SRC_SEL_HF_RCOSC /* set 31.25kHz derived from 48MHz RCOSC */
|
#define LF_CLOCK_SOURCE DDI_0_OSC_CTL0_SCLK_LF_SRC_SEL_HF_RCOSC /* set 31.25kHz derived from 48MHz RCOSC */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Configure the MCU system clock
|
|
||||||
*/
|
|
||||||
static void cpu_clock_init(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the CPU, set IRQ priorities
|
* @brief Initialize the CPU, set IRQ priorities
|
||||||
*/
|
*/
|
||||||
@ -42,21 +38,12 @@ void cpu_init(void)
|
|||||||
/* initialize the Cortex-M core */
|
/* initialize the Cortex-M core */
|
||||||
cortexm_init();
|
cortexm_init();
|
||||||
|
|
||||||
/* initialize the system clock */
|
/* Final trim of device */
|
||||||
cpu_clock_init();
|
SetupTrimDevice();
|
||||||
|
|
||||||
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
|
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
|
||||||
stdio_init();
|
stdio_init();
|
||||||
|
|
||||||
/* trigger static peripheral initialization */
|
/* trigger static peripheral initialization */
|
||||||
periph_init();
|
periph_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_clock_init(void)
|
|
||||||
{
|
|
||||||
AON_WUC->AUXCTL |= AUXCTL_AUX_FORCE_ON; /* power on AUX_PD */
|
|
||||||
while(!(AON_WUC->PWRSTAT & PWRSTAT_AUX_PD_ON)); /* wait for AUX_PD to be powered on */
|
|
||||||
AUX_WUC->MODCLKEN0 |= MODCLKEN0_AUX_DDI0_OSC_EN; /* turn on oscillator interface clock */
|
|
||||||
|
|
||||||
DDI_0_OSC->CTL0 |= HF_CLOCK_SOURCE | LF_CLOCK_SOURCE; /* configure HF and LF clocks */
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user