nrfxlib API 0.1.0
Loading...
Searching...
No Matches
nrf_802154.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "nrf_802154_callouts.h"
#include "nrf_802154_config.h"
#include "nrf_802154_types.h"
#include "nrf_802154_common_utils.h"
#include "nrf_802154_irq_handlers.h"
#include "nrf_802154_sl_ant_div.h"

Go to the source code of this file.

Macros

#define NRF_802154_NO_TIMESTAMP   0
 Timestamp value indicating that the timestamp is inaccurate.
 
#define NRF_802154_RESERVED_INVALID_ID   UINT32_MAX
 Invalid delayed timeslot identifier.
 
#define NRF_802154_RESERVED_IMM_RX_WINDOW_ID   (UINT32_MAX - 1)
 Reception window identifier reserved for immediate reception.
 
#define NRF_802154_RESERVED_DRX_ID_UPPER_BOUND   (UINT32_MAX - 4)
 Upper bound for delayed reception window identifiers used by the application.
 
#define NRF_802154_MAX_PENDING_NOTIFICATIONS    (NRF_802154_RX_BUFFERS + NRF_802154_MAX_DISREGARDABLE_NOTIFICATIONS + 4 + 1)
 Maximum number of simultaneously pending notifications the driver can issue.
 

Functions

void nrf_802154_init (void)
 Initializes the 802.15.4 driver.
 
void nrf_802154_deinit (void)
 Deinitializes the 802.15.4 driver.
 
void nrf_802154_channel_set (uint8_t channel)
 Sets the channel on which the radio is to operate.
 
uint8_t nrf_802154_channel_get (void)
 Gets the channel on which the radio operates.
 
void nrf_802154_tx_power_set (int8_t power)
 Sets the transmit power.
 
int8_t nrf_802154_tx_power_get (void)
 Gets the currently set transmit power.
 
bool nrf_802154_antenna_diversity_rx_mode_set (nrf_802154_sl_ant_div_mode_t mode)
 Sets the antenna diversity rx mode.
 
nrf_802154_sl_ant_div_mode_t nrf_802154_antenna_diversity_rx_mode_get (void)
 Gets current antenna diversity rx mode.
 
bool nrf_802154_antenna_diversity_tx_mode_set (nrf_802154_sl_ant_div_mode_t mode)
 Sets the antenna diversity tx mode.
 
nrf_802154_sl_ant_div_mode_t nrf_802154_antenna_diversity_tx_mode_get (void)
 Gets current antenna diversity tx mode.
 
bool nrf_802154_antenna_diversity_rx_antenna_set (nrf_802154_sl_ant_div_antenna_t antenna)
 Manually selects the antenna to be used for rx.
 
nrf_802154_sl_ant_div_antenna_t nrf_802154_antenna_diversity_rx_antenna_get (void)
 Gets antenna currently used for rx.
 
bool nrf_802154_antenna_diversity_tx_antenna_set (nrf_802154_sl_ant_div_antenna_t antenna)
 Manually selects the antenna to be used for tx.
 
nrf_802154_sl_ant_div_antenna_t nrf_802154_antenna_diversity_tx_antenna_get (void)
 Gets antenna currently used for tx.
 
nrf_802154_sl_ant_div_antenna_t nrf_802154_antenna_diversity_last_rx_best_antenna_get (void)
 Gets which antenna was selected as best for the last reception.
 
void nrf_802154_antenna_diversity_config_set (const nrf_802154_sl_ant_div_cfg_t *p_cfg)
 Sets antenna diversity configuration.
 
bool nrf_802154_antenna_diversity_config_get (nrf_802154_sl_ant_div_cfg_t *p_cfg)
 Gets the antenna diversity interface configuration.
 
bool nrf_802154_antenna_diversity_init (void)
 Initializes antenna diversity module.
 
void nrf_802154_antenna_diversity_timer_irq_handler (void)
 Handles TIMER IRQ of the antenna diversity interface.
 
uint64_t nrf_802154_time_get (void)
 Gets the current time.
 
void nrf_802154_pan_id_set (const uint8_t *p_pan_id)
 Sets the PAN ID used by the device.
 
void nrf_802154_extended_address_set (const uint8_t *p_extended_address)
 Sets the extended address of the device.
 
void nrf_802154_short_address_set (const uint8_t *p_short_address)
 Sets the short address of the device.
 
nrf_802154_state_t nrf_802154_state_get (void)
 Gets the current state of the radio.
 
bool nrf_802154_sleep (void)
 Changes the radio state to the RADIO_STATE_SLEEP state.
 
nrf_802154_sleep_error_t nrf_802154_sleep_if_idle (void)
 Changes the radio state to the RADIO_STATE_SLEEP state if the radio is idle.
 
bool nrf_802154_receive (void)
 Changes the radio state to RADIO_STATE_RX.
 
