Loading...
Searching...
No Matches
kw41zrf_getset.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 SKF AB
3 * SPDX-FileCopyrightText: 2016 Phytec Messtechnik GmbH
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
18
19#include <stdint.h>
20#include "kw41zrf.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30#define KW41ZRF_OPT_CCA_BEFORE_TX (0x01u)
31#define KW41ZRF_OPT_PROMISCUOUS (0x02u)
32#define KW41ZRF_OPT_PRELOADING (0x04u)
33#define KW41ZRF_OPT_AUTOACK (0x80u)
34#define KW41ZRF_OPT_ACK_PENDING (0x81u)
36
39 XCVSEQ_IDLE = 0b000,
40 XCVSEQ_RECEIVE = 0b001,
41 XCVSEQ_TRANSMIT = 0b010,
42 XCVSEQ_CCA = 0b011,
43 XCVSEQ_TX_RX = 0b100,
44 XCVSEQ_CONTINUOUS_CCA = 0b101,
45 /* Other values are reserved */
46 /* Special value for idle_seq when sleeping */
47 XCVSEQ_DSM_IDLE = 0b1000,
48};
49
56void kw41zrf_set_tx_power(kw41zrf_t *dev, int16_t txpower);
57
66
73int kw41zrf_set_channel(kw41zrf_t *dev, uint8_t val);
74
83
90void kw41zrf_set_pan(kw41zrf_t *dev, uint16_t pan);
91
97void kw41zrf_set_pan_coord(bool is_coord);
98
107
115
123
131
139
147
154void kw41zrf_set_cca_threshold(kw41zrf_t *dev, int8_t value);
155
162void kw41zrf_set_cca_type(kw41zrf_t *dev, uint8_t type);
163
172
179void kw41zrf_set_cca3_mode(uint8_t mode);
180
189
199
206void kw41zrf_set_rx_watermark(kw41zrf_t *dev, uint8_t value);
207
215void kw41zrf_set_option(kw41zrf_t *dev, uint8_t option, uint8_t state);
216
223
230void kw41zrf_set_partition_enable(uint8_t en, uint8_t partition_shift);
231
240uint8_t kw41zrf_get_partition_enable(uint32_t partition_mask, uint8_t partition_shift);
241
250uint8_t kw41zrf_get_partition_start(uint32_t partition_mask, uint8_t partition_shift);
251
260{
261 (void) dev;
262 return (ZLL->LQI_AND_RSSI & ZLL_LQI_AND_RSSI_LQI_VALUE_MASK)
263 >> ZLL_LQI_AND_RSSI_LQI_VALUE_SHIFT;
264}
265
274{
275 (void) dev;
276 return (int8_t)((ZLL->LQI_AND_RSSI & ZLL_LQI_AND_RSSI_RSSI_MASK)
277 >> ZLL_LQI_AND_RSSI_RSSI_SHIFT);
278}
279
280#ifdef __cplusplus
281}
282#endif
283
be_uint16_t network_uint16_t
A 16 bit integer in network byte order.
Definition byteorder.h:92
Interface definition for the kw41zrf driver.
uint8_t kw41zrf_get_channel(kw41zrf_t *dev)
Get channel of given device.
void kw41zrf_set_partition_enable(uint8_t en, uint8_t partition_shift)
Enable or disable a partition.
void kw41zrf_set_cca3_mode(uint8_t mode)
Set CCA3 mode of a kw41zrf device.
int16_t kw41zrf_get_tx_power(kw41zrf_t *dev)
Get tx power value of given device.
void kw41zrf_get_addr_long(kw41zrf_t *dev, eui64_t *addr)
Get long address of a given device.
void kw41zrf_set_pan_coord(bool is_coord)
Set if the kw41zrf device is a coordinator.
void kw41zrf_set_tx_power(kw41zrf_t *dev, int16_t txpower)
Set tx power of given device.
void kw41zrf_set_cca_threshold(kw41zrf_t *dev, int8_t value)
Set CCA threshold of a given device.
int kw41zrf_set_channel(kw41zrf_t *dev, uint8_t val)
Set channel of given device.
void kw41zrf_set_option(kw41zrf_t *dev, uint8_t option, uint8_t state)
Set netopt a given device.
void kw41zrf_set_cca_type(kw41zrf_t *dev, uint8_t type)
Set CCA type of a kw41zrf device.
void kw41zrf_get_addr_short(kw41zrf_t *dev, network_uint16_t *addr)
Get short address of a given device.
void kw41zrf_set_addr_long(kw41zrf_t *dev, const eui64_t *addr)
Set long address of a given device.
int8_t kw41zrf_get_cca_threshold(kw41zrf_t *dev)
Get CCA threshold of a given device.
void kw41zrf_set_pan(kw41zrf_t *dev, uint16_t pan)
Set PAN ID of a given device.
int8_t kw41zrf_get_ed_level(kw41zrf_t *dev)
Get latest ED measurement from the device.
int kw41zrf_cca(kw41zrf_t *dev)
Perform one CCA measurement and return the result.
void kw41zrf_set_addr_short(kw41zrf_t *dev, const network_uint16_t *addr)
Set short address of a given device.
void kw41zrf_set_rx_watermark(kw41zrf_t *dev, uint8_t value)
Set receive watermark to signal when the packet buffer is part full.
kw41zrf_xcvseq
Transceiver sequence identifiers.
uint8_t kw41zrf_get_cca_type(kw41zrf_t *dev)
Get CCA type of a kw41zrf device.
uint8_t kw41zrf_get_partition_start(uint32_t partition_mask, uint8_t partition_shift)
Get partition start value.
uint8_t kw41zrf_get_lqi_value(kw41zrf_t *dev)
Get Link Quality Indicator(LQI) value.
uint8_t kw41zrf_get_1st_free_idx_sap0(void)
Get the first free index of the Source Address Present partition_0.
uint8_t kw41zrf_get_partition_enable(uint32_t partition_mask, uint8_t partition_shift)
Get partition enable status.
uint16_t kw41zrf_get_pan(kw41zrf_t *dev)
Get PAN ID of given device.
int8_t kw41zrf_get_rssi_value(kw41zrf_t *dev)
Get Received Signal Strength Indicator(RSSI) value.
Device descriptor for KW41ZRF radio devices.
Definition kw41zrf.h:110
Data type to represent an EUI-64.
Definition eui64.h:52