Contiki 3.x
platform-conf.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2010, Swedish Institute of Computer Science.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the Institute nor the names of its contributors
15  * may be used to endorse or promote products derived from this software
16  * without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 
31 /**
32  * \file
33  * Platform configuration for the Z1-feshie platform
34  * \author
35  * Joakim Eriksson <joakime@sics.se>
36  */
37 
38 #ifndef __PLATFORM_CONF_H__
39 #define __PLATFORM_CONF_H__
40 
41 #define SPI_LOCKING
42 //#define LOCKING_DEBUG
43 #ifdef LOCKING_DEBUG
44  #include <stdio.h>
45  #define LPRINT(...) printf(__VA_ARGS__)
46 #else
47  #define LPRINT(...)
48 #endif
49 /*
50  * Definitions below are dictated by the hardware and not really
51  * changeable!
52  */
53 
54 //#define PLATFORM_HAS_LEDS 1
55 //#define PLATFORM_HAS_BUTTON 1
56 
57 /* CPU target speed in Hz */
58 #define F_CPU 48000000uL /* 48MHz by default */
59 
60 
61 /* Types for clocks and uip_stats */
62 //typedef unsigned short uip_stats_t;
63 //typedef unsigned long clock_time_t;
64 //typedef unsigned long off_t;
65 
66 
67 
68 /* **************************************************************************** */
69 /* ------------------------------- SPI Related -------------------------------- */
70 /* **************************************************************************** */
71 
72 
73 
74 
75 /* **************************************************************************** */
76 /* ------------------------------- MS1 Related -------------------------------- */
77 /* **************************************************************************** */
78 
79 
80 
81 
82 /* **************************************************************************** */
83 /* --------------------------- M25P80 Flash Related --------------------------- */
84 /* **************************************************************************** */
85 
86 
87 
88 /* **************************************************************************** */
89 /* ------------------------------ CC1120 Related ------------------------------ */
90 /* **************************************************************************** */
91 
92 //#define CC1120DEBUG 1
93 //#define CC1120TXDEBUG 1
94 #define CC1120TXERDEBUG 1
95 //#define CC1120RXDEBUG 1
96 #define CC1120RXERDEBUG 1
97 //#define CC1120INTDEBUG 1
98 //#define C1120PROCESSDEBUG 1
99 //#define CC1120ARCHDEBUG 1
100 //#define CC1120STATEDEBUG 1
101 
102 #define RF_CHANNEL 42
103 
104 #define CC1120_CS_THRESHOLD 0xA6 /*-100dBm */
105 
106 /* Other possible sensible values:
107  * 0xC4 -60dBm.
108  * 0xBF -65dBm.
109  * 0xBA -70dBm.
110  * 0xB5 -75dBm.
111  * 0xB0 -80dBm.
112  * 0xAB -85dBm.
113  * 0xA6 -90dBm.
114  * 0xA5 -91dBm.
115  * 0xA4 -92dBm.
116  * 0xA3 -93dBm.
117  * 0xA2 -94dBm.
118  * 0xA1 -95dBm.
119  * 0xA0 -96dBm.
120  * 0x9F -97dBm.
121  * 0x9E -98dBm.
122  * 0x9D -99dBm.
123  * 0x9C -100dBm.
124  * 0x9B -101dBm.
125  * 0x9A -102dBm.
126  * 0x99 -103dBm
127  * 0x98 -104dBm.
128  * 0x97 -105dBm.
129  * 0x96 -106dBm.
130  * 0x95 -107dBm.
131  * 0x94 -108dBm.
132  * 0x93 -109dBm.
133  * 0x92 -110dBm.
134  */
135 //#define CC1120_RSSI_OFFSET 0x9A
136 
137 #define CC1120LEDS 1
138 
139 #define CC1120_LBT_TIMEOUT RTIMER_ARCH_SECOND //80
140 #define CC1120_ACK_WAIT RTIMER_ARCH_SECOND/667 /* ~1.5ms. */
141 
142 #define CC1120_INTER_PACKET_INTERVAL RTIMER_ARCH_SECOND/300 //275 //222
143 
144 #define CC1120_EN_TIMEOUT RTIMER_ARCH_SECOND/500
145 
146 #define CC1120_FHSS_ETSI_50 1
147 #define CC1120_FHSS_FCC_50 0
148 
149 #define CC1120_OFF_STATE CC1120_STATE_IDLE
150 
151 #define CC1120_GPIO_MODE 3
152 
153 #define CC1120_SINGLE_INTERRUPT
154 #define CC1120_DUAL_IO
155 
156 #define CC1120_GPIO0_FUNC CC1120_GPIO_MCU_WAKEUP
157 //#define CC1120_GPIO0_FUNC (CC1120_GPIO_PKT_SYNC_RXTX| CC1120_GPIO_INV_MASK)
158 #define CC1120_GPIO2_FUNC CC1120_GPIO_MARC_2PIN_STATUS0
159 //#define CC1120_GPIO2_FUNC CC1120_GPIO_PKT_SYNC_RXTX
160 //#define CC1120_GPIO3_FUNC CC1120_GPIO_RXFIFO_THR_PKT
161 //#define CC1120_GPIO3_FUNC CC1120_GPIO_MARC_2PIN_STATUS0
162 #define CC1120_GPIO3_FUNC CC1120_GPIO_RX0TX1_CFG
163 //#define CC1120_GPIO3_FUNC (CC1120_GPIO_PKT_SYNC_RXTX| CC1120_GPIO_INV_MASK)
164 
165 
166 
167 
168 /* --------------------------- CC1120 Pin Mappings. --------------------------- */
169 
170 
171 
172 
173 /* **************************************************************************** */
174 /* ------------------------------ CC2420 Related ------------------------------ */
175 /* **************************************************************************** */
176 
177 #endif /* __PLATFORM_CONF_H__ */
178