Go to the documentation of this file.
72 #define AT86RF215_MAX_PKT_LENGTH (2047)
85 #define CONFIG_AT86RF215_USE_CLOCK_OUTPUT
88 #if defined(DOXYGEN) && !defined(CONFIG_AT86RF215_TRIM_VAL)
101 #define CONFIG_AT86RF215_TRIM_VAL (0)
108 #ifndef CONFIG_AT86RF215_DEFAULT_CHANNEL
109 #define CONFIG_AT86RF215_DEFAULT_CHANNEL (CONFIG_IEEE802154_DEFAULT_CHANNEL)
112 #ifndef CONFIG_AT86RF215_DEFAULT_SUBGHZ_CHANNEL
113 #define CONFIG_AT86RF215_DEFAULT_SUBGHZ_CHANNEL (CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL)
121 #ifndef CONFIG_AT86RF215_RPC_EN
122 #define CONFIG_AT86RF215_RPC_EN (0)
130 #if IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_LEGACY_OQPSK)
131 #define CONFIG_AT86RF215_DEFAULT_PHY_MODE (IEEE802154_PHY_OQPSK)
132 #elif IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OQPSK)
133 #define CONFIG_AT86RF215_DEFAULT_PHY_MODE (IEEE802154_PHY_MR_OQPSK)
134 #elif IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OFDM)
135 #define CONFIG_AT86RF215_DEFAULT_PHY_MODE (IEEE802154_PHY_MR_OFDM)
138 #ifndef CONFIG_AT86RF215_DEFAULT_PHY_MODE
139 #define CONFIG_AT86RF215_DEFAULT_PHY_MODE (IEEE802154_PHY_OQPSK)
148 #ifndef CONFIG_AT86RF215_DEFAULT_OQPSK_RATE
149 #define CONFIG_AT86RF215_DEFAULT_OQPSK_RATE (0)
157 #if IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS_100)
158 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS (AT86RF215_FCHIP_100)
159 #elif IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS_200)
160 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS (AT86RF215_FCHIP_200)
161 #elif IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS_1000)
162 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS (AT86RF215_FCHIP_1000)
163 #elif IS_ACTIVE(CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS_2000)
164 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS (AT86RF215_FCHIP_2000)
167 #ifndef CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS
168 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_CHIPS (AT86RF215_FCHIP_1000)
176 #ifndef CONFIG_AT86RF215_DEFAULT_MR_OQPSK_RATE
177 #define CONFIG_AT86RF215_DEFAULT_MR_OQPSK_RATE (2)
185 #ifndef CONFIG_AT86RF215_DEFAULT_MR_OFDM_OPT
186 #define CONFIG_AT86RF215_DEFAULT_MR_OFDM_OPT (2)
194 #ifndef CONFIG_AT86RF215_DEFAULT_MR_OFDM_MCS
195 #define CONFIG_AT86RF215_DEFAULT_MR_OFDM_MCS (2)
203 #ifndef CONFIG_AT86RF215_DEFAULT_MR_FSK_SRATE
204 #define CONFIG_AT86RF215_DEFAULT_MR_FSK_SRATE FSK_SRATE_200K
212 #ifndef CONFIG_AT86RF215_DEFAULT_MR_FSK_MOD_IDX
213 #define CONFIG_AT86RF215_DEFAULT_MR_FSK_MOD_IDX (64)
221 #ifndef CONFIG_AT86RF215_DEFAULT_MR_FSK_MORD
222 #define CONFIG_AT86RF215_DEFAULT_MR_FSK_MORD FSK_MORD_4SFK
230 #ifndef CONFIG_AT86RF215_DEFAULT_MR_FSK_FEC
231 #define CONFIG_AT86RF215_DEFAULT_MR_FSK_FEC IEEE802154_FEC_NONE
238 #ifndef CONFIG_AT86RF215_DEFAULT_TXPOWER
239 #define CONFIG_AT86RF215_DEFAULT_TXPOWER (CONFIG_IEEE802154_DEFAULT_TXPOWER)
259 AT86RF215_MODE_LEGACY_OQPSK,
260 AT86RF215_MODE_MR_OQPSK,
261 AT86RF215_MODE_MR_OFDM,
262 AT86RF215_MODE_MR_FSK
269 #define AT86RF215_OPT_TELL_TX_START (0x0001)
270 #define AT86RF215_OPT_TELL_TX_END (0x0002)
271 #define AT86RF215_OPT_TELL_RX_START (0x0004)
272 #define AT86RF215_OPT_TELL_RX_END (0x0008)
273 #define AT86RF215_OPT_CSMA (0x0010)
274 #define AT86RF215_OPT_PROMISCUOUS (0x0020)
275 #define AT86RF215_OPT_PRELOADING (0x0040)
276 #define AT86RF215_OPT_AUTOACK (0x0080)
277 #define AT86RF215_OPT_ACK_REQUESTED (0x0100)
278 #define AT86RF215_OPT_AGCH (0x0200)
279 #define AT86RF215_OPT_TX_PENDING (0x0400)
280 #define AT86RF215_OPT_CCA_PENDING (0x0800)
281 #define AT86RF215_OPT_RPC (0x1000)
282 #define AT86RF215_OPT_CCATX (0x2000)
289 #define AT86RF215_TIMEOUT_ACK (0x0001)
290 #define AT86RF215_TIMEOUT_CSMA (0x0002)
296 typedef struct at86rf215_params {
329 #ifdef MODULE_NETDEV_IEEE802154_MR_FSK
556 size_t len,
size_t offset);
uint8_t csma_retries_max
number of retries until channel is clear
@ AT86RF215_STATE_TX_WAIT_ACK
sending frame, wait for ACK
int8_t at86rf215_get_ed_level(at86rf215_t *dev)
Get the latest ED level measurement.
uint16_t at86rf215_get_addr_short(const at86rf215_t *dev, uint8_t filter)
Get the short address of the given device form multi address filter.
ssize_t at86rf215_send(at86rf215_t *dev, const void *data, size_t len)
Convenience function for simply sending data.
msg_t timer_msg
message for timeout timer
void at86rf215_disable_framefilter(at86rf215_t *dev, uint8_t filter)
Enables a frame filter.
uint8_t csma_maxbe
CSMA maximum backoff exponent.
struct at86rf215 * sibling
The other radio.
Definitions for netdev common IEEE 802.15.4 code.
struct holding all params needed for device initialization
Low-level SPI peripheral driver interface definition.
void(* at86rf215_batmon_cb_t)(void *arg)
Signature for the Battery monitor callback.
struct at86rf215_params at86rf215_params_t
struct holding all params needed for device initialization
uint32_t ack_timeout_usec
time to wait before retransmission in µs
uint16_t pan
IEEE 802.15.4 specific fields.
spi_clk_t spi_clk
SPI clock speed to use.
const at86rf215_RF_regs_t * RF
Radio Frontend Registers.
uint8_t at86rf215_get_chan(const at86rf215_t *dev)
Get the configured channel number of the given device.
void at86rf215_set_txpower(const at86rf215_t *dev, int16_t txpower)
Set the transmission power of the given device [in dBm].
at86rf215_params_t params
parameters for initialization
void at86rf215_reset(at86rf215_t *dev)
Trigger a hardware reset, configuration is retained.
struct at86rf215 at86rf215_t
Device descriptor for AT86RF215 radio devices.
void at86rf215_tx_done(at86rf215_t *dev)
Signal that the transfer of the frame (and optional ACK reception) has finished.
void at86rf215_setup(at86rf215_t *dev_09, at86rf215_t *dev_24, const at86rf215_params_t *params, uint8_t index)
Setup an AT86RF215 based device state.
spi_cs_t cs_pin
GPIO pin connected to chip select.
uint8_t retries
retries left
uint8_t csma_minbe
CSMA minimum backoff exponent.
Base Band Controller registers.
gpio_t spi_cs_t
Chip select pin type overlaps with gpio_t so it can be casted to this.
void at86rf215_set_chan(at86rf215_t *dev, uint16_t chan)
Set the channel number of the given device.
uint16_t num_chans
Number of legal channel at current modulation.
uint8_t timeout
indicates which timeout was reached
void at86rf215_set_addr_short(at86rf215_t *dev, uint8_t filter, uint16_t addr)
Set the short address of the given device to multi address filter.
spi_clk_t
Available SPI clock speeds.
@ AT86RF215_STATE_OFF
radio not configured
Definitions low-level network driver interface.
@ AT86RF215_STATE_IDLE
idle state, listening
int at86rf215_tx_exec(at86rf215_t *dev)
Trigger sending of data previously loaded into transmit buffer.
int at86rf215_tx_prepare(at86rf215_t *dev)
Prepare for sending of data.
Protocol type definitions.
int16_t at86rf215_get_txpower(const at86rf215_t *dev)
Get the configured transmission power of the given device [in dBm].
bool at86rf215_get_framefilter_enabled(at86rf215_t *dev, uint8_t filter)
Get whether a frame filter is enabled or not.
@ AT86RF215_STATE_RX_SEND_ACK
receiving frame, sending ACK
spi_t spi
SPI bus the device is connected to.
void at86rf215_set_pan(at86rf215_t *dev, uint8_t filter, uint16_t pan)
Set the PAN ID of the given address filter.
void at86rf215_reset_and_cfg(at86rf215_t *dev)
Trigger a hardware reset and configure radio with default values.
Device descriptor for AT86RF215 radio devices.
gpio_t int_pin
GPIO pin connected to the interrupt pin.
size_t at86rf215_tx_load(at86rf215_t *dev, const uint8_t *data, size_t len, size_t offset)
Load chunks of data into the transmit buffer of the given device.
@ AT86RF215_STATE_SLEEP
sleep mode, not listening
int8_t csma_ed
CSMA energy detect threshold.
Extended structure to hold IEEE 802.15.4 driver state.
Low-level GPIO peripheral driver interface definitions.
uint16_t tx_frame_len
length of the current TX frame
@ AT86RF215_STATE_TX
sending frame
const at86rf215_BBC_regs_t * BBC
Baseband Registers.
netdev_ieee802154_t netdev
netdev parent struct
gpio_t reset_pin
GPIO pin connected to the reset pin.
void at86rf215_set_option(at86rf215_t *dev, uint16_t option, bool state)
Enable or disable driver specific options.
void at86rf215_set_addr_long(at86rf215_t *dev, uint64_t addr)
Set the long address of the given device.
uint64_t at86rf215_get_addr_long(const at86rf215_t *dev)
Get the configured long address of the given device.
uint16_t at86rf215_get_pan(const at86rf215_t *dev, uint8_t filter)
Get the configured PAN ID of the given device from multi address filter.
xtimer_t timer
timer for ACK & CSMA timeout
Radio Frontend registers.
void at86rf215_set_cca_threshold(at86rf215_t *dev, int8_t value)
Set the CCA threshold value.
Describes a message object which can be sent between threads.
void at86rf215_tx_abort(at86rf215_t *dev)
Abort sending of data previously loaded into transmit buffer.
bool at86rf215_cca(at86rf215_t *dev)
Perform one manual channel clear assessment (CCA)
uint16_t flags
Device specific flags.
int16_t txpower
tx power in dBm
uint32_t csma_backoff_period
CSMA Backoff period.
void at86rf215_enable_framefilter(at86rf215_t *dev, uint8_t filter)
Disables a frame filter.
xtimer interface definitions
uint8_t retries_max
number of retries until ACK is received
uint8_t state
current state of the radio
unsigned int spi_t
Default type for SPI devices.
uint8_t csma_retries
CSMA retries left.
int8_t at86rf215_get_cca_threshold(const at86rf215_t *dev)
Get the CCA threshold value.