8 #include PLATFORM_HEADER
29 GPIO_DBGCFG &= ~GPIO_EXTREGEN;
35 #ifndef DISABLE_WATCHDOG
52 OSC24M_CTRL = OSC24M_CTRL_RESET;
53 CPU_CLKSEL = CPU_CLKSEL_RESET;
55 SCS_AIRCR = (0x05FA0000 | SCS_AIRCR_SYSRESETREQ);
73 static uint16_t seed0 = 0xbeef;
74 static uint16_t seed1 = 0xface;
78 seed0 = (uint16_t) seed;
81 seed1 = (uint16_t) (seed >> 16);
86 static uint16_t shift(uint16_t *val, uint16_t taps)
88 uint16_t newVal = *val;
98 return (shift(&seed0, 0x0062)
99 ^ shift(&seed1, 0x100B));
102 void halCommonMemCopy(
void *dest,
const void *source, uint8_t bytes)
104 memcpy(dest, source, bytes);
107 int8_t halCommonMemCompare(
const void *source0,
const void *source1, uint8_t bytes)
109 return memcmp(source0, source1, bytes);
112 void halCommonMemSet(
void *dest, uint8_t val, uint16_t bytes)
114 memset(dest, val, bytes);
118 typedef struct appSwitchStruct {
126 } appSwitchStructType;
128 static appSwitchStructType *appSwitch = (appSwitchStructType *) RAM_BOTTOM;
133 uint8_t cut = *(
volatile uint8_t *) 0x08040798;
134 if (!( (halFixedAddressTable.baseTable.type == FIXED_ADDRESS_TABLE_TYPE) &&
135 ( ( (halFixedAddressTable.baseTable.version & FAT_MAJOR_VERSION_MASK)
137 (halFixedAddressTable.baseTable.version == 0x0003)
138 ) && (cut >= 2) && (cut <= 3)))
145 appSwitch->param.panID = panID;
151 appSwitch->mode = mode;
IAP bootloader specific definitions.
void halCommonCalibratePads(void)
Calibrates the GPIO pads.
void halInternalCalibrateFastRc(void)
Calibrates the internal FastRC to generate a 12Mhz clock.
#define IAP_BOOTLOADER_MODE_UART
IAP bootloader uart mode.
void halPowerUp(void)
Powers up microcontroller peripherals and board peripherals.
void halInternalEnableWatchDog(void)
Enables the watchdog timer.
Utility and convenience functions for STM32W108 microcontroller, common to both the full and minimal ...
uint16_t halCommonGetRandom(void)
Runs a standard LFSR to generate pseudorandom numbers.
void halCommonSeedRandom(uint32_t seed)
Seeds the halCommonGetRandom() pseudorandom number generator.
void halPowerDown(void)
Powers down microcontroller peripherals and board peripherals.
void halBoardPowerDown(void)
Perform board specific action to power down the system, usually before going to deep sleep...
void halInternalSetRegTrim(boolean boostMode)
Sets the trim values for the 1.8V and 1.2V regulators based upon manufacturing configuration.
void halReboot(void)
Restarts the microcontroller and therefore everything else.
void halInternalSwitchToXtal(void)
Switches to running off of the 24MHz crystal, including changing the CPU to be 24MHz (FCLK sourced fr...
#define IAP_BOOTLOADER_APP_SWITCH_SIGNATURE
Signature used for switch to application.
Header for A/D converter.
Minimal Hal functions common across all microcontroller-specific files.
STM32W108 series memory map definitions used by the full hal.
#define IAP_BOOTLOADER_MODE_OTA
IAP bootloader OTA mode.
#define INTERRUPTS_OFF()
Disable global interrupts without regard to the current or previous state.
void halBoardInit(void)
Initialize the board description data structure after autodetect of the boards based on the CIB Board...
void halBoardPowerUp(void)
Perform board specific action to power up the system.
void halInit(void)
Initializes microcontroller-specific peripherals.
#define FALSE
An alias for zero, used for clarity.
uint16_t halInternalStartSystemTimer(void)
Initializes the system tick.
Header file for system_timer APIs.
#define IAP_BOOTLOADER_DEFAULT_CHANNEL
Radio default channel for OTA bootloader.
StStatus halBootloaderStart(uint8_t mode, uint8_t channel, uint16_t panId)
Request the appplication to enter in bootloader mode.