kw41zrf_getset.h File Reference

get/set interfaces for kw41zrf driver More...

Detailed Description

get/set interfaces for kw41zrf driver

Author
Joakim NohlgÄrd joaki.nosp@m.m.no.nosp@m.hlgar.nosp@m.d@ei.nosp@m.stec..nosp@m.se

Definition in file kw41zrf_getset.h.

#include "kw41zrf.h"
+ Include dependency graph for kw41zrf_getset.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  kw41zrf_xcvseq {
  XCVSEQ_IDLE = 0b000, XCVSEQ_RECEIVE = 0b001, XCVSEQ_TRANSMIT = 0b010, XCVSEQ_CCA = 0b011,
  XCVSEQ_TX_RX = 0b100, XCVSEQ_CONTINUOUS_CCA = 0b101, XCVSEQ_DSM_IDLE = 0b1000
}
 Transceiver sequence identifiers.
 

Functions

void kw41zrf_set_tx_power (kw41zrf_t *dev, int16_t txpower)
 Set tx power of given device. More...
 
int16_t kw41zrf_get_txpower (kw41zrf_t *dev)
 Get tx power value of given device. More...
 
int kw41zrf_set_channel (kw41zrf_t *dev, uint8_t val)
 Set channel of given device. More...
 
uint8_t kw41zrf_get_channel (kw41zrf_t *dev)
 Get channel of given device. More...
 
void kw41zrf_set_pan (kw41zrf_t *dev, uint16_t pan)
 Set PAN ID of a given device. More...
 
uint16_t kw41zrf_get_pan (kw41zrf_t *dev)
 Get PAN ID of given device. More...
 
void kw41zrf_set_addr_short (kw41zrf_t *dev, const network_uint16_t *addr)
 Set short address of a given device. More...
 
void kw41zrf_set_addr_long (kw41zrf_t *dev, const eui64_t *addr)
 Set long address of a given device. More...
 
void kw41zrf_get_addr_short (kw41zrf_t *dev, network_uint16_t *addr)
 Get short address of a given device. More...
 
void kw41zrf_get_addr_long (kw41zrf_t *dev, eui64_t *addr)
 Get long address of a given device. More...
 
int8_t kw41zrf_get_cca_threshold (kw41zrf_t *dev)
 Get CCA threshold of a given device. More...
 
void kw41zrf_set_cca_threshold (kw41zrf_t *dev, int8_t value)
 Set CCA threshold of a given device. More...
 
void kw41zrf_set_cca_mode (kw41zrf_t *dev, uint8_t mode)
 Set CCA mode of a given device. More...
 
uint8_t kw41zrf_get_cca_mode (kw41zrf_t *dev)
 Get CCA mode of a given device. More...
 
int8_t kw41zrf_get_ed_level (kw41zrf_t *dev)
 Get latest ED measurement from the device. More...
 
int kw41zrf_cca (kw41zrf_t *dev)
 Perform one CCA measurement and return the result. More...
 
void kw41zrf_set_rx_watermark (kw41zrf_t *dev, uint8_t value)
 Set receive watermark to signal when the packet buffer is part full. More...
 
void kw41zrf_set_option (kw41zrf_t *dev, uint8_t option, uint8_t state)
 Set netopt a given device. More...
 

Internal device option flags

#define KW41ZRF_OPT_CSMA   (0x01u)
 use CSMA/CA algorithm for sending
 
#define KW41ZRF_OPT_PROMISCUOUS   (0x02u)
 promiscuous mode active
 
#define KW41ZRF_OPT_PRELOADING   (0x04u)
 preloading enabled
 
#define KW41ZRF_OPT_TELL_TX_START   (0x08u)
 notify MAC layer on TX start
 
#define KW41ZRF_OPT_TELL_TX_END   (0x10u)
 notify MAC layer on TX finished
 
#define KW41ZRF_OPT_TELL_RX_START   (0x20u)
 notify MAC layer on RX start
 
#define KW41ZRF_OPT_TELL_RX_END   (0x40u)
 notify MAC layer on RX finished
 
#define KW41ZRF_OPT_AUTOACK   (0x80u)
 automatic sending of ACKs
 
#define KW41ZRF_OPT_ACK_PENDING   (0x81u)
 set pending bit on auto ACKs
 

Function Documentation

◆ kw41zrf_cca()

int kw41zrf_cca ( kw41zrf_t dev)

