Minimal Hal functions common across all microcontroller-specific files. See Common Microcontroller Functions for documentation.
License#
Copyright 2018 Silicon Laboratories Inc. www.silabs.com
The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.
/***************************************************************************/
/***************************************************************************/
#ifndef __MICRO_COMMON_H__
#define __MICRO_COMMON_H__
void halInit(void);
void halReboot(void);
#define MICRO_DISABLE_WATCH_DOG_KEY 0xA5U
void halInternalEnableWatchDog(void);
void halInternalDisableWatchDog(uint8_t magicKey);
bool halInternalWatchDogEnabled(void);
void halResetWatchdog(void);
void halInternalSetCtune(uint16_t tune);
uint16_t halInternalGetCtune(void);
typedef uint8_t SleepModes;
#endif //__MICRO_COMMON_H__
Macros#
The value that must be passed as the single parameter to halInternalDisableWatchDog() in order to successfully disable the watchdog timer.
Typedefs#
Functions#
Initializes microcontroller-specific peripherals.
Restarts the microcontroller and therefore everything else.
Enables the watchdog timer.
Disables the watchdog timer.
Determines whether the watchdog has been enabled or disabled.
hal Reset Watchdog
Change the CTUNE value. Involves switching to HFRCO and turning off the HFXO temporarily.
Get the CTUNE value.
Function Documentation#
halInit#
void halInit (void )
Initializes microcontroller-specific peripherals.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
halReboot#
void halReboot (void )
Restarts the microcontroller and therefore everything else.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
halInternalEnableWatchDog#
void halInternalEnableWatchDog (void )
Enables the watchdog timer.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
halInternalDisableWatchDog#
void halInternalDisableWatchDog (uint8_t magicKey)
Disables the watchdog timer.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | N/A | magicKey | A value (MICRO_DISABLE_WATCH_DOG_KEY) that enables the function. |
Note
To prevent the watchdog from being disabled accidentally, a magic key must be provided.
halInternalWatchDogEnabled#
bool halInternalWatchDogEnabled (void )
Determines whether the watchdog has been enabled or disabled.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Returns
A bool value indicating if the watchdog is current enabled.
halResetWatchdog#
void halResetWatchdog (void )
hal Reset Watchdog
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
halInternalSetCtune#
void halInternalSetCtune (uint16_t tune)
Change the CTUNE value. Involves switching to HFRCO and turning off the HFXO temporarily.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | N/A | tune | Value to set CTUNE to. |
halInternalGetCtune#
uint16_t halInternalGetCtune (void )
Get the CTUNE value.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Returns
Current CTUNE value.