Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Zpal-init

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

+ Collaboration diagram for Zpal-init:

Typedefs

typedef enum zpal_reset_reason_t zpal_reset_reason_t
 Reset reason.
 

Enumerations

enum  zpal_reset_reason_t {
  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. More...
 
enum  zpal_library_type_t {
  ZPAL_LIBRARY_TYPE_CONTROLLER = 0 ,
  ZPAL_LIBRARY_TYPE_SLAVE = 1 ,
  ZPAL_LIBRARY_TYPE_UNDEFINED = 0xFF
}
 enumeration for library types More...
 

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 zpal_init_invalidate (void)
 Setup the hardware so that the chip stops working.
 
zpal_reset_reason_t zpal_get_reset_reason (void)
 Get reset reason.
 
zpal_library_type_t zpal_get_library_type (void)
 Get the node's library type.
 
zpal_status_t zpal_init_set_library_type (const zpal_library_type_t library_type)
 Set the node's library type This function should be called at the startup code. It can be used if PAL code need to be initiated differently depending on the library type.
 
void zpal_system_startup (zpal_reset_reason_t reset_reason)
 System startup, implemented by Z-Wave SDK.
 

Detailed Description

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:

Typedef Documentation

◆ zpal_reset_reason_t

Reset reason.

Enumeration Type Documentation

◆ zpal_library_type_t

enumeration for library types

Enumerator
ZPAL_LIBRARY_TYPE_CONTROLLER 

Controller library

ZPAL_LIBRARY_TYPE_SLAVE 

Slave library

ZPAL_LIBRARY_TYPE_UNDEFINED 

Undefined

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

Function Documentation

◆ zpal_get_library_type()

zpal_library_type_t zpal_get_library_type ( void )

Get the node's library type.

Returns
library type.

◆ zpal_get_reset_reason()

zpal_reset_reason_t zpal_get_reset_reason ( void )

Get reset reason.

Returns
Reset reason.

◆ zpal_init_invalidate()

void zpal_init_invalidate ( void )

Setup the hardware so that the chip stops working.

Note
This function never exits.

◆ 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_typeGeneric type of the running application.
[in]specific_typeSpecific type of the running application.
Returns
True if combination is valid, false otherwise.

◆ zpal_init_set_library_type()

zpal_status_t zpal_init_set_library_type ( const zpal_library_type_t library_type)

Set the node's library type This function should be called at the startup code. It can be used if PAL code need to be initiated differently depending on the library type.

Parameters
[in]library_typeThe library type.
Returns
Returns ZPAL_STATUS_OK on success, otherwise ZPAL_STATUS_FAIL.

◆ zpal_system_startup()

void zpal_system_startup ( zpal_reset_reason_t reset_reason)
extern

System startup, implemented by Z-Wave SDK.

Parameters
[in]reset_reasonReset reason.
Note
This function never exits.