Perform one CCA measurement and return the result.

Parameters
[in]devkw41zrf device descriptor
Returns
0 if channel is idle
1 if channel is busy

◆ kw41zrf_get_addr_long()

void kw41zrf_get_addr_long ( kw41zrf_t dev,
eui64_t addr 
)

Get long address of a given device.

Parameters
[in]devkw41zrf device descriptor
[out]addrcurrent long address

◆ kw41zrf_get_addr_short()

void kw41zrf_get_addr_short ( kw41zrf_t dev,
network_uint16_t addr 
)

Get short address of a given device.

Parameters
[in]devkw41zrf device descriptor
[out]addrcurrent short address

◆ kw41zrf_get_cca_mode()

uint8_t kw41zrf_get_cca_mode ( kw41zrf_t dev)

Get CCA mode of a given device.

Parameters
[in]devkw41zrf device descriptor
Returns
current CCA mode

◆ kw41zrf_get_cca_threshold()

int8_t kw41zrf_get_cca_threshold ( kw41zrf_t dev)

Get CCA threshold of a given device.

Parameters
[in]devkw41zrf device descriptor
Returns
current CCA threshold

◆ kw41zrf_get_channel()

uint8_t kw41zrf_get_channel ( kw41zrf_t dev)

Get channel of given device.

Parameters
[in]devkw41zrf device descriptor
Returns
current channel

◆ kw41zrf_get_ed_level()

int8_t kw41zrf_get_ed_level ( kw41zrf_t dev)

Get latest ED measurement from the device.

Parameters
[in]devkw41zrf device descriptor
Returns
most recent ED level

◆ kw41zrf_get_pan()

uint16_t kw41zrf_get_pan ( kw41zrf_t dev)

Get PAN ID of given device.

Parameters
[in]devkw41zrf device descriptor
Returns
current PAN ID

◆ kw41zrf_get_txpower()

int16_t kw41zrf_get_txpower ( kw41zrf_t dev)

Get tx power value of given device.

Parameters
[in]devkw41zrf device descriptor
Returns
current tx power value

◆ kw41zrf_set_addr_long()

void kw41zrf_set_addr_long ( kw41zrf_t dev,
const eui64_t addr 
)

Set long address of a given device.

Parameters
[in]devkw41zrf device descriptor
[in]addrlong address

◆ kw41zrf_set_addr_short()

void kw41zrf_set_addr_short ( kw41zrf_t dev,
const network_uint16_t addr 
)

Set short address of a given device.

Parameters
[in]devkw41zrf device descriptor
[in]addrshort address

◆ kw41zrf_set_cca_mode()

void kw41zrf_set_cca_mode ( kw41zrf_t dev,
uint8_t  mode 
)

Set CCA mode of a given device.

Parameters
[in]devkw41zrf device descriptor
[in]modeCCA mode

◆ kw41zrf_set_cca_threshold()

void kw41zrf_set_cca_threshold ( kw41zrf_t dev,
int8_t  value 
)

Set CCA threshold of a given device.

Parameters
[in]devkw41zrf device descriptor
[in]valueCCA threshold

◆ kw41zrf_set_channel()

int kw41zrf_set_channel ( kw41zrf_t dev,
uint8_t  val 
)

Set channel of given device.

Parameters
[in]devkw41zrf device descriptor
[in]valchannel

◆ kw41zrf_set_option()

void kw41zrf_set_option ( kw41zrf_t dev,
uint8_t  option,
uint8_t  state 
)

Set netopt a given device.

Parameters
[in]devkw41zrf device descriptor
[in]optionNetopt option type
[in]statestate

◆ kw41zrf_set_pan()

void kw41zrf_set_pan ( kw41zrf_t dev,
uint16_t  pan 
)

Set PAN ID of a given device.

Parameters
[in]devkw41zrf device descriptor
[in]panPAN ID value

◆ kw41zrf_set_rx_watermark()

void kw41zrf_set_rx_watermark ( kw41zrf_t dev,
uint8_t  value 
)

Set receive watermark to signal when the packet buffer is part full.

Parameters
[in]devkw41zrf device descriptor
[in]valuewatermark

◆ kw41zrf_set_tx_power()

void kw41zrf_set_tx_power ( kw41zrf_t dev,
int16_t  txpower 
)

Set tx power of given device.

Parameters
[in]devkw41zrf device descriptor
[in]txpowertransmit power in dBm