contiki-conf.h
00001 #ifndef __CONTIKI_CONF_H__CDBB4VIH3I__
00002 #define __CONTIKI_CONF_H__CDBB4VIH3I__
00003
00004 #include <stdint.h>
00005 #include <cc2420-interrupt.h>
00006 #include <AT91SAM7S64.h>
00007 #include <io.h>
00008
00009 #define CCIF
00010 #define CLIF
00011
00012 #define WITH_UIP 1
00013 #define WITH_ASCII 1
00014
00015 #define CLOCK_CONF_SECOND 100
00016 typedef uint8_t u8_t;
00017 typedef uint16_t u16_t;
00018 typedef uint32_t u32_t;
00019 typedef int8_t s8_t;
00020 typedef int16_t s16_t;
00021 typedef int32_t s32_t;
00022
00023 typedef unsigned int clock_time_t;
00024 typedef unsigned int uip_stats_t;
00025
00026 #ifndef BV
00027 #define BV(x) (1<<(x))
00028 #endif
00029
00030
00031 #define SPI_TXBUF *AT91C_SPI_TDR
00032
00033 #define SPI_RXBUF ((unsigned char)*AT91C_SPI_RDR)
00034
00035 #define SPI_WAITFOREOTx() while ((*AT91C_SPI_SR & AT91C_SPI_TXEMPTY) == 0)
00036
00037 #define SPI_WAITFOREORx() while ((*AT91C_SPI_SR & AT91C_SPI_RDRF) == 0)
00038
00039
00040
00041 #define CC2420_CONF_SYMBOL_LOOP_COUNT 800
00042
00043
00044 #define FIFO_IS_1 (*AT91C_PIOA_PDSR & AT91C_PIO_PA2)
00045 #define VREG_IS_1 1
00046 #define FIFOP_IS_1 (*AT91C_PIOA_PDSR & AT91C_PIO_PA30)
00047 #define SFD_IS_1 (*AT91C_PIOA_PDSR & AT91C_PIO_PA15)
00048 #define CCA_IS_1 1
00049
00050 #define SET_RESET_INACTIVE() setreg(CC2420_MAIN, 0xf800);
00051 #define SET_RESET_ACTIVE() setreg(CC2420_MAIN, 0x0000);
00052
00053 #define SET_VREG_ACTIVE()
00054 #define SET_VREG_INACTIVE()
00055
00056 #define FIFOP_INT_INIT() cc2420_interrupt_fifop_int_init()
00057 #define DISABLE_FIFOP_INT() (*AT91C_AIC_IDCR = (1 << AT91C_ID_IRQ1))
00058 #define ENABLE_FIFOP_INT() (*AT91C_AIC_IECR = (1 << AT91C_ID_IRQ1))
00059
00060 #define CC2420_DEFAULT_DEV 1
00061
00062 #define SPI_ENABLE() \
00063 do { \
00064 *AT91C_SPI_MR = ((*AT91C_SPI_MR & ~AT91C_SPI_PCS) \
00065 | ((~(1<<CC2420_DEFAULT_DEV) & 0x0f) << 16));\
00066 } while(0)
00067
00068
00069
00070 #define SPI_DISABLE() (*AT91C_SPI_CR = AT91C_SPI_LASTXFER)
00071
00072 #define CLEAR_FIFOP_INT() (*AT91C_AIC_ICCR = (1 << AT91C_ID_IRQ1))
00073
00074 #define LOOP_20_SYMBOLS (MCK/28125)
00075
00076
00077 #define UIP_CONF_LLH_LEN 0
00078 #define UIP_CONF_BROADCAST 1
00079 #define UIP_CONF_LOGGING 1
00080 #define UIP_CONF_BUFFER_SIZE 116
00081
00082 #define UIP_CONF_TCP_FORWARD 1
00083
00084
00085 #define USB_EP1_SIZE 64
00086 #define USB_EP2_SIZE 64
00087 #define USB_EP3_SIZE 64
00088
00089 #define USB_RBC_NUM_BLOCKS 16
00090
00091 #define REL_SECT_PREFIX ".rel"
00092
00093 #define CC_BYTE_ALIGNED __attribute__ ((packed, aligned(1)))
00094
00095
00096 #endif