Loading...
Searching...
No Matches
kw41zrf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 SKF AB
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
21#ifndef KW41ZRF_H
22#define KW41ZRF_H
23
24#include <stdint.h>
25
26#include "mutex.h"
27#include "board.h"
28#include "net/netdev.h"
30#include "net/gnrc/nettype.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
39#define KW41ZRF_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX)
40
49#ifndef KW41ZRF_DEFAULT_CHANNEL
50#define KW41ZRF_DEFAULT_CHANNEL (CONFIG_IEEE802154_DEFAULT_CHANNEL)
51#endif
52
56#ifndef KW41ZRF_DEFAULT_CCA_THRESHOLD
57#define KW41ZRF_DEFAULT_CCA_THRESHOLD (-60)
58#endif
59
63#ifndef KW41ZRF_DEFAULT_LQI_COMPENSATION
64#define KW41ZRF_DEFAULT_LQI_COMPENSATION (102)
65#endif
73#define KW41ZRF_MIN_CHANNEL (11U)
74#define KW41ZRF_MAX_CHANNEL (26U)
80#define KW41ZRF_DEFAULT_TX_POWER (CONFIG_IEEE802154_DEFAULT_TXPOWER)
81
85#define KW41ZRF_OUTPUT_POWER_MAX (4)
86
90#define KW41ZRF_OUTPUT_POWER_MIN (-19)
91
95typedef void (*kw41zrf_cb_t)(void *arg);
96
133
141void kw41zrf_setup(kw41zrf_t *dev, uint8_t index);
142
153
163
164#ifdef __cplusplus
165}
166#endif
167
168#endif /* KW41ZRF_H */
Definitions for netdev common IEEE 802.15.4 code.
Definitions low-level network driver interface.
int kw41zrf_reset(kw41zrf_t *dev)
Reset radio hardware and restore default settings.
int kw41zrf_init(kw41zrf_t *dev, kw41zrf_cb_t cb)
Initialize the given KW41ZRF device.
void kw41zrf_setup(kw41zrf_t *dev, uint8_t index)
Setup an KW41ZRF based device state.
void(* kw41zrf_cb_t)(void *arg)
ISR callback function type.
Definition kw41zrf.h:95
Mutex for thread synchronization.
Protocol type definitions.
thread_t holds thread's context data.
Definition thread.h:168
Device descriptor for KW41ZRF radio devices.
Definition kw41zrf.h:102
uint8_t csma_max_be
Maximum backoff exponent (macMaxBe)
Definition kw41zrf.h:119
uint8_t recv_blocked
blocks moving to XCVSEQ_RECEIVE to prevent overwriting the RX buffer before the higher layers have co...
Definition kw41zrf.h:128
uint8_t csma_num_backoffs
Counter used internally by send implementation.
Definition kw41zrf.h:123
int16_t tx_power
The current tx-power setting of the device.
Definition kw41zrf.h:112
uint8_t csma_max_backoffs
Maximum number of CSMA backoffs when waiting for channel clear (macMaxCsmaBackoffs)
Definition kw41zrf.h:116
uint32_t rx_warmup_time
RX warmup time, in event timer ticks.
Definition kw41zrf.h:110
uint32_t backoff_delay
CSMA delay for the current TX operation.
Definition kw41zrf.h:125
uint8_t csma_min_be
Minimum backoff exponent (macMinBe)
Definition kw41zrf.h:118
uint8_t csma_be
Counter used internally by send implementation.
Definition kw41zrf.h:122
uint32_t rf_osc_en_idle
RF_OSC_EN bits setting when RF module is in standby.
Definition kw41zrf.h:111
uint32_t tx_timeout
Used to timeout waiting for ACK during TRX.
Definition kw41zrf.h:126
uint8_t cca_result
Used for passing CCA result from ISR to user.
Definition kw41zrf.h:121
uint8_t pm_blocked
true if we have blocked a low power mode in the CPU
Definition kw41zrf.h:127
uint8_t idle_seq
state to return to after sending
Definition kw41zrf.h:120
uint8_t num_retrans
Counter used internally by send implementation.
Definition kw41zrf.h:124
thread_t * thread
Network driver thread, for providing feedback from IRQ handler.
Definition kw41zrf.h:108
uint8_t flags
Internal driver option flags.
Definition kw41zrf.h:113
uint8_t max_retrans
Maximum number of frame retransmissions when no Ack frame is received (macMaxFrameRetries)
Definition kw41zrf.h:114
netdev_ieee802154_t netdev
netdev parent struct
Definition kw41zrf.h:103
uint32_t tx_warmup_time
TX warmup time, in event timer ticks.
Definition kw41zrf.h:109
Extended structure to hold IEEE 802.15.4 driver state.
Definition ieee802154.h:100