42#if !defined(MODULE_AT86RFA1) && !defined(MODULE_AT86RFR2)
54#define AT86RF2XX_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX)
60#ifdef MODULE_AT86RF212B
62#define AT86RF2XX_MIN_CHANNEL (IEEE802154_CHANNEL_MIN_SUBGHZ)
63#define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX_SUBGHZ)
64#define AT86RF2XX_DEFAULT_CHANNEL (CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL)
66#define AT86RF2XX_DEFAULT_PAGE (CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE)
68#define AT86RF2XX_MIN_CHANNEL (IEEE802154_CHANNEL_MIN)
69#define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX)
70#define AT86RF2XX_DEFAULT_CHANNEL (CONFIG_IEEE802154_DEFAULT_CHANNEL)
71#define AT86RF2XX_DEFAULT_PAGE (0)
79#define AT86RF2XX_DEFAULT_TXPOWER (CONFIG_IEEE802154_DEFAULT_TXPOWER)
85# define RSSI_BASE_VAL (-94)
86#elif MODULE_AT86RF212B
91# define RSSI_BASE_VAL (-98)
92#elif MODULE_AT86RFA1 || MODULE_AT86RFR2
93# define RSSI_BASE_VAL (-90)
95# define RSSI_BASE_VAL (-91)
102# define MIN_RX_SENSITIVITY (-101)
103#elif MODULE_AT86RF212B
104# define MIN_RX_SENSITIVITY (-110)
105#elif MODULE_AT86RFA1 || MODULE_AT86RFR2
106# define MIN_RX_SENSITIVITY (-100)
108# define MIN_RX_SENSITIVITY (-101)
114#if IS_USED(MODULE_AT86RFA1) || IS_USED(MODULE_AT86RFR2)
115#define AT86RF2XX_IS_PERIPH (1)
117#define AT86RF2XX_IS_PERIPH (0)
123#if defined(MODULE_AT86RF231) || IS_ACTIVE(AT86RF2XX_PERIPH)
124#define AT86RF2XX_HAVE_ED_REGISTER (1)
126#define AT86RF2XX_HAVE_ED_REGISTER (0)
132#ifdef MODULE_AT86RF212B
133#define AT86RF2XX_HAVE_SUBGHZ (1)
135#define AT86RF2XX_HAVE_SUBGHZ (0)
138#if defined(DOXYGEN) || defined(MODULE_AT86RF232) || defined(MODULE_AT86RF233) || defined(MODULE_AT86RFR2)
145#define AT86RF2XX_HAVE_RETRIES (1)
147#define AT86RF2XX_HAVE_RETRIES (0)
156#if AT86RF2XX_HAVE_RETRIES && defined(AT86RF2XX_REG__XAH_CTRL_2)
157#define AT86RF2XX_HAVE_RETRIES_REG (1)
159#define AT86RF2XX_HAVE_RETRIES_REG (0)
165#ifdef AT86RF2XX_REG__IRQ_MASK1
166#define AT86RF2XX_HAVE_TX_START_IRQ (1)
168#define AT86RF2XX_HAVE_TX_START_IRQ (0)
178#if defined(MODULE_AT86RF233) || defined(MODULE_AT86RF231) || defined(MODULE_AT86RFA1) || defined(MODULE_AT86RFR2)
179#ifndef AT86RF2XX_RANDOM_NUMBER_GENERATOR
180#define AT86RF2XX_RANDOM_NUMBER_GENERATOR (1)
183#ifndef AT86RF2XX_RANDOM_NUMBER_GENERATOR
184#define AT86RF2XX_RANDOM_NUMBER_GENERATOR (0)
196#if defined(MODULE_AT86RF233) || defined(MODULE_AT86RFR2)
197#ifndef AT86RF2XX_SMART_IDLE_LISTENING
198#define AT86RF2XX_SMART_IDLE_LISTENING (1)
201#define AT86RF2XX_SMART_IDLE_LISTENING (0)
208#define AT86RF2XX_STATE_P_ON (0x00)
209#define AT86RF2XX_STATE_BUSY_RX (0x01)
210#define AT86RF2XX_STATE_BUSY_TX (0x02)
211#define AT86RF2XX_STATE_FORCE_TRX_OFF (0x03)
212#define AT86RF2XX_STATE_RX_ON (0x06)
213#define AT86RF2XX_STATE_TRX_OFF (0x08)
214#define AT86RF2XX_STATE_PLL_ON (0x09)
215#define AT86RF2XX_STATE_SLEEP (0x0f)
216#define AT86RF2XX_STATE_BUSY_RX_AACK (0x11)
217#define AT86RF2XX_STATE_BUSY_TX_ARET (0x12)
218#define AT86RF2XX_STATE_RX_AACK_ON (0x16)
219#define AT86RF2XX_STATE_TX_ARET_ON (0x19)
220#define AT86RF2XX_STATE_IN_PROGRESS (0x1f)
227#define AT86RF2XX_OPT_CSMA (0x0010)
228#define AT86RF2XX_OPT_PROMISCUOUS (0x0020)
229#define AT86RF2XX_OPT_PRELOADING (0x0040)
230#define AT86RF2XX_OPT_AUTOACK (0x0080)
231#define AT86RF2XX_OPT_ACK_PENDING (0x0100)
235#if IS_ACTIVE(AT86RF2XX_BASIC_MODE) || defined(DOXYGEN)
239#define AT86RF2XX_PHY_STATE_RX AT86RF2XX_STATE_RX_ON
243#define AT86RF2XX_PHY_STATE_RX_BUSY AT86RF2XX_STATE_BUSY_RX
247#define AT86RF2XX_PHY_STATE_TX AT86RF2XX_STATE_PLL_ON
251#define AT86RF2XX_PHY_STATE_TX_BUSY AT86RF2XX_STATE_BUSY_TX
253#define AT86RF2XX_PHY_STATE_RX AT86RF2XX_STATE_RX_AACK_ON
254#define AT86RF2XX_PHY_STATE_RX_BUSY AT86RF2XX_STATE_BUSY_RX_AACK
255#define AT86RF2XX_PHY_STATE_TX AT86RF2XX_STATE_TX_ARET_ON
256#define AT86RF2XX_PHY_STATE_TX_BUSY AT86RF2XX_STATE_BUSY_TX_ARET
259#if AT86RF2XX_IS_PERIPH
285#if AT86RF2XX_IS_PERIPH
301#ifdef MODULE_AT86RF212B
309#if AT86RF2XX_HAVE_RETRIES
479 uint8_t min, uint8_t max);
555 size_t len,
size_t offset);
Definitions for netdev common IEEE 802.15.4 code.
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
int at86rf2xx_set_rate(at86rf2xx_t *dev, uint8_t rate)
Set the current O-QPSK rate mode of the PHY rate modes > 0 are proprietary.
void at86rf2xx_reset(at86rf2xx_t *dev)
Trigger a hardware reset and configure radio with default values.
int8_t at86rf2xx_get_cca_threshold(const at86rf2xx_t *dev)
Get the CCA threshold value.
void at86rf2xx_disable_smart_idle(at86rf2xx_t *dev)
Disable the smart receive technology (SRT)
void at86rf2xx_tx_prepare(at86rf2xx_t *dev)
Prepare for sending of data.
void at86rf2xx_set_pan(at86rf2xx_t *dev, uint16_t pan)
Set the PAN ID of the given device.
bool at86rf2xx_cca(at86rf2xx_t *dev)
Perform one manual channel clear assessment (CCA)
size_t at86rf2xx_tx_load(at86rf2xx_t *dev, const uint8_t *data, size_t len, size_t offset)
Load chunks of data into the transmit buffer of the given device.
void at86rf2xx_set_cca_threshold(const at86rf2xx_t *dev, int8_t value)
Set the CCA threshold value.
void at86rf2xx_tx_exec(at86rf2xx_t *dev)
Trigger sending of data previously loaded into transmit buffer.
void at86rf2xx_set_addr_long(at86rf2xx_t *dev, const eui64_t *addr)
Set the long address of the given device.
void at86rf2xx_set_csma_max_retries(const at86rf2xx_t *dev, int8_t retries)
Set the maximum number of channel access attempts per frame (CSMA)
uint8_t at86rf2xx_get_rate(at86rf2xx_t *dev)
Get the current O-QPSK rate mode of the PHY.
void at86rf2xx_set_csma_seed(const at86rf2xx_t *dev, const uint8_t entropy[2])
Set seed for CSMA random backoff.
uint8_t at86rf2xx_get_phy_mode(at86rf2xx_t *dev)
Get the PHY mode of the given device.
uint8_t at86rf2xx_set_state(at86rf2xx_t *dev, uint8_t state)
Set the state of the given device (trigger a state change)
void at86rf2xx_setup(at86rf2xx_t *dev, const at86rf2xx_params_t *params, uint8_t index)
Setup an AT86RF2xx based device state.
int8_t at86rf2xx_get_rxsensitivity(const at86rf2xx_t *dev)
Get the configured receiver sensitivity of the given device [in dBm].
uint8_t at86rf2xx_get_csma_max_retries(const at86rf2xx_t *dev)
Get the maximum number of channel access attempts per frame (CSMA)
struct at86rf2xx_params at86rf2xx_params_t
struct holding all params needed for device initialization
void at86rf2xx_enable_smart_idle(at86rf2xx_t *dev)
Enable the smart receive technology (SRT)
void at86rf2xx_set_max_retries(const at86rf2xx_t *dev, uint8_t max)
Set the maximum number of retransmissions.
void at86rf2xx_set_csma_backoff_exp(const at86rf2xx_t *dev, uint8_t min, uint8_t max)
Set the min and max backoff exponent for CSMA/CA.
void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state)
Enable or disable driver specific options.
uint8_t at86rf2xx_get_max_retries(const at86rf2xx_t *dev)
Get the maximum number of retransmissions.
void at86rf2xx_set_addr_short(at86rf2xx_t *dev, const network_uint16_t *addr)
Set the short address of the given device.
void at86rf2xx_set_txpower(const at86rf2xx_t *dev, int16_t txpower, uint8_t channel)
Set the transmission power of the given device [in dBm].
void at86rf2xx_set_rxsensitivity(const at86rf2xx_t *dev, int8_t rxsens)
Set the receiver sensitivity of the given device [in dBm].
int8_t at86rf2xx_get_ed_level(at86rf2xx_t *dev)
Get the latest ED level measurement.
gpio_t spi_cs_t
Chip select pin type overlaps with gpio_t so it can be casted to this.
Common macros and compiler attributes/pragmas configuration.
Protocol type definitions.
Low-level SPI peripheral driver interface definition.
struct holding all params needed for device initialization
spi_t spi
SPI bus the device is connected to.
spi_cs_t cs_pin
GPIO pin connected to chip select.
gpio_t reset_pin
GPIO pin connected to the reset pin.
gpio_t sleep_pin
GPIO pin connected to the sleep pin.
gpio_t int_pin
GPIO pin connected to the interrupt pin.
spi_clk_t spi_clk
SPI clock speed to use.
Device descriptor for AT86RF2XX radio devices.
uint8_t pending_tx
keep track of pending TX calls this is required to know when to return to at86rf2xx_t::idle_state
uint8_t tx_frame_len
length of the current TX frame
netdev_ieee802154_t netdev
netdev parent struct
uint8_t idle_state
state to return to after sending
uint8_t state
current state of the radio
at86rf2xx_params_t params
parameters for initialization
uint16_t flags
Device specific flags.
Extended structure to hold IEEE 802.15.4 driver state.
A 16 bit integer in big endian aka network byte order.
Data type to represent an EUI-64.