Legacy HAL

Description

The Legacy HAL is an implementation of the Hardware Abstraction Layer (HAL) that was used by the Zigbee EmberZNet and Flex Connect stacks before their transition to the new component-based architecture (Zigbee version 7.0 and Connect version 3.0). This component is not a complete duplicate of the old HAL. It only contains the most commonly used pieces to enable our networking stacks and sample applications and to support porting customer applications to the new component-based implementation. Currently, Zigbee and Connect sample applications are dependent on this component. Eventually, they will be ported to use new HAL components directly so that this component can become optional or be deprecated.

Note
This component is only designed to be used with Zigbee and Connect stack applications. Do not use with any other stacks as it will likely introduce problems.

Modules

Application Bootloader Interface
Definition of the application bootloader interface.
Button
Sample API functions for using push-buttons.
Common Bootloader
Common bootloader interface defines and functions.
Cyclic Redundancy Check
Functions that provide access to cyclic redundancy code (CRC) calculation. See crc.h for source code.
Diagnostics
Crash and watchdog diagnostic functions.
LED
Sample API funtions for controlling LEDs.
Microcontroller functions
Microcontroller functions.
Random generation
Functions that provide access to random numbers.
Reset Cause Definitions
Definitions for all the reset cause types.
SimEE2 to NVM3 Upgrade
Simulated EEPROM 1 and 2
Simulated EEPROM 1 and 2 legacy storage.
Standalone Bootloader
Definition of the standalone bootloader interface.

Data Structures

struct HalEepromInformationType
This structure defines a variety of information about the attached external EEPROM device.
struct EepromStateType

Functions

const HalEepromInformationType * halEepromInfo (void)
Call this function to get information about the external EEPROM and its capabilities.
uint16_t halCommonGetInt16uMillisecondTick (void)
uint32_t halCommonGetInt32uMillisecondTick (void)
uint64_t halCommonGetInt64uMillisecondTick (void)
uint16_t halCommonGetInt16uQuarterSecondTick (void)
uint16_t halInternalStartSystemTimer (void)
void halCommonDelayMicroseconds (uint16_t us)
void halCommonDelayMilliseconds (uint16_t ms)
EmberStatus halCommonIdleForMilliseconds (uint32_t *duration)
void halStackSymbolDelayAIsr (void)
void halStackRadioPowerMainControl (bool powerUp)
void halStackRadioPowerUpBoard (void)
void halStackRadioPowerDownBoard (void)
void halStackProcessBootCount (void)
EmberStatus emDebugInit (void)
void emRadioSeedRandom (void)

Macros

#define EEPROM_PAGE_SIZE (128ul)
Definition of an EEPROM page size, in bytes.
#define EEPROM_FIRST_PAGE (0)
Define the location of the first page in EEPROM.
#define EEPROM_IMAGE_START ( EEPROM_FIRST_PAGE * EEPROM_PAGE_SIZE )
Define the location of the image start in EEPROM as a function of the EEPROM_FIRST_PAGE and EEPROM_PAGE_SIZE .
#define EEPROM_SUCCESS 0U
Define EEPROM success status.
#define EEPROM_ERR 1U
Define EEPROM error status.
#define EEPROM_ERR_MASK 0x80U
Define EEPROM error mask.
#define EEPROM_ERR_PG_BOUNDARY 0x81U
Define EEPROM page boundary error.
#define EEPROM_ERR_PG_SZ 0x82U
Define EEPROM page size error.
#define EEPROM_ERR_WRT_DATA 0x83U
Define EEPROM write data error.
#define EEPROM_ERR_IMG_SZ 0x84U
Define EEPROM image too large error.
#define EEPROM_ERR_ADDR 0x85U
Define EEPROM invalid address error.
#define EEPROM_ERR_INVALID_CHIP 0x86U
Define EEPROM chip initialization error.
#define EEPROM_ERR_ERASE_REQUIRED 0x87U
Define EEPROM erase required error.
#define EEPROM_ERR_NO_ERASE_SUPPORT 0x88U
Define EEPROM error for no erase support.
#define EEPROM_INFO_VERSION (0x0202)
The current version of the HalEepromInformationType data structure.
#define EEPROM_INFO_MAJOR_VERSION (0x0200)
#define EEPROM_INFO_MAJOR_VERSION_MASK (0xFF00)
#define EEPROM_INFO_MIN_VERSION_WITH_WORD_SIZE_SUPPORT 0x0102U
#define EEPROM_CAPABILITIES_ERASE_SUPPORTED (0x0001U)
Eeprom capabilites mask that indicates the erase API is supported.
#define EEPROM_CAPABILITIES_PAGE_ERASE_REQD (0x0002U)
Eeprom capabilites mask that indicates page erasing is required before new data can be written to a device.
#define EEPROM_CAPABILITIES_BLOCKING_WRITE (0x0004U)
Eeprom capabilites mask that indicates that the write routine is blocking on this device.
#define EEPROM_CAPABILITIES_BLOCKING_ERASE (0x0008U)
Eeprom capabilites mask that indicates that the erase routine is blocking on this device.
#define EEPROM_CAPABILITIES_PART_ERASE_SECONDS (0x0010U)
Eeprom capabilities mask that indicateds that the partEraseTime field of HalEepromInformationType is in seconds instead of the usual millisecondss.
#define simulatedTimePasses ()

