Zpal-init#

Defines a platform abstraction layer for the Z-Wave initialization.

How to use the initialization API

The ZPAL initialization API is required to validate if application can be run on specific chip.

zpal_init_is_valid() must be implemented as Z-Wave always invokes it. zpal_init_invalidate() will be invoked only if zpal_init_is_valid() return false. zpal_system_startup() is an externally defined and implemented by Z-Wave SDK.

The following outlines an example of use:

  1. Initialize hardware.

  2. Invoke zpal_system_startup() at the end of main().

  3. During Z-Wave SDK initialization zpal_init_is_valid() will be invoked.

  4. If zpal_init_is_valid() returns false, zpal_init_invalidate() will be invoked.

Requirements:

  • The ZPAL initialization requires that zpal_system_startup() is invoked at the end of main() after hardware initialization is done. (check main() from PAL/templates/main.c)

  • Function zpal_init_invalidate() never exits. It must setup the hardware so that the chip stops working.

Enumerations#

enum
ZPAL_RESET_REASON_PIN = 0
ZPAL_RESET_REASON_DEEP_SLEEP_WUT = 1
ZPAL_RESET_REASON_WATCHDOG = 3
ZPAL_RESET_REASON_DEEP_SLEEP_EXT_INT = 4
ZPAL_RESET_REASON_POWER_ON = 5
ZPAL_RESET_REASON_SOFTWARE = 7
ZPAL_RESET_REASON_BROWNOUT = 9
ZPAL_RESET_REASON_TAMPER = 10
ZPAL_RESET_REASON_OTHER = 0xFF
}

Reset reason.

Typedefs#

typedef enum zpal_reset_reason_t

Reset reason.

Functions#

bool
zpal_init_is_valid(uint8_t generic_type, uint8_t specific_type)

Returns whether generic and specific is a valid combination for current chip.

void

Setup the hardware so that the chip stops working.

void
zpal_system_startup(zpal_reset_reason_t reset_reason)

System startup, implemented by Z-Wave SDK.

Enumeration Documentation#

zpal_reset_reason_t#

zpal_reset_reason_t

Reset reason.

Enumerator
ZPAL_RESET_REASON_PIN

Reset triggered by reset pin.

ZPAL_RESET_REASON_DEEP_SLEEP_WUT

Reset triggered by wake up by timer from deep sleep state.

ZPAL_RESET_REASON_WATCHDOG

Reset triggered by watchdog.

ZPAL_RESET_REASON_DEEP_SLEEP_EXT_INT

Reset triggered by external interrupt event in deep sleep state.

ZPAL_RESET_REASON_POWER_ON

Reset triggered by power on.

ZPAL_RESET_REASON_SOFTWARE

Reset triggered by software.

ZPAL_RESET_REASON_BROWNOUT

Reset triggered by brownout circuit.

ZPAL_RESET_REASON_TAMPER

Reset triggered by a tamper attempt.

ZPAL_RESET_REASON_OTHER

Reset triggered by none of the above.


Definition at line 52 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h

Typedef Documentation#

zpal_reset_reason_t#

typedef enum zpal_reset_reason_t zpal_reset_reason_t

Reset reason.


Definition at line 66 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h

Function Documentation#

zpal_init_is_valid#

bool zpal_init_is_valid (uint8_t generic_type, uint8_t specific_type)

Returns whether generic and specific is a valid combination for current chip.

Parameters
[in]generic_type

Generic type of the running application.

[in]specific_type

Specific type of the running application.

Returns

  • True if combination is valid, false otherwise.


Definition at line 75 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h

zpal_init_invalidate#

void zpal_init_invalidate (void)

Setup the hardware so that the chip stops working.

Parameters
N/A

Note

  • This function never exits.


Definition at line 82 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h

zpal_get_reset_reason#

zpal_reset_reason_t zpal_get_reset_reason (void)

Get reset reason.

Parameters
N/A

Returns

  • Reset reason.


Definition at line 88 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h

zpal_system_startup#

void zpal_system_startup (zpal_reset_reason_t reset_reason)

System startup, implemented by Z-Wave SDK.

Parameters
[in]reset_reason

Reset reason.

Note

  • This function never exits.


Definition at line 97 of file /mnt/raid/workspaces/ws.WH1KakGoP/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_init.h