Contiki 3.x
Macros | Functions
micro-common.h File Reference

Utility and convenience functions for STM32W108 microcontroller, common to both the full and minimal hal. More...

Go to the source code of this file.

Macros

#define PORTA_PIN(y)   (PORTA|y)
 Some registers and variables require indentifying GPIO by a single number instead of the port and pin. More...
 
#define PORTB_PIN(y)   (PORTB|y)
 Some registers and variables require indentifying GPIO by a single number instead of the port and pin. More...
 
#define PORTC_PIN(y)   (PORTC|y)
 Some registers and variables require indentifying GPIO by a single number instead of the port and pin. More...
 
#define PORTx_PIN(x, y)   (x|y)
 Some registers and variables require indentifying GPIO by a single number instead of the port and pin. More...
 

Functions

void halInternalResetWatchDog (void)
 Resets the watchdog timer. More...
 
void halGpioConfig (uint32_t io, uint32_t config)
 Configure an IO pin's operating mode. More...
 
void halGpioSet (uint32_t io, boolean value)
 Set/Clear single GPIO bit. More...
 
void halInternalCalibrateSlowRc (void)
 Calibrates the internal SlowRC to generate a 1024 Hz (1kHz) clock.
 
void halInternalCalibrateFastRc (void)
 Calibrates the internal FastRC to generate a 12Mhz clock.
 
void halInternalSetRegTrim (boolean boostMode)
 Sets the trim values for the 1.8V and 1.2V regulators based upon manufacturing configuration. More...
 
uint16_t stMeasureVddSlow (void)
 Takes a slow ADC measurement of VDD_PADS in millivolts. More...
 
uint16_t stMeasureVddFast (void)
 Takes a fast ADC measurement of VDD_PADS in millivolts. More...
 
void halCommonCalibratePads (void)
 Calibrates the GPIO pads. More...
 
void halCommonCheckXtalBiasTrim (void)
 This function is intended to be called periodically, from the stack and application, to check the XTAL bias trim is within appropriate levels and adjust if not. More...
 
void halInternalSwitchToXtal (void)
 Switches to running off of the 24MHz crystal, including changing the CPU to be 24MHz (FCLK sourced from SYSCLK). More...
 
void halInternalSearchForBiasTrim (void)
 Search for optimal 24MHz crystal bias trim, assuming no valid prior value. More...
 
void halCommonDelayMilliseconds (uint16_t ms)
 Blocks the current thread of execution for the specified amount of time, in milliseconds. More...
 
void halSleepWithOptions (SleepModes sleepMode, uint32_t gpioWakeBitMask)
 Puts the microcontroller to sleep in a specified mode, allows the GPIO wake sources to be determined at runtime. More...
 
StStatus halSleepForQsWithOptions (uint32_t *duration, uint32_t gpioWakeBitMask)
 Uses the system timer to enter ::SLEEPMODE_WAKETIMER for approximately the specified amount of time (provided in quarter seconds), the GPIO wake sources can be provided at runtime. More...
 
void halInternalIdleSleep (void)
 Provides access to assembly code which triggers idle sleep.
 
void halInternalSleep (SleepModes sleepMode)
 Puts the microcontroller to sleep in a specified mode. More...
 
uint32_t halGetWakeInfo (void)
 Obtains the events that caused the last wake from sleep. More...
 
void halCommonSeedRandom (uint32_t seed)
 Seeds the halCommonGetRandom() pseudorandom number generator. More...
 
uint16_t halCommonGetRandom (void)
 Runs a standard LFSR to generate pseudorandom numbers. More...
 

Detailed Description

Utility and convenience functions for STM32W108 microcontroller, common to both the full and minimal hal.

See Micro for documentation.

Definition in file micro-common.h.