|
enum | zpal_radio_mode_t {
ZPAL_RADIO_MODE_NON_LISTENING
,
ZPAL_RADIO_MODE_ALWAYS_LISTENING
,
ZPAL_RADIO_MODE_FLIRS
} |
| Defines the different radio modes supported by Z-Wave. More...
|
|
enum | zpal_radio_wakeup_t {
ZPAL_RADIO_WAKEUP_NEVER_LISTEN
,
ZPAL_RADIO_WAKEUP_ALWAYS_LISTEN
,
ZPAL_RADIO_WAKEUP_EVERY_250ms
,
ZPAL_RADIO_WAKEUP_EVERY_1000ms
} |
| Wakeup interval for the radio. A FLiRS node will use 250 or 1000 ms interval, all other nodes should be configured as always listening. More...
|
|
enum | zpal_radio_crc_t {
ZPAL_RADIO_CRC_NONE
,
ZPAL_RADIO_CRC_8_BIT_XOR
,
ZPAL_RADIO_CRC_16_BIT_CCITT
} |
| Enumeration containing supported checksum types in Z-Wave. More...
|
|
enum | zpal_radio_speed_t {
ZPAL_RADIO_SPEED_UNDEFINED
,
ZPAL_RADIO_SPEED_9600
,
ZPAL_RADIO_SPEED_40K
,
ZPAL_RADIO_SPEED_100K
,
ZPAL_RADIO_SPEED_100KLR
} |
| Enumeration containing supported baud rates. More...
|
|
enum | zpal_radio_lr_channel_t {
ZPAL_RADIO_LR_CHANNEL_UNINITIALIZED
,
ZPAL_RADIO_LR_CHANNEL_A
,
ZPAL_RADIO_LR_CHANNEL_B
,
ZPAL_RADIO_LR_CHANNEL_UNKNOWN
,
ZPAL_RADIO_LR_CHANNEL_AUTO = 255
} |
| Enumeration containing Long Range Channels. More...
|
|
enum | zpal_radio_zwave_channel_t {
ZPAL_RADIO_ZWAVE_CHANNEL_0 = 0
,
ZPAL_RADIO_ZWAVE_CHANNEL_1 = 1
,
ZPAL_RADIO_ZWAVE_CHANNEL_2 = 2
,
ZPAL_RADIO_ZWAVE_CHANNEL_3 = 3
,
ZPAL_RADIO_ZWAVE_CHANNEL_4 = 4
,
ZPAL_RADIO_ZWAVE_CHANNEL_UNKNOWN = 0xFF
} |
| Enumeration containing Z-Wave channels. More...
|
|
enum | zpal_radio_protocol_mode_t {
ZPAL_RADIO_PROTOCOL_MODE_1
,
ZPAL_RADIO_PROTOCOL_MODE_2
,
ZPAL_RADIO_PROTOCOL_MODE_3
,
ZPAL_RADIO_PROTOCOL_MODE_4
,
ZPAL_RADIO_PROTOCOL_MODE_UNDEFINED = 0xFF
} |
| Enumeration containing Z-Wave channels known as protocol modes. More...
|
|
enum | zpal_radio_lr_channel_config_t {
ZPAL_RADIO_LR_CH_CFG_NO_LR
,
ZPAL_RADIO_LR_CH_CFG1
,
ZPAL_RADIO_LR_CH_CFG2
,
ZPAL_RADIO_LR_CH_CFG3
,
ZPAL_RADIO_LR_CH_CFG_COUNT
} |
| List of LR channel configurations. Used to select the correct phy configuration. More...
|
|
enum | zpal_radio_region_t {
REGION_2CH_FIRST = 0
,
REGION_EU = REGION_2CH_FIRST
,
REGION_US
,
REGION_ANZ
,
REGION_HK
,
REGION_DEPRECATED_4
,
REGION_IN = 5
,
REGION_IL
,
REGION_RU
,
REGION_CN
,
REGION_US_LR
,
REGION_DEPRECATED_10
,
REGION_EU_LR
,
REGION_2CH_END
,
REGION_3CH_FIRST = 32
,
REGION_JP = REGION_3CH_FIRST
,
REGION_KR
,
REGION_3CH_END
,
REGION_DEPRECATED_48 = 48
,
REGION_UNDEFINED = 0xFE
,
REGION_DEFAULT = 0xFF
} |
| Enumeration official Z-Wave regions. More...
|
|
enum | zpal_radio_tx_power_t {
ZPAL_RADIO_TX_POWER_DEFAULT
,
ZPAL_RADIO_TX_POWER_MINUS1_DBM
,
ZPAL_RADIO_TX_POWER_MINUS2_DBM
,
ZPAL_RADIO_TX_POWER_MINUS3_DBM
,
ZPAL_RADIO_TX_POWER_MINUS4_DBM
,
ZPAL_RADIO_TX_POWER_MINUS5_DBM
,
ZPAL_RADIO_TX_POWER_MINUS6_DBM
,
ZPAL_RADIO_TX_POWER_MINUS7_DBM
,
ZPAL_RADIO_TX_POWER_MINUS8_DBM
,
ZPAL_RADIO_TX_POWER_MINUS9_DBM
,
ZPAL_RADIO_TX_POWER_UNINITIALIZED = 126
,
ZPAL_RADIO_TX_POWER_REDUCED = 127
} |
| Enumeration containing Tx power settings. More...
|
|
enum | zpal_radio_header_type_t {
ZPAL_RADIO_HEADER_TYPE_2CH
,
ZPAL_RADIO_HEADER_TYPE_3CH
,
ZPAL_RADIO_HEADER_TYPE_LR
,
ZPAL_RADIO_HEADER_TYPE_UNDEFINED
} |
| Z-Wave Frame header format types. More...
|
|
enum | zpal_radio_event_t {
ZPAL_RADIO_EVENT_NONE
,
ZPAL_RADIO_EVENT_RX_COMPLETE
,
ZPAL_RADIO_EVENT_TX_COMPLETE
,
ZPAL_RADIO_EVENT_RX_BEAM_COMPLETE
,
ZPAL_RADIO_EVENT_TX_BEAM_COMPLETE
,
ZPAL_RADIO_EVENT_RX_ABORT
,
ZPAL_RADIO_EVENT_TX_FAIL
,
ZPAL_RADIO_EVENT_TX_FAIL_LBT
,
ZPAL_RADIO_EVENT_RXTX_CALIBRATE
,
ZPAL_RADIO_EVENT_MASK = 0x1F
,
ZPAL_RADIO_EVENT_FLAG_SUCCESS = 0x80
,
ZPAL_RADIO_EVENT_TX_TIMEOUT = 254
,
ZPAL_RADIO_EVENT_RX_TIMEOUT = 255
} |
| Enumeratio radio events. More...
|
|
enum | zpal_radio_status_t {
ZPAL_RADIO_STATUS_IDLE
,
ZPAL_RADIO_STATUS_RX
,
ZPAL_RADIO_STATUS_TX
,
ZPAL_RADIO_STATUS_TX_BEAM
,
ZPAL_RADIO_STATUS_RX_BEAM
} |
| Radio status. More...
|
|
|
void | zpal_radio_set_network_ids (uint32_t home_id, node_id_t node_id, zpal_radio_mode_t mode, uint8_t home_id_hash) |
| Sets the home ID, the node ID and the radio mode.
|
|
void | zpal_radio_init (zpal_radio_profile_t *const profile) |
| Initializes the radio.
|
|
zpal_status_t | zpal_radio_change_region (zpal_radio_region_t eRegion, zpal_radio_lr_channel_config_t eLrChCfg) |
| Function used to change region and Long Range mode at the same time.
|
|
zpal_radio_region_t | zpal_radio_get_region (void) |
| Function for getting REGION runtime.
|
|
zpal_status_t | zpal_radio_transmit (zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t frame_header_length, uint8_t const *const frame_header_buffer, uint8_t frame_payload_length, uint8_t const *const frame_payload_buffer, uint8_t use_lbt, int8_t tx_power) |
| Function for transmitting a Z-Wave frame though the radio.
|
|
zpal_status_t | zpal_radio_transmit_beam (zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t beam_data_len, uint8_t const *const beam_data, int8_t tx_power) |
| Function for transmitting a Z-Wave Beam frame though the radio.
|
|
void | zpal_radio_start_receive () |
| Starts the receiver and enables reception of frames.
|
|
void | zpal_radio_get_last_received_frame (void) |
| Function to get last received frame. If a frame is received, zpal_radio_receive_handler_t will be invoked.
|
|
void | zpal_radio_power_down (void) |
| Powers down the radio transceiver.
|
|
zpal_radio_protocol_mode_t | zpal_radio_get_protocol_mode (void) |
| Function to get the protocol mode used in the configured region.
|
|
zpal_radio_zwave_channel_t | zpal_radio_get_last_beam_channel (void) |
| Get last beam channel. Retrieve the channel on which we have last received a beam on.
|
|
int8_t | zpal_radio_get_last_beam_rssi (void) |
| Get last beam RSSI. Retrieve the RSSI of the last beam received.
|
|
void | zpal_radio_set_lbt_level (uint8_t channel, int8_t level) |
| Function for setting the LBT RSSI level.
|
|
void | zpal_radio_enable_rx_broadcast_beam (bool enable) |
| Enable or disables reception of broadcast beam. Enable or disable FLiRS broadcast address.
|
|
void | zpal_radio_clear_tx_timers (void) |
| Function for clearing current Channel Transmit timers.
|
|
void | zpal_radio_clear_network_stats (void) |
| Function for clearing current Network statistics.
|
|
void | zpal_radio_rf_channel_statistic_clear (zpal_radio_zwave_channel_t zwavechannel) |
| Function for clearing specified rf channel statistics.
|
|
bool | zpal_radio_rf_channel_statistic_get (zpal_radio_zwave_channel_t zwavechannel, zpal_radio_rf_channel_statistic_t *p_radio_channel_statistic) |
|
void | zpal_radio_rf_channel_statistic_tx_channel_set (zpal_radio_zwave_channel_t zwavechannel) |
| Function for setting the zwavechannel used when calling zpal_radio_rf_channel_statistic_tx_frames, zpal_radio_rf_channel_statistic_tx_retries and zpal_radio_rf_channel_statistic_tx_lbt_failures.
|
|
void | zpal_radio_rf_channel_statistic_tx_frames (void) |
| Function for incrementing the rf channel tx frame statistic.
|
|
void | zpal_radio_rf_channel_statistic_tx_retries (void) |
| Function for incrementing the rf channel tx retries statistic.
|
|
void | zpal_radio_rf_channel_statistic_tx_lbt_failures (void) |
| Function for incrementing the rf channel tx lbt failures.
|
|
void | zpal_radio_rf_channel_statistic_background_rssi_average_update (zpal_radio_zwave_channel_t zwavechannel, int8_t rssi) |
| Function for updating the rf channel background noise rssi average statistic.
|
|
void | zpal_radio_rf_channel_statistic_end_device_rssi_average_update (zpal_radio_zwave_channel_t zwavechannel, int8_t rssi) |
| Function for updating the rf channel end device noise rssi average statistic.
|
|
zpal_status_t | zpal_radio_get_background_rssi (uint8_t channel, int8_t *rssi) |
| Returns the background RSSI.
|
|
zpal_tx_power_t | zpal_radio_get_default_tx_power (void) |
| Function for getting the default tx power in deci dBm.
|
|
uint8_t | zpal_radio_get_reduce_tx_power (void) |
| Function for getting the current reduce RF tx power compared to the default normal power in dBm.
|
|
void | zpal_radio_enable_flirs (void) |
| Allows the radio to go into FLiRS receive mode.
|
|
bool | zpal_radio_is_flirs_enabled (void) |
| Returns whether FLiRS mode is enabled in the radio.
|
|
void | zpal_radio_start_receive_after_power_down (bool wait_for_beam) |
| Starts the receiver after power down.
|
|
void | zpal_radio_abort (void) |
| Turn radio off without changing configuration.
|
|
void | zpal_radio_reset_after_beam_receive (bool start_receiver) |
| Resets the radio configuration to receive mode after having received a beam.
|
|
bool | zpal_radio_is_fragmented_beam_enabled (void) |
| Returns whether use of fragmented beams is enabled or not for the active region.
|
|
void | zpal_radio_calibrate (void) |
| Calibrates the radio. Z-Wave expects the radio ZPAL implementation to generate a ZPAL_RADIO_EVENT_RXTX_CALIBRATE event when calibration is required. The event will invoke this function in non-interrupt context.
|
|
bool | zpal_radio_is_lbt_enabled (void) |
| Returns whether listen before talk (LBT) is enabled.
|
|
uint16_t | zpal_radio_get_beam_startup_time (void) |
| Returns the time it takes to start transmission of wake up beams. Includes time spent on LBT.
|
|
node_id_t | zpal_radio_get_beam_node_id (void) |
| Returns the node ID associated with most recently received beam frame.
|
|
zpal_tx_power_t | zpal_radio_get_minimum_lr_tx_power (void) |
| Returns the minimum transmit power for Z-Wave Long Range.
|
|
zpal_tx_power_t | zpal_radio_get_maximum_lr_tx_power (void) |
| Returns the maximum transmit power for Z-Wave Long Range.
|
|
bool | zpal_radio_is_debug_enabled (void) |
| Returns whether debug is enabled or disabled.
|
|
const zpal_radio_profile_t * | zpal_radio_get_rf_profile (void) |
| a getter on the current rf profile. Function return a pointer (instead of a struct) to reduce RAM memory usage and execution time. The pointer target a const structure because it should not be used to modify the content of the structure.
|
|
zpal_radio_lr_channel_config_t | zpal_radio_get_lr_channel_config (void) |
| Function to read current Long Range Channel Configuration.
|
|
zpal_radio_lr_channel_t | zpal_radio_get_primary_long_range_channel (void) |
| Function to read current Primary Long Range Channel.
|
|
void | zpal_radio_set_primary_long_range_channel (zpal_radio_lr_channel_t channel) |
| Function to set the Primary Long Range Channel.
|
|
bool | zpal_radio_get_long_range_channel_auto_mode (void) |
| Function to read current Long Range Channel selection mode.
|
|
void | zpal_radio_set_long_range_channel_auto_mode (bool enable) |
| Function to set the Long Range Channel selction mode.
|
|
void | zpal_radio_set_long_range_lock (bool lock) |
| Function to the set Long Range channel Locked status.
|
|
bool | zpal_radio_is_long_range_locked (void) |
| Function to read the Long Range channel Locked status.
|
|
bool | zpal_radio_is_region_supported (const zpal_radio_region_t region) |
| Function to check if the stack implementation supports a given region.
|
|
int8_t | zpal_radio_get_flirs_beam_tx_power (void) |
| Read the saved tx power of the last received long-range beam.
|
|
bool | zpal_radio_is_transmit_allowed (uint8_t channel, uint8_t frame_length, uint8_t frame_priority) |
| Check if transmission is allowed for specified channel.
|
|
bool | zpal_radio_attenuate (uint8_t adjust_tx_power) |
| Function to reduce Tx power of classic non-listening devices.
|
|
zpal_tx_power_t | zpal_radio_get_maximum_tx_power (void) |
| Return the maximum board supported tx power for classic z-wave.
|
|
void | zpal_radio_request_calibration (bool forced) |
| Function to radio calibration.
|
|
Defines a platform abstraction layer for the Z-Wave radio.
The ZPAL Radio module contains several APIs which are required to be implemented.
A user of this radio module shall first define all parameters of the Z-Wave Radio Profile (i.e., zpal_radio_profile_t) and initialise the radio using zpal_radio_init API.
After the initialisation of the radio is executed, the user can use any of the radio APIs to execute radio related paradigm for instance
The radio API assumes that the radio will return to receive mode with channel hopping enabled after transmitting a frame.
void
{
}
void
{
}
void
{
}
void
{
}
initialize_radio()
{
static uint8_t network_homeid[4] = {0xDE, 0xAD, 0xBE, 0xEF};
.tx_power_max = 0,
.tx_power_adjust = 33,
.tx_power_max_lr = 140,
.home_id = &network_homeid,
.rx_cb = RXHandlerFromISR,
.tx_cb = TXHandlerFromISR,
.region_change_cb = RegionChangeHandler,
.assert_cb = RadioAssertHandler,
.network_stats = &sNetworkStatistic,
.radio_debug_enable = false,
}
@ ELISTENBEFORETALKTRESHOLD_DEFAULT
Definition ZW_application_transport_interface.h:84
zpal_radio_event_t
Enumeratio radio events.
Definition zpal_radio.h:429
void zpal_radio_init(zpal_radio_profile_t *const profile)
Initializes the radio.
@ REGION_US
Radio is located in Region US. 2 Channel region.
Definition zpal_radio.h:343
@ ZPAL_RADIO_WAKEUP_ALWAYS_LISTEN
Node is always listening.
Definition zpal_radio.h:254
@ ZPAL_RADIO_LR_CHANNEL_A
Long Range Channel A.
Definition zpal_radio.h:287
Network statistics structure.
Definition zpal_radio.h:490
Radio Profile containing region, baud rate, and wakeup interval for this device.
Definition zpal_radio.h:523
zpal_radio_region_t region
Region in which this system operates.
Definition zpal_radio.h:524
#define TX_FAILED 0
#define TX_FRAME_SUCCESS 1
#define TX_BEAM_SUCCESS 2
.channel_id = 0,
.preamble = 0x55,
.preamble_length = 40,
.start_of_frame = 0xF0,
.repeats = 0};
{
uint8_t header_buffer[9] = {0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x41, 0x01, 14, 0x02};
uint8_t payload_buffer[3] = {0x20, 0x01, 0xFF};
9,
(uint8_t *)&header_buffer,
3,
(uint8_t *)&payload_buffer,
true,
0);
}
void
{
uint8_t status;
{
status = TX_FAILED;
}
else if (txStatus & ZPAL_RADIO_EVENT_FLAG_BEAM)
{
status = TX_BEAM_SUCCESS;
}
else
{
status = TX_FRAME_SUCCESS;
}
/ Get out of ISR context and handle transmit complete
HandleTransmitComplete(status);
}
zpal_status_t zpal_radio_transmit(zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t frame_header_length, uint8_t const *const frame_header_buffer, uint8_t frame_payload_length, uint8_t const *const frame_payload_buffer, uint8_t use_lbt, int8_t tx_power)
Function for transmitting a Z-Wave frame though the radio.
@ ZPAL_RADIO_CRC_16_BIT_CCITT
16 bit CRC-CCITT checksum.
Definition zpal_radio.h:266
@ ZPAL_RADIO_EVENT_TX_FAIL_LBT
Transmit failed because of an LBT failure.
Definition zpal_radio.h:437
@ ZPAL_RADIO_EVENT_TX_FAIL
Transmit failed.
Definition zpal_radio.h:436
@ ZPAL_RADIO_SPEED_100K
100 kbps
Definition zpal_radio.h:277
zpal_status_t
ZPAL statuses to be used by ZPAL APIs.
Definition zpal_status.h:38
Parameters required when transmitting a frame.
Definition zpal_radio.h:393
zpal_radio_speed_t speed
Channel Speed to use when transmitting a frame.
Definition zpal_radio.h:394