const.h
Go to the documentation of this file.
00001 /* Copyright (c) 2007 - 2013
00002     Marco Arena
00003     Axel Wachtler
00004 
00005    All rights reserved.
00006 
00007    Redistribution and use in source and binary forms, with or without
00008    modification, are permitted provided that the following conditions
00009    are met:
00010 
00011    * Redistributions of source code must retain the above copyright
00012      notice, this list of conditions and the following disclaimer.
00013    * Redistributions in binary form must reproduce the above copyright
00014      notice, this list of conditions and the following disclaimer in the
00015      documentation and/or other materials provided with the distribution.
00016    * Neither the name of the authors nor the names of its contributors
00017      may be used to endorse or promote products derived from this software
00018      without specific prior written permission.
00019 
00020    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00022    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00023    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00024    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00025    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00026    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00029    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00030    POSSIBILITY OF SUCH DAMAGE. */
00031 
00032 /* $Id$ */
00038 /*====================================================================*/
00039 #ifndef CONST_H
00040 #define CONST_H
00041 #include <stdint.h>
00042 #include <stdbool.h>
00043 
00044 /*=== board type constants ===================================================*/
00050 #define BOARD_NONE (0)
00051 
00052 /* the legacy boards are sorted alphabetically */
00053 #define BOARD_ANY2400 (1)
00054 #define BOARD_ANY2400ST (2)
00055 #define BOARD_ANY900 (3)
00056 #define BOARD_ANY900ST (4)
00057 #define BOARD_BAT (5)
00058 #define BOARD_BITBEAN (6)
00059 #define BOARD_CBB212 (7)
00060 #define BOARD_CBB230 (8)
00061 #define BOARD_CBB230B (9)
00062 #define BOARD_CBB231 (10)
00063 #define BOARD_CBB232 (11)
00064 #define BOARD_CBB233 (12)
00065 #define BOARD_DERFA1 (13)
00066 #define BOARD_DERFTORCBRFA1 (14)
00067 #define BOARD_DRACULA (15)
00068 #define BOARD_IBDT212 (16)
00069 #define BOARD_IBDT231 (17)
00070 #define BOARD_IBDT232 (18)
00071 #define BOARD_ICM230_11 (19)
00072 #define BOARD_ICM230_12A (20)
00073 #define BOARD_ICM230_12B (21)
00074 #define BOARD_ICM230_12C (22)
00075 #define BOARD_ICS230_11 (23)
00076 #define BOARD_ICS230_12 (24)
00077 #define BOARD_ICT230 (25)
00078 #define BOARD_IM240A (26)
00079 #define BOARD_IM240A_EVAL (27)
00080 #define BOARD_LGEE231 (28)
00081 #define BOARD_LGEE231_V2 (29)
00082 #define BOARD_MIDGEE (30)
00083 #define BOARD_MNB900 (31)
00084 #define BOARD_MUSE231 (32)
00085 #define BOARD_MUSEII232 (33)
00086 #define BOARD_MUSEIIRFA (34)
00087 #define BOARD_PINOCCIO (35)
00088 #define BOARD_PSK212 (36)
00089 #define BOARD_PSK230 (37)
00090 #define BOARD_PSK230B (38)
00091 #define BOARD_PSK231 (39)
00092 #define BOARD_PSK232 (40)
00093 #define BOARD_PSK233 (41)
00094 #define BOARD_RADIOFARO (42)
00095 #define BOARD_RADIOFARO_V1 (43)
00096 #define BOARD_RAVRF230A (44)
00097 #define BOARD_RAVRF230B (45)
00098 #define BOARD_RBB128RFA1 (46)
00099 #define BOARD_RBB212 (47)
00100 #define BOARD_RBB230 (48)
00101 #define BOARD_RBB230B (49)
00102 #define BOARD_RBB231 (50)
00103 #define BOARD_RBB232 (51)
00104 #define BOARD_RBB233 (52)
00105 #define BOARD_RDK212 (53)
00106 #define BOARD_RDK230 (54)
00107 #define BOARD_RDK230B (55)
00108 #define BOARD_RDK231 (56)
00109 #define BOARD_RDK232 (57)
00110 #define BOARD_RDK233 (58)
00111 #define BOARD_ROSE231 (59)
00112 #define BOARD_RZUSB (60)
00113 #define BOARD_STB128RFA1 (61)
00114 #define BOARD_STB212 (62)
00115 #define BOARD_STB230 (63)
00116 #define BOARD_STB230B (64)
00117 #define BOARD_STB231 (65)
00118 #define BOARD_STB232 (66)
00119 #define BOARD_STB233 (67)
00120 #define BOARD_STKM16 (68)
00121 #define BOARD_STKM8 (69)
00122 #define BOARD_TINY230 (70)
00123 #define BOARD_TINY231 (71)
00124 #define BOARD_WDBA1281 (72)
00125 #define BOARD_WPROG (73)
00126 #define BOARD_XXO (74)
00127 #define BOARD_ZGBH212 (75)
00128 #define BOARD_ZGBH230 (76)
00129 #define BOARD_ZGBH231 (77)
00130 #define BOARD_ZGBL212 (78)
00131 #define BOARD_ZGBL230 (79)
00132 #define BOARD_ZGBL231 (80)
00133 #define BOARD_ZGBT1281A2NOUART (81)
00134 #define BOARD_ZGBT1281A2UART0 (82)
00135 #define BOARD_ZGBT1281A2UART1 (83)
00136 #define BOARD_ZIGDUINO (84)
00137 
00138 /* beyond this point the boards are added chronologically */
00139 #define BOARD_STB256RFR2 (85)
00140 #define BOARD_RASPBEE (86)
00141 // leave a gap for boards on mainline.
00142 #define BOARD_DERFA2 (91)
00143 #define BOARD_DERFA2P (92)
00144 
00145 #define BOARD_LAST (BOARD_RASPBEE)
00146 
00153 /*=== radio constants ================================================*/
00154 #define  RADIO_AT86RF230 (1) 
00155 #define  RADIO_AT86RF230A (RADIO_AT86RF230) 
00156 #define  RADIO_AT86RF230B (2) 
00157 #define  RADIO_AT86RF231 (3) 
00158 #define  RADIO_AT86RF212 (4) 
00159 #define  RADIO_ATMEGA128RFA1_A (5) 
00160 #define  RADIO_ATMEGA128RFA1_B (6) 
00161 #define  RADIO_ATMEGA128RFA1_C (7) 
00162 #define  RADIO_ATMEGA128RFA1_D (8) 
00163 #define  RADIO_AT86RF232 (9) 
00164 #define  RADIO_AT86RF233 (10) 
00165 #define  RADIO_ATMEGA256RFR2 (11) 
00167 #define RADIO_BAND_700 (1) 
00168 #define RADIO_BAND_800 (2) 
00169 #define RADIO_BAND_900 (3) 
00170 #define RADIO_BAND_2400 (4)  
00172 /*=== modulation schemes =====================================================*/
00173 #define MOD_BPSK_20    (0) 
00174 #define MOD_BPSK_40    (1) 
00175 #define MOD_OQPSK_100  (2) 
00176 #define MOD_OQPSK_200  (3) 
00177 #define MOD_OQPSK_250  (4) 
00178 #define MOD_OQPSK_400  (5) 
00179 #define MOD_OQPSK_500  (6) 
00180 #define MOD_OQPSK_1000 (7) 
00181 #define MOD_OQPSK_2000 (8) 
00183 /* === sensor types ========================================================= */
00184 #define SENSOR_MCU_T (1)
00185 #define SENSOR_MCU_VTG (2)
00186 #define SENSOR_SHT21_RH (3)
00187 #define SENSOR_SHT21_T (4)
00188 
00196 /*=== HIF type constants =====================================================*/
00197 #define  HIF_NONE     (0)  
00198 #define  HIF_UART_0   (10) 
00199 #define  HIF_UART_1   (11) 
00200 #define  HIF_FT245    (20) 
00201 #define  HIF_AT90USB  (21) 
00203 /*=== USB constants ==========================================================*/
00204 
00212 #define URACOLI_USB_VID (5824)
00213 
00217 #define URACOLI_USB_PID (2183)
00218 
00219 #define URACOLI_USB_BCD_RELEASE (0x100)
00220 #define URACOLI_USB_VENDOR_NAME  L"URACOLI"
00221 #define URACOLI_USB_PRODUCT_NAME L"RZUSBSTICK"
00222 
00230 /*=== spi constants ==========================================================*/
00231 #define SPI_RATE_1_2      (4) 
00232 #define SPI_RATE_1_4      (0) 
00233 #define SPI_RATE_1_8      (5) 
00234 #define SPI_RATE_1_16     (1) 
00235 #define SPI_RATE_1_32     (6) 
00236 #define SPI_RATE_1_64     (2) 
00237 #define SPI_RATE_1_128    (3) 
00242 #if defined (DOXYGEN)
00243 
00244 #define SHORTENUM
00245 #else
00246 #define SHORTENUM  __attribute__((packed))
00247 #endif
00248 
00253 #define FCTL_DATA _BV(0)        
00254 #define FCTL_ACK  _BV(5)        
00255 #define FCTL_IPAN _BV(6)        
00256 #define FCTL_DST_SHORT 0x0800   
00257 #define FCTL_DST_LONG  0x0c00   
00258 #define FCTL_SRC_SHORT 0x8000   
00259 #define FCTL_SRC_LONG  0xc000   
00261 #define FCTL_SRC_MASK (FCTL_SRC_LONG)
00262 #define FCTL_DST_MASK (FCTL_DST_LONG)
00263 #define FCTL_IPAN_MASK (FCTL_IPAN)
00264 
00266 /* === Types ================================================================ */
00267 
00268 
00275 typedef int8_t  channel_t;
00276 
00278 typedef int8_t  txpwr_t;
00279 
00283 typedef bool    rxidle_t;
00284 
00286 typedef uint8_t ccamode_t;
00287 
00288 /* ... cca_ed_tresh, clkm, pdt, ... */
00289 
00293 typedef struct
00294 {
00296     channel_t chan;
00298     unsigned int txp   : 4;
00300     unsigned int cca   : 2;
00302     unsigned int edt   : 4;
00303 
00305     unsigned int clkm  : 3;
00306 
00307 } trx_param_t;
00308 
00310 #endif  /* #ifndef CONST_H */