µracoli Manual Version foo

- µracoli
- User Guide
- Reference Guide

const.h
1 /* Copyright (c) 2007 - 2013
2 Marco Arena
3 Axel Wachtler
4
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
9 are met:
10
11 * Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16 * Neither the name of the authors nor the names of its contributors
17 may be used to endorse or promote products derived from this software
18 without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE. */
31
32 /* $Id$ */
38 /*====================================================================*/
39 #ifndef CONST_H
40 #define CONST_H
41 #include <stdint.h>
42 #include <stdbool.h>
43
44 /*=== board type constants ===================================================*/
50 #define BOARD_NONE (0)
51
52 /* the legacy boards are sorted alphabetically */
53 #define BOARD_ANY2400 (1)
54 #define BOARD_ANY2400ST (2)
55 #define BOARD_ANY900 (3)
56 #define BOARD_ANY900ST (4)
57 #define BOARD_BAT (5)
58 #define BOARD_BITBEAN (6)
59 #define BOARD_CBB212 (7)
60 #define BOARD_CBB230 (8)
61 #define BOARD_CBB230B (9)
62 #define BOARD_CBB231 (10)
63 #define BOARD_CBB232 (11)
64 #define BOARD_CBB233 (12)
65 #define BOARD_DERFA1 (13)
66 #define BOARD_DERFTORCBRFA1 (14)
67 #define BOARD_DRACULA (15)
68 #define BOARD_IBDT212 (16)
69 #define BOARD_IBDT231 (17)
70 #define BOARD_IBDT232 (18)
71 #define BOARD_ICM230_11 (19)
72 #define BOARD_ICM230_12A (20)
73 #define BOARD_ICM230_12B (21)
74 #define BOARD_ICM230_12C (22)
75 #define BOARD_ICS230_11 (23)
76 #define BOARD_ICS230_12 (24)
77 #define BOARD_ICT230 (25)
78 #define BOARD_IM240A (26)
79 #define BOARD_IM240A_EVAL (27)
80 #define BOARD_LGEE231 (28)
81 #define BOARD_LGEE231_V2 (29)
82 #define BOARD_MIDGEE (30)
83 #define BOARD_MNB900 (31)
84 #define BOARD_MUSE231 (32)
85 #define BOARD_MUSEII232 (33)
86 #define BOARD_MUSEIIRFA (34)
87 #define BOARD_PINOCCIO (35)
88 #define BOARD_PSK212 (36)
89 #define BOARD_PSK230 (37)
90 #define BOARD_PSK230B (38)
91 #define BOARD_PSK231 (39)
92 #define BOARD_PSK232 (40)
93 #define BOARD_PSK233 (41)
94 #define BOARD_RADIOFARO (42)
95 #define BOARD_RADIOFARO_V1 (43)
96 #define BOARD_RAVRF230A (44)
97 #define BOARD_RAVRF230B (45)
98 #define BOARD_RBB128RFA1 (46)
99 #define BOARD_RBB212 (47)
100 #define BOARD_RBB230 (48)
101 #define BOARD_RBB230B (49)
102 #define BOARD_RBB231 (50)
103 #define BOARD_RBB232 (51)
104 #define BOARD_RBB233 (52)
105 #define BOARD_RDK212 (53)
106 #define BOARD_RDK230 (54)
107 #define BOARD_RDK230B (55)
108 #define BOARD_RDK231 (56)
109 #define BOARD_RDK232 (57)
110 #define BOARD_RDK233 (58)
111 #define BOARD_ROSE231 (59)
112 #define BOARD_RZUSB (60)
113 #define BOARD_STB128RFA1 (61)
114 #define BOARD_STB212 (62)
115 #define BOARD_STB230 (63)
116 #define BOARD_STB230B (64)
117 #define BOARD_STB231 (65)
118 #define BOARD_STB232 (66)
119 #define BOARD_STB233 (67)
120 #define BOARD_STKM16 (68)
121 #define BOARD_STKM8 (69)
122 #define BOARD_TINY230 (70)
123 #define BOARD_TINY231 (71)
124 #define BOARD_WDBA1281 (72)
125 #define BOARD_WPROG (73)
126 #define BOARD_XXO (74)
127 #define BOARD_ZGBH212 (75)
128 #define BOARD_ZGBH230 (76)
129 #define BOARD_ZGBH231 (77)
130 #define BOARD_ZGBL212 (78)
131 #define BOARD_ZGBL230 (79)
132 #define BOARD_ZGBL231 (80)
133 #define BOARD_ZGBT1281A2NOUART (81)
134 #define BOARD_ZGBT1281A2UART0 (82)
135 #define BOARD_ZGBT1281A2UART1 (83)
136 #define BOARD_ZIGDUINO (84)
137
138 /* beyond this point the boards are added chronologically */
139 #define BOARD_STB256RFR2 (85)
140 #define BOARD_RASPBEE (86)
141 #define BOARD_DERFN256U0 (87)
142 #define BOARD_DERFN256U0PA (88)
143 #define BOARD_DERFN128 (89)
144 #define BOARD_DERFN128U0 (90)
145 #define BOARD_L3Y (91)
146 #define BOARD_SPARCRFA1 (92)
147
148 #define BOARD_ATZB256RFR2XPRO (93)
149 #define BOARD_ATRCB256RFR2XPRO (94)
150 #define BOARD_ATZB256RFR2 (95)
151
152 #define BOARD_ATZBX233XPRO (96)
153 #define BOARD_ATZBX233USB (97)
154 #define BOARD_ATZBX233 (98)
155
156 #define BOARD_ATZBX212BXPRO (99)
157 #define BOARD_ATZBX212BUSB (100)
158 #define BOARD_ATZBX212B (101)
159
160 #define BOARD_XMA1U233XPRO (102)
161 #define BOARD_XME5RZ230 (103)
162 #define BOARD_XME5RZ231 (104)
163 #define BOARD_XME5RZ212 (105)
164
165 #define BOARD_SAMR21XPRO (110)
166
167 #define BOARD_LAST (BOARD_SAMR21XPRO)
168
176 /*=== radio constants ================================================*/
177 #define RADIO_AT86RF230 (1)
178 #define RADIO_AT86RF230A (RADIO_AT86RF230)
179 #define RADIO_AT86RF230B (2)
180 #define RADIO_AT86RF231 (3)
181 #define RADIO_AT86RF212 (4)
182 #define RADIO_ATMEGA128RFA1_A (5)
183 #define RADIO_ATMEGA128RFA1_B (6)
184 #define RADIO_ATMEGA128RFA1_C (7)
185 #define RADIO_ATMEGA128RFA1_D (8)
186 #define RADIO_AT86RF232 (9)
187 #define RADIO_AT86RF233 (10)
188 #define RADIO_ATMEGA256RFR2 (11)
189 #define RADIO_ATMEGA2564RFR2 (12)
191 #define RADIO_BAND_700 (1)
192 #define RADIO_BAND_800 (2)
193 #define RADIO_BAND_900 (3)
194 #define RADIO_BAND_2400 (4)
196 /*=== modulation schemes =====================================================*/
197 #define MOD_BPSK_20 (0)
198 #define MOD_BPSK_40 (1)
199 #define MOD_OQPSK_100 (2)
200 #define MOD_OQPSK_200 (3)
201 #define MOD_OQPSK_250 (4)
202 #define MOD_OQPSK_400 (5)
203 #define MOD_OQPSK_500 (6)
204 #define MOD_OQPSK_1000 (7)
205 #define MOD_OQPSK_2000 (8)
207 /* === sensor types ========================================================= */
208 #define SENSOR_NONE (0)
209 #define SENSOR_MCU_T (1)
210 #define SENSOR_MCU_VTG (2)
211 #define SENSOR_SHT21_RH (3)
212 #define SENSOR_SHT21_T (4)
213 #define SENSOR_ADXL345_ACC (5)
214 #define SENSOR_MMA7455_ACC (6)
215 #define SENSOR_LM73 (7)
216 #define SENSOR_TSL2550 (8)
217 #define SENSOR_LEDPS (9)
218 #define SENSOR_HMC5883L (10)
219 #define SENSOR_TRXVTG (11)
220 #define SENSOR_DS18B20 (12)
221
228 /*=== HIF type constants =====================================================*/
229 #define HIF_NONE (0)
231 /* AVR8 devices */
232 #define HIF_UART_0 (10)
233 #define HIF_UART_1 (11)
235 /* Xmega devices */
236 #define HIF_USARTD0 (20)
237 #define HIF_USARTE0 (21)
239 #define HIF_FT245 (30)
240 #define HIF_AT90USB (31)
242 /* SAM devices */
243 #define HIF_SERCOM0 (40)
245 /*=== USB constants ==========================================================*/
246
254 #define URACOLI_USB_VID (5824)
255
259 #define URACOLI_USB_PID (2183)
260
261 #define URACOLI_USB_BCD_RELEASE (0x100)
262 #define URACOLI_USB_VENDOR_NAME L"URACOLI"
263 #define URACOLI_USB_PRODUCT_NAME L"RZUSBSTICK"
264
272 /*=== spi constants ==========================================================*/
273 #define SPI_RATE_1_2 (4)
274 #define SPI_RATE_1_4 (0)
275 #define SPI_RATE_1_8 (5)
276 #define SPI_RATE_1_16 (1)
277 #define SPI_RATE_1_32 (6)
278 #define SPI_RATE_1_64 (2)
279 #define SPI_RATE_1_128 (3)
284 #if defined (DOXYGEN)
285
286 #define SHORTENUM
287 #else
288 #define SHORTENUM __attribute__((packed))
289 #endif
290
295 #define FCTL_DATA _BV(0)
296 #define FCTL_ACK _BV(5)
297 #define FCTL_IPAN _BV(6)
298 #define FCTL_DST_SHORT 0x0800
299 #define FCTL_DST_LONG 0x0c00
300 #define FCTL_SRC_SHORT 0x8000
301 #define FCTL_SRC_LONG 0xc000
303 #define FCTL_SRC_MASK (FCTL_SRC_LONG)
304 #define FCTL_DST_MASK (FCTL_DST_LONG)
305 #define FCTL_IPAN_MASK (FCTL_IPAN)
306
308 #define DEFAULT_PAN_ID (0xb5c2)
309
310 #define DEFAULT_SHORT_ADDRESS (0x6172)
311
314 /* === Types ================================================================ */
315
316
323 typedef int8_t channel_t;
324
326 typedef int8_t txpwr_t;
327
331 typedef bool rxidle_t;
332
334 typedef uint8_t ccamode_t;
335
336 /* ... cca_ed_tresh, clkm, pdt, ... */
337
341 typedef struct
342 {
344 channel_t chan;
346 unsigned int txp : 4;
348 unsigned int cca : 2;
350 unsigned int edt : 4;
351
353 unsigned int clkm : 3;
354
355 } trx_param_t;
356
358 #endif /* #ifndef CONST_H */
ccamode_t
uint8_t ccamode_t
Definition: const.h:334
rxidle_t
bool rxidle_t
Definition: const.h:331
txpwr_t
int8_t txpwr_t
Definition: const.h:326
trx_param_t
Definition: const.h:341
trx_param_t::chan
channel_t chan
Definition: const.h:344
channel_t
int8_t channel_t
Definition: const.h:323