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#

#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.

Typedefs#

typedef uint8_t

Functions#

void
halInit(void)

Initializes microcontroller-specific peripherals.

void
halReboot(void)

Restarts the microcontroller and therefore everything else.

void

Enables the watchdog timer.

void
halInternalDisableWatchDog(uint8_t magicKey)

Disables the watchdog timer.

bool

Determines whether the watchdog has been enabled or disabled.

void

hal Reset Watchdog

void
halInternalSetCtune(uint16_t tune)

Change the CTUNE value. Involves switching to HFRCO and turning off the HFXO temporarily.

uint16_t

Get the CTUNE value.

 

Typedef Documentation#

SleepModes#

typedef uint8_t SleepModes

Function Documentation#

halInit#

void halInit (void )

Initializes microcontroller-specific peripherals.

Parameters
TypeDirectionArgument NameDescription
voidN/A

halReboot#

void halReboot (void )

Restarts the microcontroller and therefore everything else.

Parameters
TypeDirectionArgument NameDescription
voidN/A

halInternalEnableWatchDog#

void halInternalEnableWatchDog (void )

Enables the watchdog timer.

Parameters
TypeDirectionArgument NameDescription
voidN/A

halInternalDisableWatchDog#

void halInternalDisableWatchDog (uint8_t magicKey)

Disables the watchdog timer.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/AmagicKey

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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • A bool value indicating if the watchdog is current enabled.


halResetWatchdog#

void halResetWatchdog (void )

hal Reset Watchdog

Parameters
TypeDirectionArgument NameDescription
voidN/A

halInternalSetCtune#

void halInternalSetCtune (uint16_t tune)

Change the CTUNE value. Involves switching to HFRCO and turning off the HFXO temporarily.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/Atune

Value to set CTUNE to.


halInternalGetCtune#

uint16_t halInternalGetCtune (void )

Get the CTUNE value.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Current CTUNE value.