# const.h

Go to the documentation of this file.

    00001 /* Copyright (c) 2007, 2008, 2009, 2010
    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
    00049 /*=== radio constants ================================================*/
    00050 #define  RADIO_AT86RF230 (1)
    00051 #define  RADIO_AT86RF230A (RADIO_AT86RF230)
    00052 #define  RADIO_AT86RF230B (2)
    00053 #define  RADIO_AT86RF231 (3)
    00054 #define  RADIO_AT86RF212 (4)
    00055 #define  RADIO_ATMEGA128RFA1_A (5)
    00056 #define  RADIO_ATMEGA128RFA1_B (6)
    00057 #define  RADIO_ATMEGA128RFA1_C (7)
    00058 #define  RADIO_ATMEGA128RFA1_D (8)
    00059 #define  RADIO_AT86RF232 (9)
    00060 #define  RADIO_AT86RF233 (10)
    00062 #define RADIO_BAND_700 (1)
    00063 #define RADIO_BAND_800 (2)
    00064 #define RADIO_BAND_900 (3)
    00065 #define RADIO_BAND_2400 (4)
    00067 /*=== modulation schemes =============================================*/
    00068 #define MOD_BPSK_20    (0)
    00069 #define MOD_BPSK_40    (1)
    00070 #define MOD_OQPSK_100  (2)
    00071 #define MOD_OQPSK_200  (3)
    00072 #define MOD_OQPSK_250  (4)
    00073 #define MOD_OQPSK_400  (5)
    00074 #define MOD_OQPSK_500  (6)
    00075 #define MOD_OQPSK_1000 (7)
    00076 #define MOD_OQPSK_2000 (8)
    00086 /*=== HIF type constants =============================================*/
    00087 #define  HIF_NONE     (0)
    00088 #define  HIF_UART_0   (10)
    00089 #define  HIF_UART_1   (11)
    00090 #define  HIF_FT245    (20)
    00091 #define  HIF_AT90USB  (21)
    00093 /*=== USB constants ==================================================*/
    00094
    00102 #define URACOLI_USB_VID (5824)
    00103
    00107 #define URACOLI_USB_PID (2183)
    00108
    00109 #define URACOLI_USB_BCD_RELEASE (0x100)
    00110 #define URACOLI_USB_VENDOR_NAME  L"URACOLI"
    00111 #define URACOLI_USB_PRODUCT_NAME L"RZUSBSTICK"
    00112
    00120 /*=== spi constants ==================================================*/
    00121 #define SPI_RATE_1_2      (4)
    00122 #define SPI_RATE_1_4      (0)
    00123 #define SPI_RATE_1_8      (5)
    00124 #define SPI_RATE_1_16     (1)
    00125 #define SPI_RATE_1_32     (6)
    00126 #define SPI_RATE_1_64     (2)
    00127 #define SPI_RATE_1_128    (3)
    00132 #if defined (DOXYGEN)
    00133
    00134 #define SHORTENUM
    00135 #else
    00136 #define SHORTENUM  __attribute__((packed))
    00137 #endif
    00138
    00143 #define FCTL_DATA _BV(0)
    00144 #define FCTL_ACK  _BV(5)
    00145 #define FCTL_IPAN _BV(6)
    00146 #define FCTL_DST_SHORT 0x0800
    00147 #define FCTL_DST_LONG  0x0c00
    00148 #define FCTL_SRC_SHORT 0x8000
    00149 #define FCTL_SRC_LONG  0xc000
    00151 #define FCTL_SRC_MASK (FCTL_SRC_LONG)
    00152 #define FCTL_DST_MASK (FCTL_DST_LONG)
    00153 #define FCTL_IPAN_MASK (FCTL_IPAN)
    00154
    00156 /* === Types ================================================================= */
    00157
    00158
    00165 typedef int8_t  channel_t;
    00166
    00168 typedef int8_t  txpwr_t;
    00169
    00173 typedef bool    rxidle_t;
    00174
    00176 typedef uint8_t ccamode_t;
    00177
    00178 /* ... cca_ed_tresh, clkm, pdt, ... */
    00179
    00183 typedef struct
    00184 {
    00186     channel_t chan;
    00188     unsigned int txp   : 4;
    00190     unsigned int cca   : 2;
    00192     unsigned int edt   : 4;
    00193
    00195     unsigned int clkm  : 3;
    00196
    00197 } trx_param_t;
    00198
    00200 #endif  /* #ifndef CONST_H */