-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
218 lines (176 loc) · 5.63 KB
/
config.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/************************************************************************/
/* */
/* config.h -- Project Configuration Declarations */
/* */
/************************************************************************/
/* Author: Michael T. Alexander */
/* Copyright 2009, Digilent Inc. */
/************************************************************************/
/* Module Description: */
/* */
/* This header contains declarations used to configure the project */
/* based on the target platform. */
/* */
/************************************************************************/
/* Revision History: */
/* */
/* 05/21/2009 (MichaelA): created */
/* */
/************************************************************************/
#if !defined(_CONFIG_INC)
#define _CONFIG_INC
/* ------------------------------------------------------------ */
/* Pin Definitions */
/* ------------------------------------------------------------ */
/* Onboard LEDs
*/
#define trisLed1 TRISB
#define trisLed1Set TRISBSET
#define trisLed1Clr TRISBCLR
#define prtLed1 PORTB
#define prtLed1Set PORTBSET
#define prtLed1Clr PORTBCLR
#define prtLed1Inv PORTBINV
#define bnLed1 10
#define trisLed2 TRISB
#define trisLed2Set TRISBSET
#define trisLed2Clr TRISBCLR
#define prtLed2 PORTB
#define prtLed2Set PORTBSET
#define prtLed2Clr PORTBCLR
#define prtLed2Inv PORTBINV
#define bnLed2 11
#define trisLed3 TRISB
#define trisLed3Set TRISBSET
#define trisLed3Clr TRISBCLR
#define prtLed3 PORTB
#define prtLed3Set PORTBSET
#define prtLed3Clr PORTBCLR
#define prtLed3Inv PORTBINV
#define bnLed3 12
#define trisLed4 TRISB
#define trisLed4Set TRISBSET
#define trisLed4Clr TRISBCLR
#define prtLed4 PORTB
#define prtLed4Set PORTBSET
#define prtLed4Clr PORTBCLR
#define prtLed4Inv PORTBINV
#define bnLed4 13
/* Onboard Buttons
*/
#define trisBtn1 TRISA
#define trisBtn1Set TRISASET
#define trisBtn1Clr TRISACLR
#define prtBtn1 PORTA
#define prtBtn1Set PORTASET
#define prtBtn1Clr PORTACLR
#define bnBtn1 6
#define trisBtn2 TRISA
#define trisBtn2Set TRISASET
#define trisBtn2Clr TRISACLR
#define prtBtn2 PORTA
#define prtBtn2Set PORTASET
#define prtBtn2Clr PORTACLR
#define bnBtn2 7
/*JE 1-4 pins (PmodBTN)
*/
#define trisJE1 TRISD
#define trisJE1Set TRISDSET
#define trisJE1Clr TRISDCLR
#define prtJE1 PORTD
#define prtJE1Set PORTDSET
#define prtJE1Clr PORTDCLR
#define bnJE1 14
#define trisJE2 TRISD
#define trisJE2Set TRISDSET
#define trisJE2Clr TRISDCLR
#define prtJE2 PORTD
#define prtJE2Set PORTDSET
#define prtJE2Clr PORTDCLR
#define bnJE2 15
#define trisJE3 TRISF
#define trisJE3Set TRISFSET
#define trisJE3Clr TRISFCLR
#define prtJE3 PORTF
#define prtJE3Set PORTFSET
#define prtJE3Clr PORTFCLR
#define bnJE3 2
#define trisJE4 TRISF
#define trisJE4Set TRISFSET
#define trisJE4Clr TRISFCLR
#define prtJE4 PORTF
#define prtJE4Set PORTFSET
#define prtJE4Clr PORTFCLR
#define bnJE4 8
/*JA 1-4 pins (PmodSWT)
*/
#define trisJA1 TRISE
#define trisJA1Set TRISESET
#define trisJA1Clr TRISECLR
#define prtJA1 PORTE
#define prtJA1Set PORTESET
#define prtJA1Clr PORTECLR
#define swtJA1 0
#define trisJA2 TRISE
#define trisJA2Set TRISESET
#define trisJA2Clr TRISECLR
#define prtJA2 PORTE
#define prtJA2Set PORTESET
#define prtJA2Clr PORTECLR
#define swtJA2 1
#define trisJA3 TRISE
#define trisJA3Set TRISESET
#define trisJA3Clr TRISECLR
#define prtJA3 PORTE
#define prtJA3Set PORTESET
#define prtJA3Clr PORTECLR
#define swtJA3 2
#define trisJA4 TRISE
#define trisJA4Set TRISESET
#define trisJA4Clr TRISECLR
#define prtJA4 PORTE
#define prtJA4Set PORTESET
#define prtJA4Clr PORTECLR
#define swtJA4 3
/* Left motor
*/
#define trisMtrLeftEnSet TRISDSET
#define trisMtrLeftEnClr TRISDCLR
#define prtMtrLeftEnSet PORTDSET
#define prtMtrLeftEnClr PORTDCLR
#define bnMtrLeftEn 1
#define trisMtrLeftDirSet TRISDSET
#define trisMtrLeftDirClr TRISDCLR
#define prtMtrLeftDirSet PORTDSET
#define prtMtrLeftDirClr PORTDCLR
#define bnMtrLeftDir 7
/* Right motor
*/
#define trisMtrRightEnSet TRISDSET
#define trisMtrRightEnClr TRISDCLR
#define prtMtrRightEnSet PORTDSET
#define prtMtrRightEnClr PORTDCLR
#define bnMtrRightEn 2
#define trisMtrRightDirSet TRISDSET
#define trisMtrRightDirClr TRISDCLR
#define prtMtrRightDirSet PORTDSET
#define prtMtrRightDirClr PORTDCLR
#define bnMtrRightDir 6
/* ------------------------------------------------------------ */
/* Miscellaneous Declarations */
/* ------------------------------------------------------------ */
#define OPT_HWSPI 2 //use SPI2 controller for SPI interface
/* ------------------------------------------------------------ */
/* General Type Declarations */
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */
/* Object Class Declarations */
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */
/* Variable Declarations */
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */
/* Procedure Declarations */
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */
#endif