Contiki 3.x
models.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, George Oikonomou - <oikonomou@users.sourceforge.net>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  */
31 
32 /**
33  * \file
34  * Header file use to configure differences between cc2530dk builds for
35  * the SmartRF/cc2530 and the cc2531 USB stick.
36  *
37  * These configuration directives are hardware-specific and you
38  * normally won't have to modify them.
39  *
40  * \author
41  * George Oikonomou - <oikonomou@users.sourceforge.net>
42  */
43 
44 #ifndef MODELS_H_
45 #define MODELS_H_
46 
47 /*---------------------------------------------------------------------------*/
48 /* LEDs */
49 /*---------------------------------------------------------------------------*/
50 /* Some files include leds.h before us */
51 #undef LEDS_GREEN
52 #undef LEDS_YELLOW
53 #undef LEDS_RED
54 #define LEDS_YELLOW 4
55 
56 /*
57  * Smart RF LEDs
58  * 1: P1_0 (Green)
59  * 2: P1_1 (Red)
60  * 3: P1_4 (Yellow)
61  * 4: P0_1 (LED4 shares port/pin with B1 and is currently unused)
62  *
63  * USB Dongle LEDs
64  * 1: P0_0 (Red)
65  * 2: P1_1 (Green - active: low)
66  */
67 #if MODELS_CONF_CC2531_USB_STICK
68 #define MODEL_STRING "TI cc2531 USB Dongle\n"
69 #define USB_CONF_ENABLE 1
70 
71 /* Enabled the ISR for Interrupt Num 6 */
72 #define PORT_2_ISR_ENABLED 1
73 
74 #ifndef USB_CONF_CLASS
75 #define DMA_CONF_ON 1
76 #define DMA_USB_CHANNEL 0
77 #define CTRL_EP_SIZE 8
78 #define USB_EP1_SIZE 32
79 #define USB_EP2_SIZE 64
80 #define USB_EP3_SIZE 64
81 #define USB_CONF_CLASS 1 /* CDC-ACM */
82 #endif
83 
84 #define CDC_ACM_CONF_VID 0x0451 /* Vendor: TI */
85 #define CDC_ACM_CONF_PID 0x16A8 /* cc2531 CDC */
86 
87 #undef LEDS_CONF_ALL
88 #define LEDS_CONF_ALL 3
89 #define LEDS_RED 1
90 #define LEDS_GREEN 2
91 
92 /* H/W Connections */
93 #define LED2_PIN P0_0
94 #define LED1_PIN P1_1
95 
96 /* P0DIR and P0SEL masks */
97 #define LED2_MASK 0x01
98 #define LED1_MASK 0x02
99 #else
100 #define MODEL_STRING "TI SmartRF05 EB\n"
101 #define LEDS_GREEN 1
102 #define LEDS_RED 2
103 
104 /* H/W Connections */
105 #define LED1_PIN P1_0
106 #define LED2_PIN P1_1
107 #define LED3_PIN P1_4
108 
109 /* P0DIR and P0SEL masks */
110 #define LED1_MASK 0x01
111 #define LED2_MASK 0x02
112 #define LED3_MASK 0x10
113 #define LED4_MASK 0x02
114 #endif
115 /*---------------------------------------------------------------------------*/
116 /* Buttons */
117 /*---------------------------------------------------------------------------*/
118 
119 #endif /* MODELS_H_ */