platform-conf.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 #ifndef __PLATFORM_CONF_H__
00040 #define __PLATFORM_CONF_H__
00041 
00042 
00043 
00044 
00045 
00046 #define ZOLERTIA_Z1 1  
00047 
00048 
00049 
00050 #define F_CPU 8000000uL // 8MHz by default 
00051 
00052 
00053 
00054 #define CLOCK_CONF_SECOND 128UL
00055 
00056 #define BAUD2UBR(baud) ((F_CPU/baud))
00057 
00058 #define CCIF
00059 #define CLIF
00060 
00061 #define CC_CONF_INLINE inline
00062 
00063 #define HAVE_STDINT_H
00064 #define MSP430_MEMCPY_WORKAROUND 1
00065 #include "msp430def.h"
00066 
00067 
00068 
00069 typedef unsigned short uip_stats_t;
00070 typedef unsigned long clock_time_t;
00071 typedef unsigned long off_t;
00072 
00073 
00074 #define NETSTACK_CONF_RADIO   cc2420_driver
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 #define LEDS_PxDIR P5DIR
00083 #define LEDS_PxOUT P5OUT
00084 #define LEDS_CONF_RED    0x10
00085 #define LEDS_CONF_GREEN  0x40
00086 #define LEDS_CONF_YELLOW 0x20
00087 
00088 
00089 #define DCOSYNCH_CONF_ENABLED 0
00090 #define DCOSYNCH_CONF_PERIOD 30
00091 
00092 #define ROM_ERASE_UNIT_SIZE  512
00093 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
00094 
00095 
00096 #define CFS_CONF_OFFSET_TYPE    long
00097 
00098 
00099 #define NODE_ID_XMEM_OFFSET     (0 * XMEM_ERASE_UNIT_SIZE)
00100 
00101 
00102 #define EEPROMFS_ADDR_CODEPROP  (1 * XMEM_ERASE_UNIT_SIZE)
00103 
00104 #define CFS_XMEM_CONF_OFFSET    (2 * XMEM_ERASE_UNIT_SIZE)
00105 #define CFS_XMEM_CONF_SIZE      (1 * XMEM_ERASE_UNIT_SIZE)
00106 
00107 #define CFS_RAM_CONF_SIZE 4096
00108 
00109 
00110 
00111 
00112 
00113 
00114 #define SPI_TXBUF UCB0TXBUF
00115 #define SPI_RXBUF UCB0RXBUF
00116 
00117                                 
00118 #define SPI_WAITFOREOTx() while ((UCB0STAT & UCBUSY) != 0)
00119                                 
00120 #define SPI_WAITFOREORx() while ((IFG2 & UCB0RXIFG) == 0)
00121                                 
00122 #define SPI_WAITFORTxREADY() while ((IFG2 & UCB0TXIFG) == 0)
00123 
00124 #define MOSI           1  
00125 #define MISO           2  
00126 #define SCK            3  
00127 
00128 
00129 
00130 
00131 
00132 #define FLASH_CS        4       
00133 #define FLASH_HOLD      7       
00134 
00135 
00136 
00137 #define SPI_FLASH_ENABLE()  ( P4OUT &= ~BV(FLASH_CS) )
00138 #define SPI_FLASH_DISABLE() ( P4OUT |=  BV(FLASH_CS) )
00139 
00140 #define SPI_FLASH_HOLD()                ( P5OUT &= ~BV(FLASH_HOLD) )
00141 #define SPI_FLASH_UNHOLD()              ( P5OUT |=  BV(FLASH_HOLD) )
00142 
00143 
00144 
00145 
00146 
00147 
00148 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302      
00149 
00150 
00151 #define CC2420_FIFOP_PORT(type)   P1##type
00152 #define CC2420_FIFOP_PIN          2
00153 
00154 #define CC2420_FIFO_PORT(type)     P1##type
00155 #define CC2420_FIFO_PIN            3
00156 
00157 #define CC2420_CCA_PORT(type)      P1##type
00158 #define CC2420_CCA_PIN             4
00159 
00160 #define CC2420_SFD_PORT(type)      P4##type
00161 #define CC2420_SFD_PIN             1
00162  
00163 #define CC2420_CSN_PORT(type)      P3##type
00164 #define CC2420_CSN_PIN             0
00165 
00166 #define CC2420_VREG_PORT(type)     P4##type
00167 #define CC2420_VREG_PIN            5
00168 
00169 #define CC2420_RESET_PORT(type)    P4##type
00170 #define CC2420_RESET_PIN           6
00171 
00172 
00173 #define CC2420_IRQ_VECTOR PORT1_VECTOR
00174 
00175 
00176 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
00177 #define CC2420_FIFO_IS_1  (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
00178 #define CC2420_CCA_IS_1   (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
00179 #define CC2420_SFD_IS_1   (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
00180 
00181 
00182 #define SET_RESET_INACTIVE()   (CC2420_RESET_PORT(OUT) |=  BV(CC2420_RESET_PIN))
00183 #define SET_RESET_ACTIVE()     (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
00184 
00185 
00186 #define SET_VREG_ACTIVE()       (CC2420_VREG_PORT(OUT) |=  BV(CC2420_VREG_PIN))
00187 #define SET_VREG_INACTIVE()     (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
00188 
00189 
00190 #define CC2420_FIFOP_INT_INIT() do {                  \
00191     CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN);  \
00192     CC2420_CLEAR_FIFOP_INT();                         \
00193   } while(0)
00194 
00195 
00196 #define CC2420_ENABLE_FIFOP_INT()  do {CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN);} while(0)
00197 #define CC2420_DISABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN);} while(0)
00198 #define CC2420_CLEAR_FIFOP_INT()   do {CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN);} while(0)
00199 
00200 
00201 
00202 
00203 
00204 
00205  
00206 #define CC2420_SPI_ENABLE()     (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
00207  
00208 #define CC2420_SPI_DISABLE()    (CC2420_CSN_PORT(OUT) |=  BV(CC2420_CSN_PIN))
00209 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))
00210 
00211 #endif