Function Documentation

halEepromInfo()

const HalEepromInformationType * halEepromInfo ( void )

Call this function to get information about the external EEPROM and its capabilities.

The format of this call must not be altered. However, the content can be changed to work with a different device.

Returns
A pointer to a HalEepromInformationType data structure, or NULL if the driver does not support this API

Macro Definition Documentation

EEPROM_PAGE_SIZE

#define EEPROM_PAGE_SIZE   (128ul)

Definition of an EEPROM page size, in bytes.

This definition is deprecated, and should no longer be used.

EEPROM_FIRST_PAGE

#define EEPROM_FIRST_PAGE   (0)

Define the location of the first page in EEPROM.

This definition is deprecated, and should no longer be used.

EEPROM_IMAGE_START

#define EEPROM_IMAGE_START   ( EEPROM_FIRST_PAGE * EEPROM_PAGE_SIZE )

Define the location of the image start in EEPROM as a function of the EEPROM_FIRST_PAGE and EEPROM_PAGE_SIZE .

This definition is deprecated, and should no longer be used.

EEPROM_SUCCESS

#define EEPROM_SUCCESS   0U

Define EEPROM success status.

EEPROM_ERR

#define EEPROM_ERR   1U

Define EEPROM error status.

EEPROM_ERR_MASK

#define EEPROM_ERR_MASK   0x80U

Define EEPROM error mask.

EEPROM_ERR_PG_BOUNDARY

#define EEPROM_ERR_PG_BOUNDARY   0x81U

Define EEPROM page boundary error.

EEPROM_ERR_PG_SZ

#define EEPROM_ERR_PG_SZ   0x82U

Define EEPROM page size error.

EEPROM_ERR_WRT_DATA

#define EEPROM_ERR_WRT_DATA   0x83U

Define EEPROM write data error.

EEPROM_ERR_IMG_SZ

#define EEPROM_ERR_IMG_SZ   0x84U

Define EEPROM image too large error.

EEPROM_ERR_ADDR

#define EEPROM_ERR_ADDR   0x85U

Define EEPROM invalid address error.

EEPROM_ERR_INVALID_CHIP

#define EEPROM_ERR_INVALID_CHIP   0x86U

Define EEPROM chip initialization error.

EEPROM_ERR_ERASE_REQUIRED

#define EEPROM_ERR_ERASE_REQUIRED   0x87U

Define EEPROM erase required error.

EEPROM_ERR_NO_ERASE_SUPPORT

#define EEPROM_ERR_NO_ERASE_SUPPORT   0x88U

Define EEPROM error for no erase support.

EEPROM_INFO_VERSION

#define EEPROM_INFO_VERSION   (0x0202)

The current version of the HalEepromInformationType data structure.

EEPROM_CAPABILITIES_ERASE_SUPPORTED

#define EEPROM_CAPABILITIES_ERASE_SUPPORTED   (0x0001U)

Eeprom capabilites mask that indicates the erase API is supported.

EEPROM_CAPABILITIES_PAGE_ERASE_REQD

#define EEPROM_CAPABILITIES_PAGE_ERASE_REQD   (0x0002U)

Eeprom capabilites mask that indicates page erasing is required before new data can be written to a device.

EEPROM_CAPABILITIES_BLOCKING_WRITE

#define EEPROM_CAPABILITIES_BLOCKING_WRITE   (0x0004U)

Eeprom capabilites mask that indicates that the write routine is blocking on this device.

EEPROM_CAPABILITIES_BLOCKING_ERASE

#define EEPROM_CAPABILITIES_BLOCKING_ERASE   (0x0008U)

Eeprom capabilites mask that indicates that the erase routine is blocking on this device.

EEPROM_CAPABILITIES_PART_ERASE_SECONDS

#define EEPROM_CAPABILITIES_PART_ERASE_SECONDS   (0x0010U)

Eeprom capabilities mask that indicateds that the partEraseTime field of HalEepromInformationType is in seconds instead of the usual millisecondss.