IEEE802.15.4 Radio Hardware Abstraction Layer

This is a Hardware Abstraction Layer for IEEE802.15.4 compatible radios. More...

Detailed Description

This is a Hardware Abstraction Layer for IEEE802.15.4 compatible radios.

Warning
This feature is experimental! This API is experimental and in an early state - expect changes!
Author
José I. Alamos jose..nosp@m.alam.nosp@m.os@ha.nosp@m.w-ha.nosp@m.mburg.nosp@m..de

Data Structures

struct  ieee802154_csma_be_t
 CSMA-CA exponential backoff parameters. More...
 
struct  ieee802154_rx_info_t
 RX information associated to a frame. More...
 
struct  ieee802154_tx_info_t
 TX information of the last transmitted frame. More...
 
struct  ieee802154_dev
 the IEEE802.15.4 device descriptor More...
 
struct  ieee802154_phy_conf_t
 Holder of the PHY configuration. More...
 
struct  ieee802154_radio_ops
 Radio ops struct declaration. More...
 

Macros

#define IEEE802154_RF_CAPS_PHY_MASK
 Bit-mask for PHY modes capabilities. More...
 

Typedefs

typedef struct ieee802154_radio_ops ieee802154_radio_ops_t
 Forward declaration of the radio ops structure.
 
typedef struct ieee802154_dev ieee802154_dev_t
 Forward declaration of the IEEE802.15.4 device descriptor.
 
typedef void(* ieee802154_cb_t) (ieee802154_dev_t *dev, ieee802154_trx_ev_t status)
 Prototype of the IEEE802.15.4 device event callback. More...
 

Enumerations

enum  ieee802154_rf_caps_t {
  IEEE802154_CAP_FRAME_RETRANS = BIT0, IEEE802154_CAP_AUTO_CSMA = BIT1, IEEE802154_CAP_IRQ_ACK_TIMEOUT = BIT2, IEEE802154_CAP_24_GHZ = BIT3,
  IEEE802154_CAP_SUB_GHZ = BIT4, IEEE802154_CAP_IRQ_CRC_ERROR = BIT5, IEEE802154_CAP_IRQ_TX_DONE = BIT6, IEEE802154_CAP_IRQ_RX_START = BIT7,
  IEEE802154_CAP_IRQ_TX_START = BIT8, IEEE802154_CAP_IRQ_CCA_DONE = BIT9, IEEE802154_CAP_FRAME_RETRANS_INFO = BIT10, IEEE802154_CAP_REG_RETENTION = BIT11,
  IEEE802154_CAP_PHY_BPSK = BIT12, IEEE802154_CAP_PHY_ASK = BIT13, IEEE802154_CAP_PHY_OQPSK = BIT14, IEEE802154_CAP_PHY_MR_OQPSK = BIT15,
  IEEE802154_CAP_PHY_MR_OFDM = BIT16, IEEE802154_CAP_PHY_MR_FSK = BIT17, IEEE802154_CAP_SRC_ADDR_MATCH = BIT18, IEEE802154_CAP_RX_CONTINUOUS = BIT19
}
 IEEE802.15.4 Radio capabilities. More...
 
enum  ieee802154_tx_status_t { TX_STATUS_SUCCESS, TX_STATUS_FRAME_PENDING, TX_STATUS_NO_ACK, TX_STATUS_MEDIUM_BUSY }
 Transmission status. More...
 
enum  ieee802154_trx_state_t { IEEE802154_TRX_STATE_TRX_OFF, IEEE802154_TRX_STATE_RX_ON, IEEE802154_TRX_STATE_TX_ON }
 IEEE802.15.4 transceiver states (not to confuse with device states) More...
 
enum  ieee802154_trx_ev_t {
  IEEE802154_RADIO_INDICATION_RX_START, IEEE802154_RADIO_INDICATION_CRC_ERROR, IEEE802154_RADIO_INDICATION_TX_START, IEEE802154_RADIO_INDICATION_RX_DONE,
  IEEE802154_RADIO_CONFIRM_TX_DONE, IEEE802154_RADIO_CONFIRM_CCA
}
 IEEE802.15.4 Radio HAL events. More...
 
enum  ieee802154_src_match_t {
  IEEE802154_SRC_MATCH_EN, IEEE802154_SRC_MATCH_SHORT_ADD, IEEE802154_SRC_MATCH_SHORT_CLEAR, IEEE802154_SRC_MATCH_EXT_ADD,
  IEEE802154_SRC_MATCH_EXT_CLEAR
}
 Source Address Match commands. More...
 
enum  ieee802154_af_cmd_t { IEEE802154_AF_SHORT_ADDR, IEEE802154_AF_EXT_ADDR, IEEE802154_AF_PANID, IEEE802154_AF_PAN_COORD }
 Address filter command. More...
 
