This is a Hardware Abstraction Layer for IEEE802.15.4 compatible radios. More...
This is a Hardware Abstraction Layer for IEEE802.15.4 compatible radios.
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... | |
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... | |
typedef void(* ieee802154_cb_t) (ieee802154_dev_t *dev, ieee802154_trx_ev_t status) |
IEEE802.15.4 CCA modes.
enum 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.
|
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_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. |
enum ieee802154_rx_mode_t |
RX mode configuration.
Enumerator | |
---|---|
IEEE802154_RX_AACK_DISABLED | Auto ACK is disabled. |
IEEE802154_RX_AACK_ENABLED | Auto ACK is enabled. |
IEEE802154_RX_AACK_FRAME_PENDING | Auto ACK is enabled and frame pending bit set in the next ACK frame. |
IEEE802154_RX_PROMISC | Radio is in promiscuous mode. |
IEEE802154_RX_WAIT_FOR_ACK | Radio is ready to receive ACK frames. This mode is optional. If a radio decides to implement it, the radio should allow ACK frames (and block ACK frames in all other RX modes). Note that this mode cannot guarantee that only ACK frames will be received. Expected to be implemented when either IEEE802154_CAP_FRAME_RETRANS or IEEE802154_CAP_IRQ_ACK_TIMEOUT is not there. |
enum 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_TX_START | the transceiver sent out a valid SFD This event is present if radio has IEEE802154_CAP_IRQ_TX_START cap.
|
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 will 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 set the transceiver state (ieee802154_radio_ops::request_set_trx_state). |
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. |
IEEE802.15.4 transceiver states (not to confuse with device states)
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:
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 |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::config_phy.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | conf | the PHY configuration |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::confirm_cca.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::confirm_on.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::confirm_set_trx_state.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::confirm_transmit.
[in] | dev | IEEE802.15.4 device descriptor |
[out] | info | the TX information |
|
inlinestatic |
Check if the device supports the IEEE802.15.4 2.4 GHz band.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_24_GHZ.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports Auto CSMA-CA for transmissions.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_AUTO_CSMA.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports frame retransmissions (with CSMA-CA).
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_FRAME_RETRANS.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device reports the number of retransmissions of the last TX procedure.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_FRAME_RETRANS_INFO.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports ACK timeout.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_IRQ_ACK_TIMEOUT.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports CCA done interrupt.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_IRQ_CCA_DONE.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports RX start interrupt.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_IRQ_RX_START.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports TX done interrupt.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_IRQ_TX_DONE.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports TX start interrupt.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_IRQ_TX_START.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Check if the device supports the IEEE802.15.4 Sub-GHz band.
Internally this function calls ieee802154_radio_ops::get_cap with IEEE802154_CAP_SUB_GHZ.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::len.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::off.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::read.
[in] | dev | IEEE802.15.4 device descriptor |
[out] | buf | buffer to write the received frame into. |
[in] | size | size of buf |
[in] | info | information of the received frame (LQI, RSSI). Can be NULL if this information is not needed. |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::request_cca.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::request_on.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::request_set_trx_state.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | state | the new state |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::request_transmit.
[in] | dev | IEEE802.15.4 device descriptor |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_cca_mode.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | mode | the CCA mode |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_cca_threshold.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | threshold | the threshold in dBm |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_csma_params.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | bd | parameters of the exponential backoff |
[in] | retries | number of CSMA-CA retries. If restries < 0, retransmissions with CSMA-CA are disabled |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_frame_retrans.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | retrans | the number of retransmissions |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_hw_addr_filter.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | short_addr | the IEEE802.15.4 short address. If NULL, the short address is not altered.. |
[in] | ext_addr | the IEEE802.15.4 extended address (Network Byte Order). If NULL, the extended address is not altered. |
[in] | pan_id | the IEEE802.15.4 PAN ID. If NULL, the PAN ID is not altered. |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::set_rx_mode.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | mode | RX mode |
|
inlinestatic |
Shortcut to ieee802154_radio_ops::write.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | psdu | PSDU frame to be sent |