Common Microcontroller Functions
Data Structures |
|
struct | RTCCRamData |
Macros |
|
#define | halGetEm2xxResetInfo () halGetResetInfo () |
Calls
halGetExtendedResetInfo()
and translates the EM35x or COBRA reset code to the corresponding value used by the EM2XX HAL. Any reset codes not present in the EM2XX are returned after being OR'ed with 0x80.
More...
|
|
#define | MICRO_DISABLE_WATCH_DOG_KEY 0xA5U |
The value that must be passed as the single parameter to
halInternalDisableWatchDog()
in order to successfully disable the watchdog timer.
More...
|
|
#define | GPIO_MASK_SIZE 24 |
#define | GPIO_MASK 0xFFFFFF |
#define | WAKE_GPIO_MASK GPIO_MASK |
#define | WAKE_GPIO_SIZE GPIO_MASK_SIZE |
#define | WAKE_MASK_INVALID (-1) |
#define | WAKE_EVENT_SIZE WakeMask |
#define | DEBUG_TOGGLE (n) |
#define | PTA_SUPPORT |
#define | PTA_GPIOCFG_INPUT GPIOCFG_IN_PUD |
#define | PTA_GPIOCFG_OUTPUT GPIOCFG_OUT |
#define | PTA_GPIOCFG_WIRED_OR GPIOCFG_OUT_OD |
#define | PTA_GPIOCFG_WIRED_AND GPIOCFG_OUT_OD |
Typedefs |
|
typedef uint32_t | WakeEvents |
typedef uint32_t | WakeMask |
Enumerations |
|
enum |
SleepModes
{
SLEEPMODE_RUNNING = 0U, SLEEPMODE_IDLE = 1U, SLEEPMODE_WAKETIMER = 2U, SLEEPMODE_MAINTAINTIMER = 3U, SLEEPMODE_NOTIMER = 4U, SLEEPMODE_HIBERNATE = 5U, SLEEPMODE_RESERVED = 6U, SLEEPMODE_POWERDOWN = 7U, SLEEPMODE_POWERSAVE = 8U } |
Enumerations for the possible microcontroller sleep modes.
More...
|
|
Functions |
|
void | halStackProcessBootCount (void) |
Called from emberInit and provides a means for the HAL to increment a boot counter, most commonly in non-volatile memory.
More...
|
|
uint8_t | halGetResetInfo (void) |
Gets information about what caused the microcontroller to reset.
More...
|
|
PGM_P | halGetResetString (void) |
Calls
halGetResetInfo()
and supplies a string describing it.
More...
|
|
void | halInit (void) |
Initializes microcontroller-specific peripherals.
More...
|
|
void | halReboot (void) |
Restarts the microcontroller and therefore everything else.
More...
|
|
void | halPowerUp (void) |
Powers up microcontroller peripherals and board peripherals.
More...
|
|
void | halPowerDown (void) |
Powers down microcontroller peripherals and board peripherals.
More...
|
|
void | halResume (void) |
Resumes microcontroller peripherals and board peripherals.
More...
|
|
void | halSuspend (void) |
Suspends microcontroller peripherals and board peripherals.
More...
|
|
void | halInternalEnableWatchDog (void) |
Enables the watchdog timer.
More...
|
|
void | halInternalDisableWatchDog (uint8_t magicKey) |
Disables the watchdog timer.
More...
|
|
bool | halInternalWatchDogEnabled (void) |
Determines whether the watchdog has been enabled or disabled.
More...
|
|
void | halSleep ( SleepModes sleepMode) |
Puts the microcontroller to sleep in a specified mode.
More...
|
|
void | halCommonDelayMicroseconds (uint16_t us) |
Blocks the current thread of execution for the specified amount of time, in microseconds.
More...
|
|
void | halCommonDisableVreg1v8 (void) |
Disable the 1.8V regulator. This function is to be used when the 1.8V supply is provided externally. Disabling the regulator saves current consumption. Disabling the regulator will cause ADC readings of external signals to be wrong. These exteranl signals include analog sources ADC0 thru ADC5 and VDD_PADS/4.
More...
|
|
void | halCommonEnableVreg1v8 (void) |
Enable the 1.8V regulator. Normally the 1.8V regulator is enabled out of reset. This function is only needed if the 1.8V regulator has been disabled and ADC conversions on external signals are needed. These exteranl signals include analog sources ADC0 thru ADC5 and VDD_PADS/4. The state of 1v8 survives deep sleep.
More...
|
|
void | halBeforeEM4 (uint32_t duration, RTCCRamData input) |
RTCCRamData | halAfterEM4 (void) |
void | halInternalSysReset (uint16_t extendedCause) |
Records the specified reset cause then forces a reboot.
More...
|
|
uint16_t | halGetExtendedResetInfo (void) |
Returns the Extended Reset Cause information.
More...
|
|
PGM_P | halGetExtendedResetString (void) |
Calls
halGetExtendedResetInfo()
and supplies a string describing the extended cause of the reset.
halGetResetString()
should also be called to get the string for the base reset cause.
More...
|
|
EmberStatus | halSetRadioHoldOff (bool enable) |
Enables or disables Radio HoldOff support.
More...
|
|
bool | halGetRadioHoldOff (void) |
Returns whether Radio HoldOff has been enabled or not.
More...
|
|
void | halStackRadioPowerDownBoard (void) |
To assist with saving power when the radio automatically powers down, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerdown state. The pin state used is the state used by halInternalPowerDownBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function is often called from interrupt context.
More...
|
|
void | halStackRadio2PowerDownBoard (void) |
To assist with saving power when radio2 automatically powers down, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerdown state. The pin state used is the state used by halInternalPowerDownBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function is often called from interrupt context.
More...
|
|
void | halStackRadioPowerUpBoard (void) |
To assist with saving power when the radio automatically powers up, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerup state. The pin state used is the state used by halInternalPowerUpBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function can be called from interrupt context.
More...
|
|
void | halStackRadio2PowerUpBoard (void) |
To assist with saving power when radio2 automatically powers up, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerup state. The pin state used is the state used by halInternalPowerUpBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function can be called from interrupt context.
More...
|
|
void | halStackRadioPowerMainControl (bool powerUp) |
This function is called automatically by the stack prior to Radio power-up and after Radio power-down. It can be used to prepare for the radio being powered on and to clean up after it's been powered off. Unlike
halStackRadioPowerUpBoard()
and
halStackRadioPowerDownBoard()
, which can be called from interrupt context, this function is only called from main-line context.
More...
|
|
void | halRadioPowerUpHandler (void) |
Handler called in main context prior to radio being powered on.
More...
|
|
void | halRadioPowerDownHandler (void) |
Handler called in main context after radio has been powered off.
More...
|
|
Variables |
|
volatile int8_t | halCommonVreg1v8EnableCount |
Helper variable to track the state of 1.8V regulator.
More...
|
|
Vector Table Index Definitions |
|
These are numerical definitions for vector table. Indices 0 through 15 are Cortex-M3 standard exception vectors and indices 16 through 35 are EM3XX specific interrupt vectors. |
|
#define | STACK_VECTOR_INDEX 0U |
A numerical definition for a vector.
More...
|
|
#define | RESET_VECTOR_INDEX 1U |
A numerical definition for a vector.
More...
|
|
#define | NMI_VECTOR_INDEX 2U |
A numerical definition for a vector.
More...
|
|
#define | HARD_FAULT_VECTOR_INDEX 3U |
A numerical definition for a vector.
More...
|
|
#define | MEMORY_FAULT_VECTOR_INDEX 4U |
A numerical definition for a vector.
More...
|
|
#define | BUS_FAULT_VECTOR_INDEX 5U |
A numerical definition for a vector.
More...
|
|
#define | USAGE_FAULT_VECTOR_INDEX 6U |
A numerical definition for a vector.
More...
|
|
#define | RESERVED07_VECTOR_INDEX 7U |
A numerical definition for a vector.
More...
|
|
#define | RESERVED08_VECTOR_INDEX 8U |
A numerical definition for a vector.
More...
|
|
#define | RESERVED09_VECTOR_INDEX 9U |
A numerical definition for a vector.
More...
|
|
#define | RESERVED10_VECTOR_INDEX 10U |
A numerical definition for a vector.
More...
|
|
#define | SVCALL_VECTOR_INDEX 11U |
A numerical definition for a vector.
More...
|
|
#define | DEBUG_MONITOR_VECTOR_INDEX 12U |
A numerical definition for a vector.
More...
|
|
#define | RESERVED13_VECTOR_INDEX 13U |
A numerical definition for a vector.
More...
|
|
#define | PENDSV_VECTOR_INDEX 14U |
A numerical definition for a vector.
More...
|
|
#define | SYSTICK_VECTOR_INDEX 15U |
A numerical definition for a vector.
More...
|
|
#define | TIMER1_VECTOR_INDEX 16U |
A numerical definition for a vector.
More...
|
|
#define | TIMER2_VECTOR_INDEX 17U |
A numerical definition for a vector.
More...
|
|
#define | MANAGEMENT_VECTOR_INDEX 18U |
A numerical definition for a vector.
More...
|
|
#define | BASEBAND_VECTOR_INDEX 19U |
A numerical definition for a vector.
More...
|
|
#define | SLEEP_TIMER_VECTOR_INDEX 20U |
A numerical definition for a vector.
More...
|
|
#define | SC1_VECTOR_INDEX 21U |
A numerical definition for a vector.
More...
|
|
#define | SC2_VECTOR_INDEX 22U |
A numerical definition for a vector.
More...
|
|
#define | SECURITY_VECTOR_INDEX 23U |
A numerical definition for a vector.
More...
|
|
#define | MAC_TIMER_VECTOR_INDEX 24U |
A numerical definition for a vector.
More...
|
|
#define | MAC_TX_VECTOR_INDEX 25U |
A numerical definition for a vector.
More...
|
|
#define | MAC_RX_VECTOR_INDEX 26U |
A numerical definition for a vector.
More...
|
|
#define | ADC_VECTOR_INDEX 27U |
A numerical definition for a vector.
More...
|
|
#define | IRQA_VECTOR_INDEX 28U |
A numerical definition for a vector.
More...
|
|
#define | IRQB_VECTOR_INDEX 29U |
A numerical definition for a vector.
More...
|
|
#define | IRQC_VECTOR_INDEX 30U |
A numerical definition for a vector.
More...
|
|
#define | IRQD_VECTOR_INDEX 31U |
A numerical definition for a vector.
More...
|
|
#define | DEBUG_VECTOR_INDEX 32U |
A numerical definition for a vector.
More...
|
|
#define | SC3_VECTOR_INDEX 33U |
A numerical definition for a vector.
More...
|
|
#define | SC4_VECTOR_INDEX 34U |
A numerical definition for a vector.
More...
|
|
#define | USB_VECTOR_INDEX 35U |
A numerical definition for a vector.
More...
|
|
#define | VECTOR_TABLE_LENGTH 36U |
Number of vectors.
More...
|
|
Detailed Description
Many of the supplied example applications use these microcontroller functions. See
hal/micro/micro.h
for source code.
- Note
- The term SFD refers to the Start Frame Delimiter.
Many of the supplied example applications use these microcontroller functions. See
hal/micro/micro-common.h
for source code.
See also
hal/micro/cortexm3/micro.h
for source code.
Macro Definition Documentation
#define ADC_VECTOR_INDEX 27U |
A numerical definition for a vector.
Definition at line
149
of file
cortexm3/micro.h
.
#define BASEBAND_VECTOR_INDEX 19U |
A numerical definition for a vector.
Definition at line
141
of file
cortexm3/micro.h
.
#define BUS_FAULT_VECTOR_INDEX 5U |
A numerical definition for a vector.
Definition at line
127
of file
cortexm3/micro.h
.
#define DEBUG_MONITOR_VECTOR_INDEX 12U |
A numerical definition for a vector.
Definition at line
134
of file
cortexm3/micro.h
.
#define DEBUG_TOGGLE | ( |
n
|
) |
Definition at line
260
of file
micro-common.h
.
#define DEBUG_VECTOR_INDEX 32U |
A numerical definition for a vector.
Definition at line
154
of file
cortexm3/micro.h
.
#define GPIO_MASK 0xFFFFFF |
Definition at line
219
of file
micro-common.h
.
#define GPIO_MASK_SIZE 24 |
Definition at line
218
of file
micro-common.h
.
#define halGetEm2xxResetInfo | ( |
|
) | halGetResetInfo () |
Calls halGetExtendedResetInfo() and translates the EM35x or COBRA reset code to the corresponding value used by the EM2XX HAL. Any reset codes not present in the EM2XX are returned after being OR'ed with 0x80.
- Application Usage:
- Used by the EZSP host as a platform-independent NCP reset code.
- Returns
- The EM2XX-compatible reset code. If not supported by the EM2XX, return the platform-specific code with B7 set.
Definition at line
89
of file
micro.h
.
#define HARD_FAULT_VECTOR_INDEX 3U |
A numerical definition for a vector.
Definition at line
125
of file
cortexm3/micro.h
.
#define IRQA_VECTOR_INDEX 28U |
A numerical definition for a vector.
Definition at line
150
of file
cortexm3/micro.h
.
#define IRQB_VECTOR_INDEX 29U |
A numerical definition for a vector.
Definition at line
151
of file
cortexm3/micro.h
.
#define IRQC_VECTOR_INDEX 30U |
A numerical definition for a vector.
Definition at line
152
of file
cortexm3/micro.h
.
#define IRQD_VECTOR_INDEX 31U |
A numerical definition for a vector.
Definition at line
153
of file
cortexm3/micro.h
.
#define MAC_RX_VECTOR_INDEX 26U |
A numerical definition for a vector.
Definition at line
148
of file
cortexm3/micro.h
.
#define MAC_TIMER_VECTOR_INDEX 24U |
A numerical definition for a vector.
Definition at line
146
of file
cortexm3/micro.h
.
#define MAC_TX_VECTOR_INDEX 25U |
A numerical definition for a vector.
Definition at line
147
of file
cortexm3/micro.h
.
#define MANAGEMENT_VECTOR_INDEX 18U |
A numerical definition for a vector.
Definition at line
140
of file
cortexm3/micro.h
.
#define MEMORY_FAULT_VECTOR_INDEX 4U |
A numerical definition for a vector.
Definition at line
126
of file
cortexm3/micro.h
.
#define MICRO_DISABLE_WATCH_DOG_KEY 0xA5U |
The value that must be passed as the single parameter to halInternalDisableWatchDog() in order to successfully disable the watchdog timer.
Definition at line
47
of file
micro-common.h
.
#define NMI_VECTOR_INDEX 2U |
A numerical definition for a vector.
Definition at line
124
of file
cortexm3/micro.h
.
#define PENDSV_VECTOR_INDEX 14U |
A numerical definition for a vector.
Definition at line
136
of file
cortexm3/micro.h
.
#define PTA_GPIOCFG_INPUT GPIOCFG_IN_PUD |
Definition at line
318
of file
cortexm3/micro.h
.
#define PTA_GPIOCFG_OUTPUT GPIOCFG_OUT |
Definition at line
319
of file
cortexm3/micro.h
.
#define PTA_GPIOCFG_WIRED_AND GPIOCFG_OUT_OD |
Definition at line
321
of file
cortexm3/micro.h
.
#define PTA_GPIOCFG_WIRED_OR GPIOCFG_OUT_OD |
Definition at line
320
of file
cortexm3/micro.h
.
#define PTA_SUPPORT |
Definition at line
317
of file
cortexm3/micro.h
.
#define RESERVED07_VECTOR_INDEX 7U |
A numerical definition for a vector.
Definition at line
129
of file
cortexm3/micro.h
.
#define RESERVED08_VECTOR_INDEX 8U |
A numerical definition for a vector.
Definition at line
130
of file
cortexm3/micro.h
.
#define RESERVED09_VECTOR_INDEX 9U |
A numerical definition for a vector.
Definition at line
131
of file
cortexm3/micro.h
.
#define RESERVED10_VECTOR_INDEX 10U |
A numerical definition for a vector.
Definition at line
132
of file
cortexm3/micro.h
.
#define RESERVED13_VECTOR_INDEX 13U |
A numerical definition for a vector.
Definition at line
135
of file
cortexm3/micro.h
.
#define RESET_VECTOR_INDEX 1U |
A numerical definition for a vector.
Definition at line
123
of file
cortexm3/micro.h
.
#define SC1_VECTOR_INDEX 21U |
A numerical definition for a vector.
Definition at line
143
of file
cortexm3/micro.h
.
#define SC2_VECTOR_INDEX 22U |
A numerical definition for a vector.
Definition at line
144
of file
cortexm3/micro.h
.
#define SC3_VECTOR_INDEX 33U |
A numerical definition for a vector.
Definition at line
155
of file
cortexm3/micro.h
.
#define SC4_VECTOR_INDEX 34U |
A numerical definition for a vector.
Definition at line
156
of file
cortexm3/micro.h
.
#define SECURITY_VECTOR_INDEX 23U |
A numerical definition for a vector.
Definition at line
145
of file
cortexm3/micro.h
.
#define SLEEP_TIMER_VECTOR_INDEX 20U |
A numerical definition for a vector.
Definition at line
142
of file
cortexm3/micro.h
.
#define STACK_VECTOR_INDEX 0U |
A numerical definition for a vector.
Definition at line
122
of file
cortexm3/micro.h
.
#define SVCALL_VECTOR_INDEX 11U |
A numerical definition for a vector.
Definition at line
133
of file
cortexm3/micro.h
.
#define SYSTICK_VECTOR_INDEX 15U |
A numerical definition for a vector.
Definition at line
137
of file
cortexm3/micro.h
.
#define TIMER1_VECTOR_INDEX 16U |
A numerical definition for a vector.
Definition at line
138
of file
cortexm3/micro.h
.
#define TIMER2_VECTOR_INDEX 17U |
A numerical definition for a vector.
Definition at line
139
of file
cortexm3/micro.h
.
#define USAGE_FAULT_VECTOR_INDEX 6U |
A numerical definition for a vector.
Definition at line
128
of file
cortexm3/micro.h
.
#define USB_VECTOR_INDEX 35U |
A numerical definition for a vector.
Definition at line
157
of file
cortexm3/micro.h
.
#define VECTOR_TABLE_LENGTH 36U |
Number of vectors.
Definition at line
162
of file
cortexm3/micro.h
.
#define WAKE_EVENT_SIZE WakeMask |
- Note
- The preprocessor symbol WAKE_EVENT_SIZE has been deprecated. Please use WakeMask instead.
Definition at line
231
of file
micro-common.h
.
#define WAKE_GPIO_MASK GPIO_MASK |
Definition at line
220
of file
micro-common.h
.
#define WAKE_GPIO_SIZE GPIO_MASK_SIZE |
Definition at line
221
of file
micro-common.h
.
#define WAKE_MASK_INVALID (-1) |
Definition at line
226
of file
micro-common.h
.
Typedef Documentation
typedef uint32_t WakeEvents |
Definition at line
222
of file
micro-common.h
.
typedef uint32_t WakeMask |
Definition at line
223
of file
micro-common.h
.
Enumeration Type Documentation
enum SleepModes |
Enumerations for the possible microcontroller sleep modes.
- SLEEPMODE_RUNNING Everything is active and running. In practice this mode is not used, but it is defined for completeness of information.
- SLEEPMODE_IDLE Only the CPU is idled. The rest of the chip continues running normally. The chip will wake from any interrupt.
- SLEEPMODE_WAKETIMER The sleep timer clock sources remain running. The RC is always running and the 32kHz XTAL depends on the board header. Wakeup is possible from both GPIO and the sleep timer. System time is maintained. The sleep timer is assumed to be configured properly for wake events.
- SLEEPMODE_MAINTAINTIMER The sleep timer clock sources remain running. The RC is always running and the 32kHz XTAL depends on the board header. Wakeup is possible from only GPIO. System time is maintained. NOTE: This mode is not available on EM2XX chips.
- SLEEPMODE_NOTIMER The sleep timer clock sources (both RC and XTAL) are turned off. Wakeup is possible from only GPIO. System time is lost.
- SLEEPMODE_HIBERNATE This maps to EM4 Hibernate on the EFM32/EFR32 devices. RAM is not retained in SLEEPMODE_HIBERNATE so waking up from this sleepmode will behave like a reset. NOTE: This mode is only available on EFM32/EFR32
Enumerator | |
---|---|
SLEEPMODE_RUNNING | |
SLEEPMODE_IDLE | |
SLEEPMODE_WAKETIMER | |
SLEEPMODE_MAINTAINTIMER | |
SLEEPMODE_NOTIMER | |
SLEEPMODE_HIBERNATE | |
SLEEPMODE_RESERVED | |
SLEEPMODE_POWERDOWN | |
SLEEPMODE_POWERSAVE |
Definition at line
97
of file
micro-common.h
.
Function Documentation
RTCCRamData halAfterEM4 | ( | void |
|
) |
void halBeforeEM4 | ( | uint32_t |
duration,
|
RTCCRamData |
input
|
||
) |
void halCommonDelayMicroseconds | ( | uint16_t |
us
|
) |
Blocks the current thread of execution for the specified amount of time, in microseconds.
The function is implemented with cycle-counted busy loops and is intended to create the short delays required when interfacing with hardware peripherals.
The accuracy of the timing provided by this function is not specified, but a general rule is that when running off of a crystal oscillator it will be within 10us. If the micro is running off of another type of oscillator (e.g. RC) the timing accuracy will potentially be much worse.
- Parameters
-
us
The specified time, in microseconds. Values should be between 1 and 65535 microseconds.
void halCommonDisableVreg1v8 | ( | void |
|
) |
Disable the 1.8V regulator. This function is to be used when the 1.8V supply is provided externally. Disabling the regulator saves current consumption. Disabling the regulator will cause ADC readings of external signals to be wrong. These exteranl signals include analog sources ADC0 thru ADC5 and VDD_PADS/4.
- Note
- : Only used when DISABLE_INTERNAL_1V8_REGULATOR is defined.
void halCommonEnableVreg1v8 | ( | void |
|
) |
Enable the 1.8V regulator. Normally the 1.8V regulator is enabled out of reset. This function is only needed if the 1.8V regulator has been disabled and ADC conversions on external signals are needed. These exteranl signals include analog sources ADC0 thru ADC5 and VDD_PADS/4. The state of 1v8 survives deep sleep.
- Note
- : Only used when DISABLE_INTERNAL_1V8_REGULATOR is defined.
uint16_t halGetExtendedResetInfo | ( | void |
|
) |
Returns the Extended Reset Cause information.
- Returns
- A 16-bit code identifying the base and extended cause of the reset
PGM_P halGetExtendedResetString | ( | void |
|
) |
Calls halGetExtendedResetInfo() and supplies a string describing the extended cause of the reset. halGetResetString() should also be called to get the string for the base reset cause.
- Application Usage:
- Useful for diagnostic printing of text just after program initialization.
- Returns
- A pointer to a program space string.
bool halGetRadioHoldOff | ( | void |
|
) |
Returns whether Radio HoldOff has been enabled or not.
- Returns
- true if Radio HoldOff has been enabled, false otherwise.
uint8_t halGetResetInfo | ( | void |
|
) |
Gets information about what caused the microcontroller to reset.
- Returns
- A code identifying the cause of the reset.
PGM_P halGetResetString | ( | void |
|
) |
Calls halGetResetInfo() and supplies a string describing it.
- Application Usage:
- Useful for diagnostic printing of text just after program initialization.
- Returns
- A pointer to a program space string.
void halInit | ( | void |
|
) |
Initializes microcontroller-specific peripherals.
void halInternalDisableWatchDog | ( | uint8_t |
magicKey
|
) |
Disables the watchdog timer.
- Note
- To prevent the watchdog from being disabled accidentally, a magic key must be provided.
- Parameters
-
magicKey
A value ( MICRO_DISABLE_WATCH_DOG_KEY ) that enables the function.
void halInternalEnableWatchDog | ( | void |
|
) |
Enables the watchdog timer.
void halInternalSysReset | ( | uint16_t |
extendedCause
|
) |
Records the specified reset cause then forces a reboot.
bool halInternalWatchDogEnabled | ( | void |
|
) |
Determines whether the watchdog has been enabled or disabled.
- Returns
- A bool value indicating if the watchdog is current enabled.
void halPowerDown | ( | void |
|
) |
Powers down microcontroller peripherals and board peripherals.
void halPowerUp | ( | void |
|
) |
Powers up microcontroller peripherals and board peripherals.
void halRadioPowerDownHandler | ( | void |
|
) |
Handler called in main context after radio has been powered off.
void halRadioPowerUpHandler | ( | void |
|
) |
Handler called in main context prior to radio being powered on.
void halReboot | ( | void |
|
) |
Restarts the microcontroller and therefore everything else.
void halResume | ( | void |
|
) |
Resumes microcontroller peripherals and board peripherals.
EmberStatus halSetRadioHoldOff | ( | bool |
enable
|
) |
Enables or disables Radio HoldOff support.
- Parameters
-
enable
When true, configures ::RHO_GPIO in BOARD_HEADER as an input which, when asserted, will prevent the radio from transmitting. When false, configures ::RHO_GPIO for its original default purpose.
- Returns
- EMBER_SUCCESS if Radio HoldOff was configured as desired or EMBER_BAD_ARGUMENT if requesting it be enabled but RHO has not been configured by the BOARD_HEADER.
void halSleep | ( | SleepModes |
sleepMode
|
) |
Puts the microcontroller to sleep in a specified mode.
- Note
- This routine always enables interrupts.
- Parameters
-
sleepMode
A microcontroller sleep mode
- See also
- SleepModes
void halStackProcessBootCount | ( | void |
|
) |
Called from emberInit and provides a means for the HAL to increment a boot counter, most commonly in non-volatile memory.
This is useful while debugging to determine the number of resets that might be seen over a period of time. Exposing this functionality allows the application to disable or alter processing of the boot counter if, for example, the application is expecting a lot of resets that could wear out non-volatile storage or some
- EmberStack Usage:
- Called from emberInit only as helpful debugging information. This should be left enabled by default, but this function can also be reduced to a simple return statement if boot counting is not desired.
void halStackRadio2PowerDownBoard | ( | void |
|
) |
To assist with saving power when radio2 automatically powers down, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerdown state. The pin state used is the state used by halInternalPowerDownBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function is often called from interrupt context.
void halStackRadio2PowerUpBoard | ( | void |
|
) |
To assist with saving power when radio2 automatically powers up, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerup state. The pin state used is the state used by halInternalPowerUpBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function can be called from interrupt context.
void halStackRadioPowerDownBoard | ( | void |
|
) |
To assist with saving power when the radio automatically powers down, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerdown state. The pin state used is the state used by halInternalPowerDownBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function is often called from interrupt context.
void halStackRadioPowerMainControl | ( | bool |
powerUp
|
) |
This function is called automatically by the stack prior to Radio power-up and after Radio power-down. It can be used to prepare for the radio being powered on and to clean up after it's been powered off. Unlike halStackRadioPowerUpBoard() and halStackRadioPowerDownBoard() , which can be called from interrupt context, this function is only called from main-line context.
void halStackRadioPowerUpBoard | ( | void |
|
) |
To assist with saving power when the radio automatically powers up, this function allows the stack to tell the HAL to put pins specific to radio functionality in their powerup state. The pin state used is the state used by halInternalPowerUpBoard, but applied only to the pins identified in the global variable gpioRadioPowerBoardMask. The stack will automatically call this function as needed, but it will only change GPIO state based on gpioRadioPowerBoardMask. Most commonly, the bits set in gpioRadioPowerBoardMask petain to using a Front End Module. This function can be called from interrupt context.
void halSuspend | ( | void |
|
) |
Suspends microcontroller peripherals and board peripherals.
Variable Documentation
volatile int8_t halCommonVreg1v8EnableCount |
Helper variable to track the state of 1.8V regulator.
- Note
- : Only used when DISABLE_INTERNAL_1V8_REGULATOR is defined.