-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pinouts.h
189 lines (153 loc) · 6.48 KB
/
Pinouts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/*
* Pinouts.h
*
* Created on: Mar 31, 2013
* Author: Lucas
*/
#ifndef PINOUTS_H_
#define PINOUTS_H_
#include <msp430.h>
#include <GPIO.h>
//----------------------------------------------------------------------------
// Select which port will be used for interface to CCxxxx
//----------------------------------------------------------------------------
//#define RF_SER_INTF SER_INTF_BITBANG // Interface to CCxxxx
//#define RF_SER_INTF SER_INTF_USCIA0
#define RF_SER_INTF SER_INTF_USCIB0 // Interface to CCxxxx
#if defined (__MSP430G2553__)
#if !defined (__PxSEL2__)
#define __PxSEL2__ //Some MSP430s do not incorporate PxSEL2s
#endif
/* TODO:
* - P1.0: LED1 (red)
* - P1.1: UC0ARXD (input)
* - P1.2: UCA0TXD (output)
* - P1.3: S2 (pushbutton)
* - P1.4: Use this as pulse input? Use as gated power to ultrasonic sensor?
* - P1.5: UCB0CLK (SPI/CLK)
* - P1.6: UCB0SOMI (SPI/GDO1/MISO)
* - P1.7: UCB0SIMO (SPI/MOSI)
* - P2.0: TA1.0 (buzzer)
* - P2.1: Use this as pulse input? Use as gated power to ultrasonic sensor?
* - P2.2: (SPI/CSn)
* - P2.3: (GDO0)
* - P2.4: (GDO2)
* - P2.5: Use this as pulse input? Use as gated power to ultrasonic sensor?
* - P2.6: 32.768kHz Crystal
* - P2.7: 32.768kHz Crystal
*/
// SPI port definitions // Adjust the values for the chosen
#define SPI_USCIA0_PxSEL (GPIO_PORT1.select) // interfaces, according to the pin
#define SPI_USCIA0_PxSEL2 (GPIO_PORT1.select_2)
#define SPI_USCIA0_PxDIR (GPIO_PORT1.direction) // assignments indicated in the
#define SPI_USCIA0_PxIN (GPIO_PORT1.in) // chosen MSP430 device datasheet.
#define SPI_USCIA0_SIMO (BIT2)
#define SPI_USCIA0_SOMI (BIT1)
#define SPI_USCIA0_UCLK (BIT4)
// SPI port definitions // Adjust the values for the chosen
#define SPI_USCIB0_PxSEL (GPIO_PORT1.select) // interfaces, according to the pin
#define SPI_USCIB0_PxSEL2 (GPIO_PORT1.select_2)
#define SPI_USCIB0_PxDIR (GPIO_PORT1.direction) // assignments indicated in the
#define SPI_USCIB0_PxIN (GPIO_PORT1.in) // chosen MSP430 device datasheet.
#define SPI_USCIB0_SIMO (BIT7)
#define SPI_USCIB0_SOMI (BIT6)
#define SPI_USCIB0_UCLK (BIT5)
// LED 1 port definitions
#define LED1_PxIN (GPIO_PORT1.in)
#define LED1_PxSEL (GPIO_PORT1.select)
#define LED1_PxSEL2 (GPIO_PORT1.select_2)
#define LED1_PxOUT (GPIO_PORT1.out)
#define LED1_PxDIR (GPIO_PORT1.direction)
#define LED1_PIN (BIT0)
#define LED1_PIN_NUM (0)
// LED 2 port definitions
#define LED2_PxIN (GPIO_PORT1.in)
#define LED2_PxSEL (GPIO_PORT1.select)
#define LED2_PxSEL2 (GPIO_PORT1.select_2)
#define LED2_PxOUT (GPIO_PORT1.out)
#define LED2_PxDIR (GPIO_PORT1.direction)
#define LED2_PIN (BIT6)
#define LED2_PIN_NUM (6)
// Switch 1 port definitions
//#define SW1 (RESET) //We don't want to use the reset button as a trigger...wouldn't be very useful
// Switch 2 port definitions
#define SW2_PxIN (GPIO_PORT1.in)
#define SW2_PxIE (GPIO_PORT1.interrupt_enable)
#define SW2_PxIES (GPIO_PORT1.interrupt_edge_select)
#define SW2_PxIFG (GPIO_PORT1.interrupt_flag)
#define SW2_PxREN (GPIO_PORT1.resistor_enable)
#define SW2_PxOUT (GPIO_PORT1.out)
#define SW2_PxDIR (GPIO_PORT1.direction)
#define SW2_PIN (BIT3)
#define SW2_PIN_NUM (3)
// GDO0 Definitions
#define GDO0_PxOUT (GPIO_PORT2.out) // Original setting was Port 1
#define GDO0_PxIN (GPIO_PORT2.in) // Original setting was Port 1
#define GDO0_PxDIR (GPIO_PORT2.direction) // Original setting was Port 1
#define GDO0_PxIE (GPIO_PORT2.interrupt_enable) // Original setting was Port 1
#define GDO0_PxIES (GPIO_PORT2.interrupt_edge_select) // Original setting was Port 1
#define GDO0_PxIFG (GPIO_PORT2.interrupt_flag) // Original setting was Port 1
#define GDO0_PxREN (GPIO_PORT2.resistor_enable) // Original setting was Port 1
#define GDO0_PIN (BIT3) // Original setting was BIT4
#define GDO0_PIN_NUM (3)
// GDO1 Definitions
#define GDO1_PxOUT (GPIO_PORT1.out) // GDO1 = MISO
#define GDO1_PxIN (GPIO_PORT1.in) // GDO1 = MISO
#define GDO1_PxDIR (GPIO_PORT1.direction) // GDO1 = MISO
#define GDO1_PxSEL (GPIO_PORT1.select) // GDO1 = MISO
#define GDO1_PxSEL2 (GPIO_PORT1.select_2) // GDO1 = MISO
#define GDO1_PIN (BIT6) // GDO1 = MISO
#define GDO1_PIN_NUM (6)
// GDO2 Definitions
#define GDO2_PxOUT (GPIO_PORT1.out) // Original setting was Port 2
#define GDO2_PxIN (GPIO_PORT1.in) // Original setting was Port 2
#define GDO2_PxDIR (GPIO_PORT1.direction) // Original setting was Port 2
#define GDO2_PxSEL (GPIO_PORT1.select) // Original setting was Port 2
#define GDO2_PxSEL2 (GPIO_PORT1.select_2) // Original setting was Port 2
#define GDO2_PIN (BIT4)
#define GDO2_PIN_NUM (4)
// CSn Definitions
#define CSn_PxOUT (GPIO_PORT2.out)
#define CSn_PxDIR (GPIO_PORT2.direction)
#define CSn_PIN (BIT2) // Original setting was BIT1
#define CSn_PIN_NUM (2)
// Buzzer Definitions
#define BUZZ_PxOUT (GPIO_PORT2.out)
#define BUZZ_PxIN (GPIO_PORT2.in)
#define BUZZ_PxDIR (GPIO_PORT2.direction)
#define BUZZ_PxSEL (GPIO_PORT2.select)
#define BUZZ_PxSEL2 (GPIO_PORT2.select_2)
#define BUZZ_PxIE (GPIO_PORT2.interrupt_enable)
#define BUZZ_PxIES (GPIO_PORT2.interrupt_edge_select)
#define BUZZ_PxIFG (GPIO_PORT2.interrupt_flag)
#define BUZZ_PxREN (GPIO_PORT2.resistor_enable)
#define BUZZ_PIN (BIT0)
#define BUZZ_PIN_NUM (0)
// UCA0 Definitions
#define UCA0_PxOUT (GPIO_PORT1.out) // Original setting was Port 2
#define UCA0_PxIN (GPIO_PORT1.in) // Original setting was Port 2
#define UCA0_PxDIR (GPIO_PORT1.direction) // Original setting was Port 2
#define UCA0_PxSEL (GPIO_PORT1.select) // Original setting was Port 2
#define UCA0_PxSEL2 (GPIO_PORT1.select_2) // Original setting was Port 2
#define UCA0RXD_PIN (BIT1)
#define UCA0TXD_PIN (BIT2)
#define UCA0RXD_PIN_NUM (1)
#define UCA0TXD_PIN_NUM (2)
#endif /* __MSP430G2553__ */
//******************************************************************************
// These constants are used to identify the chosen SPI and UART interfaces.
//******************************************************************************
#define SER_INTF_NULL 0
#define SER_INTF_USART0 1
#define SER_INTF_USART1 2
#define SER_INTF_USCIA0 3
#define SER_INTF_USCIA1 4
#define SER_INTF_USCIA2 5
#define SER_INTF_USCIA3 6
#define SER_INTF_USCIB0 7
#define SER_INTF_USCIB1 8
#define SER_INTF_USCIB2 9
#define SER_INTF_USCIB3 10
#define SER_INTF_USI 11
#define SER_INTF_BITBANG 12
#endif /* PINOUTS_H_ */