cc110x-internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
3  * Copyright (C) 2014 Freie Universität Berlin
4  * Copyright (C) 2013 INRIA
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
22 #ifndef CC110X_INTERNAL_H
23 #define CC110X_INTERNAL_H
24 
25 #include <stdint.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define CC110X_RXBUF_SIZE (2)
32 #define CC110X_MAX_DATA_LENGTH (58+64)
33 
34 #define CC110X_HEADER_LENGTH (3)
36 #define CC110X_BROADCAST_ADDRESS (0x00)
38 #define MIN_UID (0x01)
40 #define MAX_UID (0xFF)
43 #define MIN_CHANNR (0)
44 #define MAX_CHANNR (24)
46 #define CC110X_PACKET_LENGTH (0xFF)
47 #define CC110X_SYNC_WORD_TX_TIME (90000)
52 #define RESET_WAIT_TIME (610)
54 #define IDLE_TO_RX_TIME (122)
55 #define CS_SO_WAIT_TIME (488)
57 #define CC110X_GDO1_LOW_RETRY (100)
59 #ifndef CC110X_DEFAULT_CHANNEL
60 #define CC110X_DEFAULT_CHANNEL (0)
61 #endif
62 #define CC110X_MIN_CHANNR (0)
63 #define CC110X_MAX_CHANNR (0)
69 enum {
70  RADIO_UNKNOWN,
71  RADIO_IDLE,
72  RADIO_TX_BUSY,
73  RADIO_RX,
74  RADIO_RX_BUSY,
75  RADIO_PWD,
76 };
82 extern char cc110x_conf[];
83 
107 typedef struct __attribute__((packed))
108 {
109  uint8_t length;
110  uint8_t address;
111  uint8_t phy_src;
112  uint8_t flags;
113  uint8_t data[CC110X_MAX_DATA_LENGTH];
114 } cc110x_pkt_t;
115 
119 typedef struct {
120  uint8_t rssi;
121  uint8_t lqi;
122  uint8_t pos;
123  cc110x_pkt_t packet;
125 
132 };
133 
137 typedef struct {
138  uint8_t _IOCFG2;
139  uint8_t _IOCFG1;
140  uint8_t _IOCFG0;
141  uint8_t _FIFOTHR;
142  uint8_t _SYNC1;
143  uint8_t _SYNC0;
144  uint8_t _PKTLEN;
145  uint8_t _PKTCTRL1;
146  uint8_t _PKTCTRL0;
147  uint8_t _ADDR;
148  uint8_t _CHANNR;
149  uint8_t _FSCTRL1;
150  uint8_t _FSCTRL0;
151  uint8_t _FREQ2;
152  uint8_t _FREQ1;
153  uint8_t _FREQ0;
154  uint8_t _MDMCFG4;
155  uint8_t _MDMCFG3;
156  uint8_t _MDMCFG2;
157  uint8_t _MDMCFG1;
158  uint8_t _MDMCFG0;
159  uint8_t _DEVIATN;
160  uint8_t _MCSM2;
161  uint8_t _MCSM1;
162  uint8_t _MCSM0;
163  uint8_t _FOCCFG;
164  uint8_t _BSCFG;
165  uint8_t _AGCCTRL2;
166  uint8_t _AGCCTRL1;
167  uint8_t _AGCCTRL0;
168  uint8_t _WOREVT1;
169  uint8_t _WOREVT0;
170  uint8_t _WORCTRL;
171  uint8_t _FREND1;
172  uint8_t _FREND0;
173  uint8_t _FSCAL3;
174  uint8_t _FSCAL2;
175  uint8_t _FSCAL1;
176  uint8_t _FSCAL0;
182 typedef struct {
183  cc110x_reg_t reg_cfg;
184  uint8_t pa_power;
186 
190 typedef struct {
191  uint8_t _RSSI;
192  uint8_t _LQI;
194 
198 typedef struct cc110x_statistic {
199  uint32_t packets_in;
200  uint32_t packets_in_crc_fail;
201  uint32_t packets_in_while_tx;
202  uint32_t raw_packets_out;
204 
205 #ifdef __cplusplus
206 }
207 #endif
209 #endif /* CC110X_INTERNAL_H */
turn radio on
CC110X layer 0 protocol.
char cc110x_conf[]
array holding cc110x register values
struct holding cc110x packet + metadata
turn radio off
Statistic interface for debugging.
Radio Control Flags.
cc110x_radio_mode
enum for holding cc110x radio on/off state
leave mode unchanged
CC110x register configuration.
struct cc110x_statistic cc110x_statistic_t
Statistic interface for debugging.
CC110x radio configuration.