11 #include PLATFORM_HEADER
14 #include "hal/micro/micro-common.h"
22 WDOG_CFG = WDOG_ENABLE;
35 WDOG_CFG = WDOG_DISABLE;
41 if(WDOG_CFG&WDOG_ENABLE) {
50 static volatile int32u *
const configRegs[] =
51 { (
volatile int32u *)GPIO_PACFGL_ADDR,
52 (
volatile int32u *)GPIO_PACFGH_ADDR,
53 (
volatile int32u *)GPIO_PBCFGL_ADDR,
54 (
volatile int32u *)GPIO_PBCFGH_ADDR,
55 (
volatile int32u *)GPIO_PCCFGL_ADDR,
56 (
volatile int32u *)GPIO_PCCFGH_ADDR };
58 portcfg = *configRegs[io/4];
59 portcfg = portcfg & ~((0xF)<<((io&3)*4));
60 *configRegs[io/4] = portcfg | (config <<((io&3)*4));
67 *((
volatile int32u *)(GPIO_PxSET_BASE+(GPIO_Px_OFFSET*(gpio/8)))) =
BIT(gpio&7);
69 *((
volatile int32u *)(GPIO_PxCLR_BASE+(GPIO_Px_OFFSET*(gpio/8)))) =
BIT(gpio&7);
84 INT_CFGCLR = INT_SLEEPTMR;
87 #ifdef DIGITAL_OSC32_EXT
91 //Enable the 32kHz XTAL (and disable SlowRC since it is not needed)
92 SLEEPTMR_CLKEN = SLEEPTMR_CLK32KEN;
95 SLEEPTMR_CFG = (SLEEPTMR_ENABLE |
96 (0 << SLEEPTMR_DBGPAUSE_BIT)|
97 (5 << SLEEPTMR_CLKDIV_BIT) |
98 (1 << SLEEPTMR_CLKSEL_BIT)) ;
100 //Enable the SlowRC (and disable 32kHz XTAL since it is not needed)
101 SLEEPTMR_CLKEN = SLEEPTMR_CLK10KEN;
102 SLEEPTMR_CFG = (SLEEPTMR_ENABLE |
103 (0 << SLEEPTMR_DBGPAUSE_BIT)|
104 (0 << SLEEPTMR_CLKDIV_BIT) |
105 (0 << SLEEPTMR_CLKSEL_BIT)) ;
106 #ifndef DISABLE_RC_CALIBRATION
108 #endif//DISABLE_RC_CALIBRATION
109 #endif//ENABLE_OSC32K
112 INT_SLEEPTMRFLAG = (INT_SLEEPTMRWRAP | INT_SLEEPTMRCMPA | INT_SLEEPTMRCMPB);
114 INT_SLEEPTMRCFG = INT_SLEEPTMRCFG_RESET;
116 INT_CFGSET = INT_SLEEPTMR;