Bootloader GPIO definitions. See GPIO for detailed 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 __BOOTLOADER_GPIO_H__
#define __BOOTLOADER_GPIO_H__

//

#define BL_STATE_UP() do { bootloadStateIndicator(BL_ST_UP); } while (0)

#define BL_STATE_DOWN() do { bootloadStateIndicator(BL_ST_DOWN); } while (0)

#define BL_STATE_POLLING_LOOP() do { bootloadStateIndicator(BL_ST_POLLING_LOOP); } while (0)

#define BL_STATE_DOWNLOAD_LOOP() do { bootloadStateIndicator(BL_ST_DOWNLOAD_LOOP); } while (0)

#define BL_STATE_DOWNLOAD_SUCCESS() do { bootloadStateIndicator(BL_ST_DOWNLOAD_SUCCESS); } while (0)

#define BL_STATE_DOWNLOAD_FAILURE() do { bootloadStateIndicator(BL_ST_DOWNLOAD_FAILURE); } while (0)

enum blState_e {
  BL_ST_UP,

  BL_ST_DOWN,

  BL_ST_POLLING_LOOP,

  BL_ST_DOWNLOAD_LOOP,

  BL_ST_DOWNLOAD_FAILURE,

  BL_ST_DOWNLOAD_SUCCESS
};

void bootloadGpioInit(void);

void bootloadStateIndicator(enum blState_e state);

bool bootloadForceActivation(void);

#endif // __BOOTLOADER_GPIO_H__

State Indicator Macros#

The bootloader indicates which state it is in by calling these // macros. Map them to the ::halBootloadStateIndicator function // (in bootloder-gpio.c) if you want to display that bootloader state. // Used to blink the LED's or otherwise signal bootloader activity.

#define

Finished init sequence, ready for bootload.

#define

Called right before bootloader resets to application. Use to cleanup and reset GPIO's to leave node in known state for app start, if necessary.

#define

Standalone bootloader polling serial/radio interface.

#define

Processing download image.

#define

Download process was a success.

#define

Download process failed.

Enumerations#

enum
BL_ST_UP
BL_ST_DOWN
BL_ST_POLLING_LOOP
BL_ST_DOWNLOAD_LOOP
BL_ST_DOWNLOAD_FAILURE
BL_ST_DOWNLOAD_SUCCESS
}

Defines various bootloader states. Use in LED code to signal bootload activity.

Functions#

void

Initialize GPIO.

void
bootloadStateIndicator(enum blState_e state)

Helper function used for displaying bootloader state (for example: with LEDs).

bool

Force activation of bootloader.

State Indicator Macros Documentation#

BL_STATE_UP#

#define BL_STATE_UP
Value:
()

Finished init sequence, ready for bootload.


Definition at line 39 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

BL_STATE_DOWN#

#define BL_STATE_DOWN
Value:
()

Called right before bootloader resets to application. Use to cleanup and reset GPIO's to leave node in known state for app start, if necessary.


Definition at line 45 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

BL_STATE_POLLING_LOOP#

#define BL_STATE_POLLING_LOOP
Value:
()

Standalone bootloader polling serial/radio interface.


Definition at line 49 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

BL_STATE_DOWNLOAD_LOOP#

#define BL_STATE_DOWNLOAD_LOOP
Value:
()

Processing download image.


Definition at line 53 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

BL_STATE_DOWNLOAD_SUCCESS#

#define BL_STATE_DOWNLOAD_SUCCESS
Value:
()

Download process was a success.


Definition at line 57 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

BL_STATE_DOWNLOAD_FAILURE#

#define BL_STATE_DOWNLOAD_FAILURE
Value:
()

Download process failed.


Definition at line 61 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

Enumeration Documentation#

blState_e#

blState_e

Defines various bootloader states. Use in LED code to signal bootload activity.

Enumerator
BL_ST_UP

bootloader up

BL_ST_DOWN

bootloader going down

BL_ST_POLLING_LOOP

polling interfaces

BL_ST_DOWNLOAD_LOOP

downloading

BL_ST_DOWNLOAD_FAILURE

download failure

BL_ST_DOWNLOAD_SUCCESS

download success


Definition at line 68 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

Function Documentation#

bootloadGpioInit#

void bootloadGpioInit (void )

Initialize GPIO.

Parameters
N/A

Definition at line 90 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

bootloadStateIndicator#

void bootloadStateIndicator (enum blState_e state)

Helper function used for displaying bootloader state (for example: with LEDs).

Parameters
N/Astate

Definition at line 95 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h

bootloadForceActivation#

bool bootloadForceActivation (void )

Force activation of bootloader.

Parameters
N/A

Definition at line 99 of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-gpio.h