35#include "net/ieee802154/radio.h"
44#define KW2XRF_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX)
54#ifndef KW2XRF_DEFAULT_CHANNEL
55#define KW2XRF_DEFAULT_CHANNEL (CONFIG_IEEE802154_DEFAULT_CHANNEL)
64#define KW2XRF_MIN_CHANNEL (11U)
65#define KW2XRF_MAX_CHANNEL (26U)
71#define KW2XRF_DEFAULT_TX_POWER (CONFIG_IEEE802154_DEFAULT_TXPOWER)
76#define KW2XDRF_OUTPUT_POWER_MAX (8)
81#define KW2XDRF_OUTPUT_POWER_MIN (-35)
91#define KW2XRF_OPT_SRC_ADDR_LONG (NETDEV_IEEE802154_SRC_MODE_LONG)
92#define KW2XRF_OPT_RAWDUMP (NETDEV_IEEE802154_RAW)
93#define KW2XRF_OPT_ACK_REQ (NETDEV_IEEE802154_ACK_REQ)
95#define KW2XRF_OPT_AUTOCCA (0x0100)
96#define KW2XRF_OPT_PROMISCUOUS (0x0200)
98#define KW2XRF_OPT_PRELOADING (0x0400)
99#define KW2XRF_OPT_AUTOACK (0x8000)
Definitions for netdev common IEEE 802.15.4 code.
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
#define KW2XRF_MAX_PKT_LENGTH
Maximum packet length.
void kw2xrf_radio_hal_irq_handler(void *dev)
IRQ Handler for the KW2XRF device.
void kw2xrf_reset_phy(kw2xrf_t *dev)
Configure radio with default values.
int kw2xrf_init(kw2xrf_t *dev, const kw2xrf_params_t *params, ieee802154_dev_t *hal, gpio_cb_t cb, void *ctx)
Initialize the given KW2XRF device.
struct kw2xrf_params kw2xrf_params_t
Struct holding all params needed for device initialization.
void(* gpio_cb_t)(void *arg)
Signature of event callback functions triggered from interrupts.
Protocol type definitions.
Low-level SPI peripheral driver interface definition.
thread_t holds thread's context data.
the IEEE802.15.4 device descriptor
Struct holding all params needed for device initialization.
gpio_t cs_pin
GPIO pin connected to chip select.
spi_t spi
SPI bus the device is connected to.
gpio_t int_pin
GPIO pin connected to the interrupt pin.
gpio_t rst_pin
GPIO pin connected to RST_B.
spi_clk_t spi_clk
SPI clock speed to use.
Device descriptor for KW2XRF radio devices.
bool tx_done
Indicate whether TX completed.
uint8_t state
current state of the radio
bool waiting_for_cca
Indicate whether CCA is still ongoing.
bool ack_rcvd
Indicate if ACK was received for last transmission.
bool ack_requested
ACK was requested for last frame.
uint8_t pending_tx
keep track of pending TX calls this is required to know when to return to kw2xrf_t::idle_state
int16_t tx_power
The current tx-power setting of the device.
bool tx_cca_pending
true a manual CCA was started and a TX should be triggered on channel clear indication
uint8_t idle_state
state to return to after sending
thread_t * thread
device specific fields
bool cca_before_tx
true if CCA shall be performed before TX
bool ch_clear
CCA indicated channel clear.
uint8_t tx_frame_len
length of the current TX frame
const kw2xrf_params_t * params
parameters for initialization