bool nrf_802154_receive_at (uint64_t rx_time, uint32_t timeout, uint8_t channel, uint32_t id)
 Requests reception at the specified time.
 
bool nrf_802154_receive_at_cancel (uint32_t id)
 Cancels a delayed reception scheduled by a call to nrf_802154_receive_at.
 
bool nrf_802154_transmit_raw (uint8_t *p_data, const nrf_802154_transmit_metadata_t *p_metadata)
 Changes the radio state to RADIO_STATE_TX.
 
bool nrf_802154_transmit (const uint8_t *p_data, uint8_t length, const nrf_802154_transmit_metadata_t *p_metadata)
 Changes the radio state to transmit.
 
bool nrf_802154_transmit_raw_at (uint8_t *p_data, uint64_t tx_time, const nrf_802154_transmit_at_metadata_t *p_metadata)
 Requests transmission at the specified time.
 
bool nrf_802154_transmit_at_cancel (void)
 Cancels a delayed transmission scheduled by a call to nrf_802154_transmit_raw_at.
 
bool nrf_802154_energy_detection (uint32_t time_us)
 Changes the radio state to energy detection.
 
bool nrf_802154_cca (void)
 Changes the radio state to RADIO_STATE_CCA.
 
bool nrf_802154_continuous_carrier (void)
 Changes the radio state to continuous carrier.
 
bool nrf_802154_modulated_carrier (const uint8_t *p_data)
 Changes the radio state to modulated carrier.
 
void nrf_802154_buffer_free_raw (uint8_t *p_data)
 Notifies the driver that the buffer containing the received frame is not used anymore.
 
bool nrf_802154_buffer_free_immediately_raw (uint8_t *p_data)
 Notifies the driver that the buffer containing the received frame is not used anymore.
 
void nrf_802154_buffer_free (uint8_t *p_data)
 Notifies the driver that the buffer containing the received frame is not used anymore.
 
bool nrf_802154_buffer_free_immediately (uint8_t *p_data)
 Notifies the driver that the buffer containing the received frame is not used anymore.
 
bool nrf_802154_rssi_measure_begin (void)
 Begins the RSSI measurement.
 
int8_t nrf_802154_rssi_last_get (void)
 Gets the result of the last RSSI measurement.
 
void nrf_802154_promiscuous_set (bool enabled)
 Enables or disables the promiscuous radio mode.
 
bool nrf_802154_promiscuous_get (void)
 Checks if the radio is in the promiscuous mode.
 
void nrf_802154_auto_ack_set (bool enabled)
 Enables or disables the automatic acknowledgments (auto ACK).
 
bool nrf_802154_auto_ack_get (void)
 Checks if the auto ACK is enabled.
 
void nrf_802154_pan_coord_set (bool enabled)
 Configures the device as the PAN coordinator.
 
bool nrf_802154_pan_coord_get (void)
 Checks if the radio is configured as the PAN coordinator.
 
void nrf_802154_src_addr_matching_method_set (nrf_802154_src_addr_match_t match_method)
 Select the source matching algorithm.
 
bool nrf_802154_ack_data_set (const uint8_t *p_addr, bool extended, const void *p_data, uint16_t length, nrf_802154_ack_data_t data_type)
 Adds the address of a peer node for which the provided ACK data is to be injected into generated ACKs.
 
bool nrf_802154_ack_data_clear (const uint8_t *p_addr, bool extended, nrf_802154_ack_data_t data_type)
 Removes the address of a peer node for which the ACK data is set from the pending bit list.
 
void nrf_802154_ack_data_remove_all (bool extended, nrf_802154_ack_data_t data_type)
 Removes all addresses of a given length from the ACK data list.
 
void nrf_802154_auto_pending_bit_set (bool enabled)
 Enables or disables setting a pending bit in automatically transmitted ACK frames.
 
bool nrf_802154_pending_bit_for_addr_set (const uint8_t *p_addr, bool extended)
 Adds the address of a peer node to the pending bit list.
 
bool nrf_802154_pending_bit_for_addr_clear (const uint8_t *p_addr, bool extended)
 Removes address of a peer node from the pending bit list.
 
void nrf_802154_pending_bit_for_addr_reset (bool extended)
 Removes all addresses of a given type from the pending bit list.
 
void nrf_802154_cca_cfg_set (const nrf_802154_cca_cfg_t *p_cca_cfg)
 Configures the radio CCA mode and threshold.
 
void nrf_802154_cca_cfg_get (nrf_802154_cca_cfg_t *p_cca_cfg)
 Gets the current radio CCA configuration.
 
bool nrf_802154_transmit_csma_ca_raw (uint8_t *p_data, const nrf_802154_transmit_csma_ca_metadata_t *p_metadata)
 Performs the CSMA-CA procedure and transmits a frame in case of success.
 
bool nrf_802154_csma_ca_min_be_set (uint8_t min_be)
 Sets the minimum value of the backoff exponent (BE) in the CSMA-CA algorithm.
 