enum  ieee802154_filter_mode_t { IEEE802154_FILTER_ACCEPT, IEEE802154_FILTER_ACK_ONLY, IEEE802154_FILTER_PROMISC, IEEE802154_FILTER_SNIFFER }
 Frame Filter mode. More...
 
enum  ieee802154_cca_mode_t { IEEE802154_CCA_MODE_ED_THRESHOLD, IEEE802154_CCA_MODE_CARRIER_SENSING, IEEE802154_CCA_MODE_ED_THRESH_AND_CS, IEEE802154_CCA_MODE_ED_THRESH_OR_CS }
 IEEE802.15.4 CCA modes. More...
 

Functions

static int ieee802154_radio_write (ieee802154_dev_t *dev, const iolist_t *psdu)
 Shortcut to ieee802154_radio_ops::write. More...
 
static int ieee802154_radio_request_transmit (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::request_transmit. More...
 
static int ieee802154_radio_confirm_transmit (ieee802154_dev_t *dev, ieee802154_tx_info_t *info)
 Shortcut to ieee802154_radio_ops::confirm_transmit. More...
 
static int ieee802154_radio_len (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::len. More...
 
static int ieee802154_radio_read (ieee802154_dev_t *dev, void *buf, size_t size, ieee802154_rx_info_t *info)
 Shortcut to ieee802154_radio_ops::read. More...
 
static int ieee802154_radio_set_cca_threshold (ieee802154_dev_t *dev, int8_t threshold)
 Shortcut to ieee802154_radio_ops::set_cca_threshold. More...
 
static int ieee802154_radio_set_cca_mode (ieee802154_dev_t *dev, ieee802154_cca_mode_t mode)
 Shortcut to ieee802154_radio_ops::set_cca_mode. More...
 
static int ieee802154_radio_config_phy (ieee802154_dev_t *dev, const ieee802154_phy_conf_t *conf)
 Shortcut to ieee802154_radio_ops::config_phy. More...
 
static int ieee802154_radio_config_src_address_match (ieee802154_dev_t *dev, ieee802154_src_match_t cmd, const void *value)
 Shortcut to ieee802154_radio_ops::config_src_addr_match. More...
 
static int ieee802154_radio_off (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::off. More...
 
static int ieee802154_radio_config_addr_filter (ieee802154_dev_t *dev, ieee802154_af_cmd_t cmd, const void *value)
 Shortcut to ieee802154_radio_ops::config_addr_filter. More...
 
static int ieee802154_radio_set_frame_filter_mode (ieee802154_dev_t *dev, ieee802154_filter_mode_t mode)
 Shortcut to ieee802154_radio_ops::set_frame_filter_mode. More...
 
static int ieee802154_radio_set_frame_retrans (ieee802154_dev_t *dev, uint8_t retrans)
 Shortcut to ieee802154_radio_ops::set_frame_retrans. More...
 
static int ieee802154_radio_set_csma_params (ieee802154_dev_t *dev, const ieee802154_csma_be_t *bd, int8_t retries)
 Shortcut to ieee802154_radio_ops::set_csma_params. More...
 
static int ieee802154_radio_request_on (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::request_on. More...
 
static int ieee802154_radio_confirm_on (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::confirm_on. More...
 
static int ieee802154_radio_request_set_trx_state (ieee802154_dev_t *dev, ieee802154_trx_state_t state)
 Shortcut to ieee802154_radio_ops::request_set_trx_state. More...
 
static int ieee802154_radio_confirm_set_trx_state (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::confirm_set_trx_state. More...
 
static int ieee802154_radio_request_cca (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::request_cca. More...
 
static int ieee802154_radio_confirm_cca (ieee802154_dev_t *dev)
 Shortcut to ieee802154_radio_ops::confirm_cca. More...
 
static bool ieee802154_radio_has_irq_ack_timeout (ieee802154_dev_t *dev)
 Check if the device supports ACK timeout. More...
 
static bool ieee802154_radio_has_frame_retrans (ieee802154_dev_t *dev)
 Check if the device supports frame retransmissions (with CSMA-CA). More...
 
static bool ieee802154_radio_has_auto_csma (ieee802154_dev_t *dev)
 Check if the device supports Auto CSMA-CA for transmissions. More...
 
static bool ieee802154_radio_has_sub_ghz (ieee802154_dev_t *dev)
 Check if the device supports the IEEE802.15.4 Sub-GHz band. More...
 
static bool ieee802154_radio_has_24_ghz (ieee802154_dev_t *dev)
 Check if the device supports the IEEE802.15.4 2.4 GHz band. More...
 
static bool ieee802154_radio_has_irq_tx_done (ieee802154_dev_t *dev)
 Check if the device supports TX done interrupt. More...
 
static bool ieee802154_radio_has_irq_rx_start (ieee802154_dev_t *dev)
 Check if the device supports RX start interrupt. More...
 
static bool ieee802154_radio_has_irq_tx_start (ieee802154_dev_t *dev)
 Check if the device supports TX start interrupt. More...
 
static bool ieee802154_radio_has_irq_cca_done (ieee802154_dev_t *dev)
 Check if the device supports CCA done interrupt. More...
 
static bool ieee802154_radio_has_frame_retrans_info (ieee802154_dev_t *dev)
 Check if the device reports the number of retransmissions of the last TX procedure. More...
 
static bool ieee802154_radio_has_phy_bpsk (ieee802154_dev_t *dev)
 Check if the device supports the BPSK PHY mode. More...
 
static bool ieee802154_radio_has_phy_ask (ieee802154_dev_t *dev)
 Check if the device supports the ASK PHY mode. More...
 
static bool ieee802154_radio_has_phy_oqpsk (ieee802154_dev_t *dev)
 Check if the device supports the O-QPSK PHY mode. More...
 
static bool ieee802154_radio_has_phy_mr_oqpsk (ieee802154_dev_t *dev)
 Check if the device supports the MR-O-QPSK PHY mode. More...
 
static bool ieee802154_radio_has_phy_mr_ofdm (ieee802154_dev_t *dev)
 Check if the device supports the MR-OFDM PHY mode. More...
 
static bool ieee802154_radio_has_phy_mr_fsk (ieee802154_dev_t *dev)
 Check if the device supports the MR-FSK PHY mode. More...
 
static uint32_t ieee802154_radio_get_phy_modes (ieee802154_dev_t *dev)
 Get supported PHY modes of the device. More...
 
static bool ieee802154_radio_has_rx_continuous (ieee802154_dev_t *dev)
 Check whether the radio stays in RX_ON after IEEE802154_RADIO_INDICATION_RX_DONE or IEEE802154_RADIO_INDICATION_CRC_ERROR events (see IEEE802154_CAP_RX_CONTINUOUS) More...
 
static uint32_t ieee802154_phy_mode_to_cap (ieee802154_phy_mode_t phy_mode)
 Convert a ieee802154_phy_mode_t to a ieee802154_rf_caps_t value. More...
 
static ieee802154_phy_mode_t ieee802154_cap_to_phy_mode (uint32_t cap)
 Convert a ieee802154_rf_caps_t to a ieee802154_phy_mode_t value. More...
 

Macro Definition Documentation

◆ IEEE802154_RF_CAPS_PHY_MASK

#define IEEE802154_RF_CAPS_PHY_MASK
Value:
Amplitude-Shift Keying PHY mode.
Definition: radio.h:134
Multi-Rate Offset Quadrature Phase-Shift Keying PHY mode.
Definition: radio.h:142
Multi-Rate Frequency Shift Keying PHY mode.
Definition: radio.h:150
Multi-Rate Orthogonal Frequency-Division Multiplexing PHY mode.
Definition: radio.h:146
Binary Phase Shift Keying PHY mode.
Definition: radio.h:130
Offset Quadrature Phase-Shift Keying.
Definition: radio.h:138

Bit-mask for PHY modes capabilities.

Definition at line 177 of file radio.h.

Typedef Documentation

◆ ieee802154_cb_t

typedef void(* ieee802154_cb_t) (ieee802154_dev_t *dev, ieee802154_trx_ev_t status)

Prototype of the IEEE802.15.4 device event callback.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]statusthe status

Definition at line 433 of file radio.h.

Enumeration Type Documentation

◆ ieee802154_af_cmd_t

Address filter command.

Enumerator
IEEE802154_AF_SHORT_ADDR 

Set short IEEE 802.15.4 address (network_uint16_t)

IEEE802154_AF_EXT_ADDR 

Set extended IEEE 802.15.4 address (eui64_t)

IEEE802154_AF_PANID 

Set PAN ID (uint16_t)

IEEE802154_AF_PAN_COORD 

Set device as PAN coordinator (bool)

Definition at line 355 of file radio.h.

◆ ieee802154_cca_mode_t

IEEE802.15.4 CCA modes.

Enumerator
IEEE802154_CCA_MODE_ED_THRESHOLD 

CCA using first mode (energy detection)

IEEE802154_CCA_MODE_CARRIER_SENSING 

CCA using second mode (carrier sensing)

IEEE802154_CCA_MODE_ED_THRESH_AND_CS 

CCA using third mode (energy detection AND carrier sensing)

IEEE802154_CCA_MODE_ED_THRESH_OR_CS 

CCA using third mode (energy detection OR carrier sensing)

Definition at line 457 of file radio.h.

◆ ieee802154_filter_mode_t

Frame Filter mode.

Enumerator
IEEE802154_FILTER_ACCEPT 

accept all valid frames that match address filter configuration

IEEE802154_FILTER_ACK_ONLY 

accept only ACK frames

Note
This mode should only be implemented if the transceiver doesn't handle ACK frame reception (when IEEE802154_CAP_FRAME_RETRANS and IEEE802154_CAP_IRQ_ACK_TIMEOUT are not present).
IEEE802154_FILTER_PROMISC 

accept all valid frames

Note
This mode is optional
IEEE802154_FILTER_SNIFFER 

accept all frames, regardless of FCS

Note
This mode is optional

Definition at line 365 of file radio.h.

◆ ieee802154_rf_caps_t

IEEE802.15.4 Radio capabilities.

These flags represent the hardware capabilities of a given device.

Enumerator
IEEE802154_CAP_FRAME_RETRANS 

the device supports frame retransmissions with CSMA-CA

The device supports sending with CSMA-CA and retransmissions. If the CSMA-CA fails, the device reports a TX_STATUS_MEDIUM_BUSY when calling ieee802154_radio_ops::confirm_transmit. In case CSMA-CA succeeds and the ACK frame is expected, the device reports a TX_STATUS_SUCCESS if the ACK frame is received during any retransmission attempt. Otherwise, it reports a TX_STATUS_NO_ACK

ACK frames are not indicated to the upper layer.

Note
it's implicit that a radio supports IEEE802154_CAP_AUTO_CSMA if this cap is available
IEEE802154_CAP_AUTO_CSMA 

the device supports Auto CSMA-CA

The device supports performing CSMA-CA before transmitting a frame. If CSMA-CA procedure succeeds, the device sends the frame and reports a TX_STATUS_SUCCESS when calling ieee802154_radio_ops::confirm_transmit. If it fails, the device reports TX_STATUS_MEDIUM_BUSY.

IEEE802154_CAP_IRQ_ACK_TIMEOUT 

the device support ACK timeout interrupt

The device will automatically attempt to receive and handle the ACK frame if expected. If the ACK frame is not received, the device reports TX_STATUS_NO_ACK when calling ieee802154_radio_ops::confirm_transmit. Otherwise, it reports TX_STATUS_SUCCESS.

The ACK frame is not indicated to the upper layer.

IEEE802154_CAP_24_GHZ 

the device supports the IEEE802.15.4 2.4 GHz band

It's assumed that IEEE802154_CAP_IRQ_TX_DONE is present.

IEEE802154_CAP_SUB_GHZ 

the device support the IEEE802.15.4 Sub GHz band

IEEE802154_CAP_IRQ_CRC_ERROR 

the device reports reception off frames with invalid CRC.

IEEE802154_CAP_IRQ_TX_DONE 

the device reports when the transmission is done

IEEE802154_CAP_IRQ_RX_START 

the device reports the start of a frame (SFD) when received.

IEEE802154_CAP_IRQ_TX_START 

the device reports the start of a frame (SFD) was sent.

IEEE802154_CAP_IRQ_CCA_DONE 

the device reports the end of the CCA procedure

IEEE802154_CAP_FRAME_RETRANS_INFO 

the device provides the number of retransmissions

It's assumed that IEEE802154_CAP_FRAME_RETRANS is present.

IEEE802154_CAP_REG_RETENTION 

the device retains all register values when off.

IEEE802154_CAP_PHY_BPSK 

Binary Phase Shift Keying PHY mode.

IEEE802154_CAP_PHY_ASK 

Amplitude-Shift Keying PHY mode.

IEEE802154_CAP_PHY_OQPSK 

Offset Quadrature Phase-Shift Keying.

IEEE802154_CAP_PHY_MR_OQPSK 

Multi-Rate Offset Quadrature Phase-Shift Keying PHY mode.

IEEE802154_CAP_PHY_MR_OFDM 

Multi-Rate Orthogonal Frequency-Division Multiplexing PHY mode.

IEEE802154_CAP_PHY_MR_FSK 

Multi-Rate Frequency Shift Keying PHY mode.

IEEE802154_CAP_SRC_ADDR_MATCH 

the device supports source address match table.

A Source Address Match table contains source addresses with pending data. When a coordinator device receives an IEEE 802.15.4 Data Request command from a child node, the Frame Pending bit of the ACK is set if the source address matches one from the table.

IEEE802154_CAP_RX_CONTINUOUS 

the device stays in RX_ON on IEEE802154_RADIO_INDICATION_RX_DONE or IEEE802154_RADIO_INDICATION_CRC_ERROR

Radios that provide this feature don't need to call ieee802154_radio_request_set_trx_state on after receiving a frame, in case more frames are expected. This does not affect Framebuffer protection (e.g a radio might still be listening but its framebuffer is locked because the upper layer didn't call ieee802154_radio_read)

Definition at line 47 of file radio.h.

◆ ieee802154_src_match_t

Source Address Match commands.

Enumerator
IEEE802154_SRC_MATCH_EN 

Enable or disable source address match.

Enabling it sets the frame pending to all ACK frames in response to a Data Request command (if the radio doesn't support Source Address Matching) or to a specific address in the Source Address Matching table

IEEE802154_SRC_MATCH_SHORT_ADD 

Add a short address to entry.

This command should only be implemented if IEEE802154_CAP_SRC_ADDR_MATCH is available.

IEEE802154_SRC_MATCH_SHORT_CLEAR 

Clear short address from entry.

This command should only be implemented if IEEE802154_CAP_SRC_ADDR_MATCH is available.

IEEE802154_SRC_MATCH_EXT_ADD 

Add a extended address to entry.

This command should only be implemented if IEEE802154_CAP_SRC_ADDR_MATCH is available.

IEEE802154_SRC_MATCH_EXT_CLEAR 

Clear extended address from entry.

This command should only be implemented if IEEE802154_CAP_SRC_ADDR_MATCH is available.

Definition at line 314 of file radio.h.

◆ ieee802154_trx_ev_t

IEEE802.15.4 Radio HAL events.

To follow the IEEE802.15.4 convention, an event that responds to a Request is a confirmation (Confirm). Otherwise an Indication.

Enumerator
IEEE802154_RADIO_INDICATION_RX_START 

the transceiver detected a valid SFD

This event is present if radio has IEEE802154_CAP_IRQ_RX_START cap.

IEEE802154_RADIO_INDICATION_CRC_ERROR 

the transceiver received a frame with an invalid crc.

The transceiver might not stay in IEEE802154_TRX_STATE_RX_ON after receiving an invalid CRC. Therefore the upper layer must set the transceiver state (ieee802154_radio_ops::request_set_trx_state). e.g.: IEEE802154_TRX_STATE_TRX_OFF or IEEE802154_TRX_STATE_TX_ON to stop listening or IEEE802154_TRX_STATE_RX_ON to keep listening.

IEEE802154_RADIO_INDICATION_TX_START 

the transceiver sent out a valid SFD

This event is present if radio has IEEE802154_CAP_IRQ_TX_START cap.

Note
The SFD of an outgoing ACK (AUTOACK) should not be indicated
IEEE802154_RADIO_INDICATION_RX_DONE 

the transceiver received a frame and lies in the internal framebuffer.

This indication should be generated only if CRC is valid and the frame passes the address matching filter (this includes ACK and Beacon frames). The latter only applies if the radio is not in promiscuous mode.

The transceiver or driver MUST handle the ACK reply if the Ack Request bit is set in the received frame and promiscuous mode is disabled.

The transceiver might be in a "FB Lock" state where no more frames are received. This is done in order to avoid overwriting the Frame Buffer with new frame arrivals. In order to leave this state, the upper layer must call ieee802154_radio_ops::read.

IEEE802154_RADIO_CONFIRM_TX_DONE 

the transceiver either finished sending a frame, the retransmission procedure or the channel activity detection prior transmission.

This event is present if radio has IEEE802154_CAP_IRQ_TX_DONE cap. The upper layer should immediately call ieee802154_radio_ops::confirm_transmit when on this event.

IEEE802154_RADIO_CONFIRM_CCA 

the CCA procedure finished

This event is present if radio has IEEE802154_CAP_IRQ_CCA_DONE.

Definition at line 247 of file radio.h.

◆ ieee802154_trx_state_t

IEEE802.15.4 transceiver states (not to confuse with device states)

Enumerator
IEEE802154_TRX_STATE_TRX_OFF 

the transceiver state is off

IEEE802154_TRX_STATE_RX_ON 

the transceiver is ready to receive/receiving frames

IEEE802154_TRX_STATE_TX_ON 

the transceiver is ready to transmit/transmitting a frame

Definition at line 226 of file radio.h.

◆ ieee802154_tx_status_t

Transmission status.

Enumerator
TX_STATUS_SUCCESS 

the transceiver successfully sent a frame.

Depending of the type of transmissions and available caps, this could mean one of the following:

If the device supports IEEE802154_CAP_FRAME_RETRANS or IEEE802154_CAP_IRQ_ACK_TIMEOUT this means either:

  • The frame was sent without ACK Req bit
  • The frame was sent with the ACK Req bit and a valid ACK was received.

Otherwise, this notifies that a frame was sent.

TX_STATUS_FRAME_PENDING 

the transceiver received a valid ACK with the frame pending bit

This status is present only if the device supports IEEE802154_CAP_FRAME_RETRANS or IEEE802154_CAP_IRQ_ACK_TIMEOUT.

TX_STATUS_NO_ACK 

the transceiver ran out of retransmission

This status is present only if the device supports IEEE802154_CAP_FRAME_RETRANS or IEEE802154_CAP_IRQ_ACK_TIMEOUT.

TX_STATUS_MEDIUM_BUSY 

the CSMA-CA algorithm or CCA failed to measure a clear channel

Definition at line 188 of file radio.h.

Function Documentation

◆ ieee802154_cap_to_phy_mode()

static ieee802154_phy_mode_t ieee802154_cap_to_phy_mode ( uint32_t  cap)
inlinestatic

Convert a ieee802154_rf_caps_t to a ieee802154_phy_mode_t value.

Note
The parameter must be one of the PHY capabilities.
Parameters
[in]capThe IEEE 802.15.4 capability.
Returns
Equivalent phy mode given the capability.
0 on invalid values

Definition at line 1488 of file radio.h.

◆ ieee802154_phy_mode_to_cap()

static uint32_t ieee802154_phy_mode_to_cap ( ieee802154_phy_mode_t  phy_mode)
inlinestatic

Convert a ieee802154_phy_mode_t to a ieee802154_rf_caps_t value.

Parameters
[in]phy_modePHY mode
Returns
Equivalent capability given the PHY mode.
0 on invalid values
0 when IEEE802154_PHY_DISABLED is given as the parameter.

Definition at line 1452 of file radio.h.

◆ ieee802154_radio_config_addr_filter()

static int ieee802154_radio_config_addr_filter ( ieee802154_dev_t dev,
ieee802154_af_cmd_t  cmd,
const void *  value 
)
inlinestatic

Shortcut to ieee802154_radio_ops::config_addr_filter.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]cmdcommand for the address filter
[in]valuevalue for cmd.
Returns
result of ieee802154_radio_ops::config_addr_filter

Definition at line 1017 of file radio.h.

◆ ieee802154_radio_config_phy()

static int ieee802154_radio_config_phy ( ieee802154_dev_t dev,
const ieee802154_phy_conf_t conf 
)
inlinestatic

Shortcut to ieee802154_radio_ops::config_phy.

Precondition
the transceiver state is IEEE802154_TRX_STATE_TRX_OFF
Parameters
[in]devIEEE802.15.4 device descriptor
[in]confthe PHY configuration
Returns
result of ieee802154_radio_ops::config_phy

Definition at line 968 of file radio.h.

◆ ieee802154_radio_config_src_address_match()

static int ieee802154_radio_config_src_address_match ( ieee802154_dev_t dev,
ieee802154_src_match_t  cmd,
const void *  value 
)
inlinestatic

Shortcut to ieee802154_radio_ops::config_src_addr_match.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]cmdcommand for the source address match configuration
[in]valuevalue associated to cmd.
Returns
result of ieee802154_radio_ops::config_src_addr_match

Definition at line 985 of file radio.h.

◆ ieee802154_radio_confirm_cca()

static int ieee802154_radio_confirm_cca ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::confirm_cca.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::confirm_cca

Definition at line 1148 of file radio.h.

◆ ieee802154_radio_confirm_on()

static int ieee802154_radio_confirm_on ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::confirm_on.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::confirm_on

Definition at line 1098 of file radio.h.

◆ ieee802154_radio_confirm_set_trx_state()

static int ieee802154_radio_confirm_set_trx_state ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::confirm_set_trx_state.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::confirm_set_trx_state

Definition at line 1124 of file radio.h.

◆ ieee802154_radio_confirm_transmit()

static int ieee802154_radio_confirm_transmit ( ieee802154_dev_t dev,
ieee802154_tx_info_t info 
)
inlinestatic

Shortcut to ieee802154_radio_ops::confirm_transmit.

Parameters
[in]devIEEE802.15.4 device descriptor
[out]infothe TX information
Returns
result of ieee802154_radio_ops::confirm_transmit

Definition at line 893 of file radio.h.

◆ ieee802154_radio_get_phy_modes()

static uint32_t ieee802154_radio_get_phy_modes ( ieee802154_dev_t dev)
inlinestatic

Get supported PHY modes of the device.

Internally this function reads ieee802154_radio_ops::caps and returns only the bits from IEEE802154_RF_CAPS_PHY_MASK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
PHY modes bit mask.

Definition at line 1421 of file radio.h.

◆ ieee802154_radio_has_24_ghz()

static bool ieee802154_radio_has_24_ghz ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the IEEE802.15.4 2.4 GHz band.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_24_GHZ.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1228 of file radio.h.

◆ ieee802154_radio_has_auto_csma()

static bool ieee802154_radio_has_auto_csma ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports Auto CSMA-CA for transmissions.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_AUTO_CSMA.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1196 of file radio.h.

◆ ieee802154_radio_has_frame_retrans()

static bool ieee802154_radio_has_frame_retrans ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports frame retransmissions (with CSMA-CA).

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_FRAME_RETRANS.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1180 of file radio.h.

◆ ieee802154_radio_has_frame_retrans_info()

static bool ieee802154_radio_has_frame_retrans_info ( ieee802154_dev_t dev)
inlinestatic

Check if the device reports the number of retransmissions of the last TX procedure.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_FRAME_RETRANS_INFO.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1309 of file radio.h.

◆ ieee802154_radio_has_irq_ack_timeout()

static bool ieee802154_radio_has_irq_ack_timeout ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports ACK timeout.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_IRQ_ACK_TIMEOUT.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1164 of file radio.h.

◆ ieee802154_radio_has_irq_cca_done()

static bool ieee802154_radio_has_irq_cca_done ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports CCA done interrupt.

Internally this function reads ieee802154_radio_ops::caps with IEEE802154_CAP_IRQ_CCA_DONE.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1292 of file radio.h.

◆ ieee802154_radio_has_irq_rx_start()

static bool ieee802154_radio_has_irq_rx_start ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports RX start interrupt.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_IRQ_RX_START.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1260 of file radio.h.

◆ ieee802154_radio_has_irq_tx_done()

static bool ieee802154_radio_has_irq_tx_done ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports TX done interrupt.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_IRQ_TX_DONE.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1244 of file radio.h.

◆ ieee802154_radio_has_irq_tx_start()

static bool ieee802154_radio_has_irq_tx_start ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports TX start interrupt.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_IRQ_TX_START.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1276 of file radio.h.

◆ ieee802154_radio_has_phy_ask()

static bool ieee802154_radio_has_phy_ask ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the ASK PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_ASK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1342 of file radio.h.

◆ ieee802154_radio_has_phy_bpsk()

static bool ieee802154_radio_has_phy_bpsk ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the BPSK PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_BPSK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1326 of file radio.h.

◆ ieee802154_radio_has_phy_mr_fsk()

static bool ieee802154_radio_has_phy_mr_fsk ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the MR-FSK PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_MR_FSK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1406 of file radio.h.

◆ ieee802154_radio_has_phy_mr_ofdm()

static bool ieee802154_radio_has_phy_mr_ofdm ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the MR-OFDM PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_MR_OFDM.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1390 of file radio.h.

◆ ieee802154_radio_has_phy_mr_oqpsk()

static bool ieee802154_radio_has_phy_mr_oqpsk ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the MR-O-QPSK PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_MR_OQPSK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1374 of file radio.h.

◆ ieee802154_radio_has_phy_oqpsk()

static bool ieee802154_radio_has_phy_oqpsk ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the O-QPSK PHY mode.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_PHY_OQPSK.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1358 of file radio.h.

◆ ieee802154_radio_has_rx_continuous()

static bool ieee802154_radio_has_rx_continuous ( ieee802154_dev_t dev)
inlinestatic

Check whether the radio stays in RX_ON after IEEE802154_RADIO_INDICATION_RX_DONE or IEEE802154_RADIO_INDICATION_CRC_ERROR events (see IEEE802154_CAP_RX_CONTINUOUS)

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device stays in RX_ON state
false otherwise

Definition at line 1437 of file radio.h.

◆ ieee802154_radio_has_sub_ghz()

static bool ieee802154_radio_has_sub_ghz ( ieee802154_dev_t dev)
inlinestatic

Check if the device supports the IEEE802.15.4 Sub-GHz band.

Internally this function reads ieee802154_radio_ops::caps and checks for IEEE802154_CAP_SUB_GHZ.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
true if the device has support
false otherwise

Definition at line 1212 of file radio.h.

◆ ieee802154_radio_len()

static int ieee802154_radio_len ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::len.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::len

Definition at line 906 of file radio.h.

◆ ieee802154_radio_off()

static int ieee802154_radio_off ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::off.

Parameters
[in]devIEEE802.15.4 device descriptor
Postcondition
the transceiver state is IEEE802154_TRX_STATE_TRX_OFF
Returns
result of ieee802154_radio_ops::off

Definition at line 1001 of file radio.h.

◆ ieee802154_radio_read()

static int ieee802154_radio_read ( ieee802154_dev_t dev,
void *  buf,
size_t  size,
ieee802154_rx_info_t info 
)
inlinestatic

Shortcut to ieee802154_radio_ops::read.

Parameters
[in]devIEEE802.15.4 device descriptor
[out]bufbuffer to write the received frame into.
[in]sizesize of buf
[in]infoinformation of the received frame (LQI, RSSI). Can be NULL if this information is not needed.
Returns
result of ieee802154_radio_ops::read

Definition at line 922 of file radio.h.

◆ ieee802154_radio_request_cca()

static int ieee802154_radio_request_cca ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::request_cca.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::request_cca

Definition at line 1136 of file radio.h.

◆ ieee802154_radio_request_on()

static int ieee802154_radio_request_on ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::request_on.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::request_on

Definition at line 1086 of file radio.h.

◆ ieee802154_radio_request_set_trx_state()

static int ieee802154_radio_request_set_trx_state ( ieee802154_dev_t dev,
ieee802154_trx_state_t  state 
)
inlinestatic

Shortcut to ieee802154_radio_ops::request_set_trx_state.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]statethe new state
Returns
result of ieee802154_radio_ops::request_set_trx_state

Definition at line 1111 of file radio.h.

◆ ieee802154_radio_request_transmit()

static int ieee802154_radio_request_transmit ( ieee802154_dev_t dev)
inlinestatic

Shortcut to ieee802154_radio_ops::request_transmit.

Parameters
[in]devIEEE802.15.4 device descriptor
Returns
result of ieee802154_radio_ops::request_transmit

Definition at line 880 of file radio.h.

◆ ieee802154_radio_set_cca_mode()

static int ieee802154_radio_set_cca_mode ( ieee802154_dev_t dev,
ieee802154_cca_mode_t  mode 
)
inlinestatic

Shortcut to ieee802154_radio_ops::set_cca_mode.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]modethe CCA mode
Returns
result of ieee802154_radio_ops::set_cca_mode

Definition at line 952 of file radio.h.

◆ ieee802154_radio_set_cca_threshold()

static int ieee802154_radio_set_cca_threshold ( ieee802154_dev_t dev,
int8_t  threshold 
)
inlinestatic

Shortcut to ieee802154_radio_ops::set_cca_threshold.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]thresholdthe threshold in dBm
Returns
result of ieee802154_radio_ops::set_cca_threshold

Definition at line 938 of file radio.h.

◆ ieee802154_radio_set_csma_params()

static int ieee802154_radio_set_csma_params ( ieee802154_dev_t dev,
const ieee802154_csma_be_t bd,
int8_t  retries 
)
inlinestatic

Shortcut to ieee802154_radio_ops::set_csma_params.

Precondition
the device is on
the device supports frame retransmissions (ieee802154_radio_has_frame_retrans() == true)
Parameters
[in]devIEEE802.15.4 device descriptor
[in]bdparameters of the exponential backoff
[in]retriesnumber of CSMA-CA retries. If restries < 0, retransmissions with CSMA-CA are disabled
Returns
result of ieee802154_radio_ops::set_csma_params

Definition at line 1072 of file radio.h.

◆ ieee802154_radio_set_frame_filter_mode()

static int ieee802154_radio_set_frame_filter_mode ( ieee802154_dev_t dev,
ieee802154_filter_mode_t  mode 
)
inlinestatic

Shortcut to ieee802154_radio_ops::set_frame_filter_mode.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]modeframe filter mode
Returns
result of ieee802154_radio_ops::set_frame_filter_mode

Definition at line 1034 of file radio.h.

◆ ieee802154_radio_set_frame_retrans()

static int ieee802154_radio_set_frame_retrans ( ieee802154_dev_t dev,
uint8_t  retrans 
)
inlinestatic

Shortcut to ieee802154_radio_ops::set_frame_retrans.

Precondition
the device is on
the device supports frame retransmissions (ieee802154_radio_has_frame_retrans() == true)
Parameters
[in]devIEEE802.15.4 device descriptor
[in]retransthe number of retransmissions
Returns
result of ieee802154_radio_ops::set_frame_retrans

Definition at line 1052 of file radio.h.

◆ ieee802154_radio_write()

static int ieee802154_radio_write ( ieee802154_dev_t dev,
const iolist_t psdu 
)
inlinestatic

Shortcut to ieee802154_radio_ops::write.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]psduPSDU frame to be sent
Returns
result of ieee802154_radio_ops::write

Definition at line 868 of file radio.h.