This module contains a driver for the Atmel AT86RF215 radio.
Modules | |
AT86RF215 MR-FSK PHY | |
AT86RF215 MR-O-QPSK PHY | |
AT86RF215 MR-OFDM PHY | |
AT86RF215 driver compile configuration | |
Files | |
file | at86rf215_internal.h |
Low-Level functions for the AT86RF215 driver. | |
file | at86rf215_netdev.h |
Netdev interface to AT86RF215 driver. | |
file | at86rf215_params.h |
Default configuration for the AT86RF215 driver. | |
file | at86rf215_registers.h |
Register Definitions for the AT86RF215 chip. | |
file | at86rf215.h |
Interface definition for AT86RF215 based drivers. | |
Data Structures | |
struct | at86rf215_params |
struct holding all params needed for device initialization More... | |
struct | at86rf215 |
Device descriptor for AT86RF215 radio devices. More... | |
Macros | |
#define | AT86RF215_MAX_PKT_LENGTH (2047) |
Maximum possible packet size in byte. | |
Typedefs | |
typedef struct at86rf215_RF_regs | at86rf215_RF_regs_t |
Registers for the Radio Frontend. | |
typedef struct at86rf215_BBC_regs | at86rf215_BBC_regs_t |
Registers for the BaseBand Controller. | |
typedef void(* | at86rf215_batmon_cb_t) (void *arg) |
Signature for the Battery monitor callback. More... | |
typedef struct at86rf215_params | at86rf215_params_t |
struct holding all params needed for device initialization | |
typedef struct at86rf215 | at86rf215_t |
Device descriptor for AT86RF215 radio devices. | |
Functions | |
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. More... | |
void | at86rf215_reset_and_cfg (at86rf215_t *dev) |
Trigger a hardware reset and configure radio with default values. More... | |
void | at86rf215_reset (at86rf215_t *dev) |
Trigger a hardware reset, configuration is retained. More... | |
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. More... | |
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. More... | |
bool | at86rf215_get_framefilter_enabled (at86rf215_t *dev, uint8_t filter) |
Get whether a frame filter is enabled or not. More... | |
void | at86rf215_disable_framefilter (at86rf215_t *dev, uint8_t filter) |
Enables a frame filter. More... | |
void | at86rf215_enable_framefilter (at86rf215_t *dev, uint8_t filter) |
Disables a frame filter. More... | |
uint64_t | at86rf215_get_addr_long (const at86rf215_t *dev) |
Get the configured long address of the given device. More... | |
void | at86rf215_set_addr_long (at86rf215_t *dev, uint64_t addr) |
Set the long address of the given device. More... | |
uint8_t | at86rf215_get_chan (const at86rf215_t *dev) |
Get the configured channel number of the given device. More... | |
void | at86rf215_set_chan (at86rf215_t *dev, uint16_t chan) |
Set the channel number of the given device. More... | |
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. More... | |
void | at86rf215_set_pan (at86rf215_t *dev, uint8_t filter, uint16_t pan) |
Set the PAN ID of the given address filter. More... | |
int16_t | at86rf215_get_txpower (const at86rf215_t *dev) |
Get the configured transmission power of the given device [in dBm]. More... | |
void | at86rf215_set_txpower (const at86rf215_t *dev, int16_t txpower) |
Set the transmission power of the given device [in dBm]. More... | |
int8_t | at86rf215_get_cca_threshold (const at86rf215_t *dev) |
Get the CCA threshold value. More... | |
void | at86rf215_set_cca_threshold (at86rf215_t *dev, int8_t value) |
Set the CCA threshold value. More... | |
int8_t | at86rf215_get_ed_level (at86rf215_t *dev) |
Get the latest ED level measurement. More... | |
void | at86rf215_set_option (at86rf215_t *dev, uint16_t option, bool state) |
Enable or disable driver specific options. More... | |
ssize_t | at86rf215_send (at86rf215_t *dev, const void *data, size_t len) |
Convenience function for simply sending data. More... | |
int | at86rf215_tx_prepare (at86rf215_t *dev) |
Prepare for sending of data. More... | |
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. More... | |
int | at86rf215_tx_exec (at86rf215_t *dev) |
Trigger sending of data previously loaded into transmit buffer. More... | |
void | at86rf215_tx_abort (at86rf215_t *dev) |
Abort sending of data previously loaded into transmit buffer. More... | |
void | at86rf215_tx_done (at86rf215_t *dev) |
Signal that the transfer of the frame (and optional ACK reception) has finished. More... | |
bool | at86rf215_cca (at86rf215_t *dev) |
Perform one manual channel clear assessment (CCA) More... | |
Flags for device internal states (see datasheet) | |
enum | at86rf215_state_t { AT86RF215_STATE_OFF, AT86RF215_STATE_IDLE, AT86RF215_STATE_RX_SEND_ACK, AT86RF215_STATE_TX, AT86RF215_STATE_TX_WAIT_ACK, AT86RF215_STATE_SLEEP } |
Internal device option flags | |
#define | AT86RF215_OPT_TELL_TX_START (0x0001) |
notify MAC layer on TX start | |
#define | AT86RF215_OPT_TELL_TX_END (0x0002) |
notify MAC layer on TX finished | |
#define | AT86RF215_OPT_TELL_RX_START (0x0004) |
notify MAC layer on RX start | |
#define | AT86RF215_OPT_TELL_RX_END (0x0008) |
notify MAC layer on RX finished | |
#define | AT86RF215_OPT_CSMA (0x0010) |
CSMA active. | |
#define | AT86RF215_OPT_PROMISCUOUS (0x0020) |
promiscuous mode active | |
#define | AT86RF215_OPT_PRELOADING (0x0040) |
preloading enabled | |
#define | AT86RF215_OPT_AUTOACK (0x0080) |
Auto ACK active. | |
#define | AT86RF215_OPT_ACK_REQUESTED (0x0100) |
ACK requested for current frame. | |
#define | AT86RF215_OPT_AGCH (0x0200) |
AGC Hold active. | |
#define | AT86RF215_OPT_TX_PENDING (0x0400) |
Frame is loaded into TX buffer. | |
#define | AT86RF215_OPT_CCA_PENDING (0x0800) |
CCA needs to be done for the current frame. | |
#define | AT86RF215_OPT_RPC (0x1000) |
Enable Reduced Power Consumption. | |
#define | AT86RF215_OPT_CCATX (0x2000) |
TX after CCA performd automatically. | |
Internal timeout flags | |
#define | AT86RF215_TIMEOUT_ACK (0x0001) |
ACK timeout. | |
#define | AT86RF215_TIMEOUT_CSMA (0x0002) |
CMSA timeout. | |
typedef void(* at86rf215_batmon_cb_t) (void *arg) |
Signature for the Battery monitor callback.
[in] | arg | optional argument which is passed to the callback |
Definition at line 57 of file at86rf215.h.
enum at86rf215_state_t |
Definition at line 248 of file at86rf215.h.
bool at86rf215_cca | ( | at86rf215_t * | dev | ) |
Perform one manual channel clear assessment (CCA)
The CCA mode and threshold level depends on the current transceiver settings.
[in] | dev | device to use |
void at86rf215_disable_framefilter | ( | at86rf215_t * | dev, |
uint8_t | filter | ||
) |
Enables a frame filter.
[in] | dev | device to read from |
[in] | filter | (1-byte) filter to get |
void at86rf215_enable_framefilter | ( | at86rf215_t * | dev, |
uint8_t | filter | ||
) |
Disables a frame filter.
[in] | dev | device to read from |
[in] | filter | (1-byte) filter to get |
uint64_t at86rf215_get_addr_long | ( | const at86rf215_t * | dev | ) |
Get the configured long address of the given device.
[in] | dev | device to read from |
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.
[in] | dev | device to read from |
[in] | filter | address filter to read |
int8_t at86rf215_get_cca_threshold | ( | const at86rf215_t * | dev | ) |
Get the CCA threshold value.
[in] | dev | device to read value from |
uint8_t at86rf215_get_chan | ( | const at86rf215_t * | dev | ) |
Get the configured channel number of the given device.
[in] | dev | device to read from |
int8_t at86rf215_get_ed_level | ( | at86rf215_t * | dev | ) |
Get the latest ED level measurement.
[in] | dev | device to read value from |
bool at86rf215_get_framefilter_enabled | ( | at86rf215_t * | dev, |
uint8_t | filter | ||
) |
Get whether a frame filter is enabled or not.
[in] | dev | device to read from |
[in] | filter | (1-byte) filter to get |
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.
[in] | dev | device to read from |
[in] | filter | address filter to read from |
int16_t at86rf215_get_txpower | ( | const at86rf215_t * | dev | ) |
Get the configured transmission power of the given device [in dBm].
[in] | dev | device to read from |
void at86rf215_reset | ( | at86rf215_t * | dev | ) |
Trigger a hardware reset, configuration is retained.
[in,out] | dev | device to reset |
void at86rf215_reset_and_cfg | ( | at86rf215_t * | dev | ) |
Trigger a hardware reset and configure radio with default values.
[in,out] | dev | device to configure |
ssize_t at86rf215_send | ( | at86rf215_t * | dev, |
const void * | data, | ||
size_t | len | ||
) |
Convenience function for simply sending data.
[in,out] | dev | device to use for sending |
[in] | data | data to send (must include IEEE802.15.4 header) |
[in] | len | length of data |
void at86rf215_set_addr_long | ( | at86rf215_t * | dev, |
uint64_t | addr | ||
) |
Set the long address of the given device.
[in,out] | dev | device to write to |
[in] | addr | (8-byte) long address to set |
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.
[in,out] | dev | device to write to |
[in] | filter | (1-byte) address filter to set |
[in] | addr | (2-byte) short address to set |
void at86rf215_set_cca_threshold | ( | at86rf215_t * | dev, |
int8_t | value | ||
) |
Set the CCA threshold value.
[in] | dev | device to write to |
[in] | value | the new CCA threshold value |
void at86rf215_set_chan | ( | at86rf215_t * | dev, |
uint16_t | chan | ||
) |
Set the channel number of the given device.
[in,out] | dev | device to write to |
[in] | chan | channel number to set |
void at86rf215_set_option | ( | at86rf215_t * | dev, |
uint16_t | option, | ||
bool | state | ||
) |
Enable or disable driver specific options.
[in,out] | dev | device to set/clear option flag for |
[in] | option | option to enable/disable |
[in] | state | true for enable, false for disable |
void at86rf215_set_pan | ( | at86rf215_t * | dev, |
uint8_t | filter, | ||
uint16_t | pan | ||
) |
Set the PAN ID of the given address filter.
[in,out] | dev | device to write to |
[in] | filter | address filter to set |
[in] | pan | PAN ID to set |
void at86rf215_set_txpower | ( | const at86rf215_t * | dev, |
int16_t | txpower | ||
) |
Set the transmission power of the given device [in dBm].
If the device does not support the exact dBm value given, it will set a value as close as possible to the given value. If the given value is larger or lower then the maximal or minimal possible value, the min or max value is set, respectively.
[in] | dev | device to write to |
[in] | txpower | transmission power in dBm |
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.
[out] | dev_09 | sub-GHz device descriptor |
[out] | dev_24 | 2.4 GHz device descriptor |
[in] | params | parameters for device initialization |
[in] | index | index of params in a global parameter struct array. If initialized manually, pass a unique identifier instead. |
void at86rf215_tx_abort | ( | at86rf215_t * | dev | ) |
Abort sending of data previously loaded into transmit buffer.
[in] | dev | device to abort TX on |
void at86rf215_tx_done | ( | at86rf215_t * | dev | ) |
Signal that the transfer of the frame (and optional ACK reception) has finished.
Sets the radio in RX mode.
[in] | dev | device to use |
int at86rf215_tx_exec | ( | at86rf215_t * | dev | ) |
Trigger sending of data previously loaded into transmit buffer.
[in] | dev | device to trigger |
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.
[in,out] | dev | device to write data to |
[in] | data | buffer containing the data to load |
[in] | len | number of bytes in buffer |
[in] | offset | offset used when writing data to internal buffer |
int at86rf215_tx_prepare | ( | at86rf215_t * | dev | ) |
Prepare for sending of data.
This function puts the given device into the TX state, so no receiving of data is possible after it was called.
[in,out] | dev | device to prepare for sending |