uint8_t nrf_802154_csma_ca_min_be_get (void)
 Gets the minimum value of the backoff exponent (BE) in the CSMA-CA algorithm.
 
bool nrf_802154_csma_ca_max_be_set (uint8_t max_be)
 Sets the maximum value of the backoff exponent (BE) in the CSMA-CA algorithm.
 
uint8_t nrf_802154_csma_ca_max_be_get (void)
 Gets the maximum value of the backoff exponent (BE) in the CSMA-CA algorithm.
 
void nrf_802154_csma_ca_max_backoffs_set (uint8_t max_backoffs)
 Sets the maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
 
uint8_t nrf_802154_csma_ca_max_backoffs_get (void)
 Gets the maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
 
void nrf_802154_ack_timeout_set (uint32_t time)
 Sets timeout for the ACK timeout feature.
 
bool nrf_802154_wifi_coex_is_enabled (void)
 Checks if wifi coex signaling is enabled.
 
bool nrf_802154_coex_rx_request_mode_set (nrf_802154_coex_rx_request_mode_t mode)
 Sets Coex request mode used in receive operations.
 
nrf_802154_coex_rx_request_mode_t nrf_802154_coex_rx_request_mode_get (void)
 Gets Coex request mode used in receive operations.
 
bool nrf_802154_coex_tx_request_mode_set (nrf_802154_coex_tx_request_mode_t mode)
 Sets Coex request mode used in transmit operations.
 
nrf_802154_coex_tx_request_mode_t nrf_802154_coex_tx_request_mode_get (void)
 Gets Coex request mode used in transmit operations.
 
void nrf_802154_stats_get (nrf_802154_stats_t *p_stats)
 Gets current statistics.
 
void nrf_802154_stat_counters_get (nrf_802154_stat_counters_t *p_stat_counters)
 Get current statistics.
 
void nrf_802154_stat_counters_subtract (const nrf_802154_stat_counters_t *p_stat_counters)
 Decreases current statistic counter values by the provided ones.
 
void nrf_802154_stat_timestamps_get (nrf_802154_stat_timestamps_t *p_stat_timestamps)
 Get time stamps of events gathered by the last operation.
 
void nrf_802154_stat_counters_reset (void)
 Resets current stat counters to 0.
 
nrf_802154_ifs_mode_t nrf_802154_ifs_mode_get (void)
 Gets IFS operation mode.
 
bool nrf_802154_ifs_mode_set (nrf_802154_ifs_mode_t mode)
 Sets IFS operation mode.
 
uint16_t nrf_802154_ifs_min_sifs_period_get (void)
 Gets Short IFS period in microseconds.
 
void nrf_802154_ifs_min_sifs_period_set (uint16_t period)
 Sets Short IFS period in microseconds.
 
uint16_t nrf_802154_ifs_min_lifs_period_get (void)
 Gets Long IFS period in microseconds.
 
void nrf_802154_ifs_min_lifs_period_set (uint16_t period)
 Sets Long IFS period in microseconds.
 
nrf_802154_capabilities_t nrf_802154_capabilities_get (void)
 Gets nRF 802.15.4 Radio Driver Capabilities.
 
void nrf_802154_security_global_frame_counter_set (uint32_t frame_counter)
 Sets nRF 802.15.4 Radio Driver Global MAC Frame Counter.
 
void nrf_802154_security_global_frame_counter_set_if_larger (uint32_t frame_counter)
 Sets nRF 802.15.4 Radio Driver MAC Global Frame Counter if the value passed is larger than current.
 
nrf_802154_security_error_t nrf_802154_security_key_store (nrf_802154_key_t *p_key)
 Store the 802.15.4 MAC Security Key inside the nRF 802.15.4 Radio Driver.
 
nrf_802154_security_error_t nrf_802154_security_key_remove (nrf_802154_key_id_t *p_id)
 Remove the 802.15.4 MAC Security Key from the nRF 802.15.4 Radio Driver.
 
void nrf_802154_security_key_remove_all (void)
 Remove all stored 802.15.4 MAC Security Keys from the nRF 802.15.4 Radio Driver.
 
void nrf_802154_csl_writer_period_set (uint16_t period)
 Sets the value of CSL period to inject into the CSL information element.
 
void nrf_802154_csl_writer_anchor_time_set (uint64_t anchor_time)
 Sets the anchor time based on which the next CSL window time and the CSL phase is calculated.
 
void nrf_802154_rx_on_when_idle_set (bool rx_on_when_idle)
 Sets the RxOnWhenIdle mode value.
 
void nrf_802154_cst_writer_period_set (uint16_t period)
 Sets the value of CST period to inject into the CST information element.
 
void nrf_802154_cst_writer_anchor_time_set (uint64_t anchor_time)
 Sets the anchor time based on which the next CST window time and the CST phase is calculated.