Statistics
| Branch: | Tag: | Revision:

amiro-os / os / modules / DiWheelDrive_1-1 / board.h @ e545e620

History | View | Annotate | Download (40.78 KB)

1 e545e620 Thomas Schöpping
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef _BOARD_H_
20
#define _BOARD_H_
21
22
/*
23
 * Setup for AMiRo DiWheelDrive board.
24
 */
25
26
/*
27
 * Board identifier.
28
 */
29
#define BOARD_DIWHEELDRIVE
30
#define BOARD_NAME              "AMiRo DiWheelDrive"
31
#define BOARD_VERSION           "1.1"
32
33
/*
34
 * Board oscillators-related settings.
35
 * NOTE: LSE not fitted.
36
 */
37
#if !defined(STM32_LSECLK)
38
#define STM32_LSECLK                0U
39
#endif
40
41
#if !defined(STM32_HSECLK)
42
#define STM32_HSECLK                8000000U
43
#endif
44
45
/*
46
 * Board voltages.
47
 * Required for performance limits calculation.
48
 */
49
#define STM32_VDD                   330U
50
51
/*
52
 * MCU type as defined in the ST header.
53
 */
54
#define STM32F103xE
55
56
/*
57
 * IO pins assignments.
58
 */
59
#define GPIOA_WKUP                  0U
60
#define GPIOA_LED                   1U
61
#define GPIOA_DRIVE_PWM1A           2U
62
#define GPIOA_DRIVE_PWM1B           3U
63
#define GPIOA_PIN4                  4U
64
#define GPIOA_MOTION_SCLK           5U
65
#define GPIOA_MOTION_MISO           6U
66
#define GPIOA_MOTION_MOSI           7U
67
#define GPIOA_PIN8                  8U
68
#define GPIOA_PROG_RX               9U
69
#define GPIOA_PROG_TX               10U
70
#define GPIOA_CAN_RX                11U
71
#define GPIOA_CAN_TX                12U
72
#define GPIOA_SWDIO                 13U
73
#define GPIOA_SWCLK                 14U
74
#define GPIOA_DRIVE_PWM2B           15U
75
76
#define GPIOB_PIN0                  0U
77
#define GPIOB_DRIVE_SENSE2          1U
78
#define GPIOB_POWER_EN              2U
79
#define GPIOB_DRIVE_PWM2A           3U
80
#define GPIOB_PIN4                  4U
81
#define GPIOB_COMPASS_DRDY          5U
82
#define GPIOB_DRIVE_ENC1A           6U
83
#define GPIOB_DRIVE_ENC1B           7U
84
#define GPIOB_COMPASS_SCL           8U
85
#define GPIOB_COMPASS_SDA           9U
86
#define GPIOB_IR_SCL                10U
87
#define GPIOB_IR_SDA                11U
88
#define GPIOB_IR_INT                12U
89
#define GPIOB_GYRO_DRDY             13U
90
#define GPIOB_SYS_UART_UP           14U
91
#define GPIOB_ACCEL_INT_N           15U
92
93
#define GPIOC_DRIVE_SENSE1          0U
94
#define GPIOC_SYS_INT_N             1U
95
#define GPIOC_PIN2                  2U
96
#define GPIOC_PATH_DCSTAT           3U
97
#define GPIOC_PIN4                  4U
98
#define GPIOC_PATH_DCEN             5U
99
#define GPIOC_DRIVE_ENC2B           6U
100
#define GPIOC_DRIVE_ENC2A           7U
101
#define GPIOC_SYS_PD_N              8U
102
#define GPIOC_SYS_REG_EN            9U
103
#define GPIOC_SYS_UART_RX           10U
104
#define GPIOC_SYS_UART_TX           11U
105
#define GPIOC_PIN12                 12U
106
#define GPIOC_ACCEL_SS_N            13U
107
#define GPIOC_GYRO_SS_N             14U
108
#define GPIOC_PIN15                 15U
109
110
#define GPIOD_OSC_IN                0U
111
#define GPIOD_OSC_OUT               1U
112
#define GPIOD_SYS_WARMRST_N         2U
113
#define GPIOD_PIN3                  3U
114
#define GPIOD_PIN4                  4U
115
#define GPIOD_PIN5                  5U
116
#define GPIOD_PIN6                  6U
117
#define GPIOD_PIN7                  7U
118
#define GPIOD_PIN8                  8U
119
#define GPIOD_PIN9                  9U
120
#define GPIOD_PIN10                 10U
121
#define GPIOD_PIN11                 11U
122
#define GPIOD_PIN12                 12U
123
#define GPIOD_PIN13                 13U
124
#define GPIOD_PIN14                 14U
125
#define GPIOD_PIN15                 15U
126
127
#define GPIOE_PIN0                  0U
128
#define GPIOE_PIN1                  1U
129
#define GPIOE_PIN2                  2U
130
#define GPIOE_PIN3                  3U
131
#define GPIOE_PIN4                  4U
132
#define GPIOE_PIN5                  5U
133
#define GPIOE_PIN6                  6U
134
#define GPIOE_PIN7                  7U
135
#define GPIOE_PIN8                  8U
136
#define GPIOE_PIN9                  9U
137
#define GPIOE_PIN10                 10U
138
#define GPIOE_PIN11                 11U
139
#define GPIOE_PIN12                 12U
140
#define GPIOE_PIN13                 13U
141
#define GPIOE_PIN14                 14U
142
#define GPIOE_PIN15                 15U
143
144
#define GPIOF_PIN0                  0U
145
#define GPIOF_PIN1                  1U
146
#define GPIOF_PIN2                  2U
147
#define GPIOF_PIN3                  3U
148
#define GPIOF_PIN4                  4U
149
#define GPIOF_PIN5                  5U
150
#define GPIOF_PIN6                  6U
151
#define GPIOF_PIN7                  7U
152
#define GPIOF_PIN8                  8U
153
#define GPIOF_PIN9                  9U
154
#define GPIOF_PIN10                 10U
155
#define GPIOF_PIN11                 11U
156
#define GPIOF_PIN12                 12U
157
#define GPIOF_PIN13                 13U
158
#define GPIOF_PIN14                 14U
159
#define GPIOF_PIN15                 15U
160
161
#define GPIOG_PIN0                  0U
162
#define GPIOG_PIN1                  1U
163
#define GPIOG_PIN2                  2U
164
#define GPIOG_PIN3                  3U
165
#define GPIOG_PIN4                  4U
166
#define GPIOG_PIN5                  5U
167
#define GPIOG_PIN6                  6U
168
#define GPIOG_PIN7                  7U
169
#define GPIOG_PIN8                  8U
170
#define GPIOG_PIN9                  9U
171
#define GPIOG_PIN10                 10U
172
#define GPIOG_PIN11                 11U
173
#define GPIOG_PIN12                 12U
174
#define GPIOG_PIN13                 13U
175
#define GPIOG_PIN14                 14U
176
#define GPIOG_PIN15                 15U
177
178
/*
179
 * IO lines assignments.
180
 */
181
#define LINE_WKUP                   PAL_LINE(GPIOA, GPIOA_WKUP)
182
#define LINE_LED                    PAL_LINE(GPIOA, GPIOA_LED)
183
#define LINE_DRIVE_PWM1A            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1A)
184
#define LINE_DRIVE_PWM1B            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1B)
185
#define LINE_MOTION_SCLK            PAL_LINE(GPIOA, GPIOA_MOTION_SCLK)
186
#define LINE_MOTION_MISO            PAL_LINE(GPIOA, GPIOA_MOTION_MISO)
187
#define LINE_MOTION_MOSI            PAL_LINE(GPIOA, GPIOA_MOTION_MOSI)
188
#define LINE_PROG_RX                PAL_LINE(GPIOA, GPIOA_PROG_RX)
189
#define LINE_PROG_TX                PAL_LINE(GPIOA, GPIOA_PROG_TX)
190
#define LINE_CAN_RX                 PAL_LINE(GPIOA, GPIOA_CAN_RX)
191
#define LINE_CAN_TX                 PAL_LINE(GPIOA, GPIOA_CAN_TX)
192
#define LINE_SWDIO                  PAL_LINE(GPIOA, GPIOA_SWDIO)
193
#define LINE_SWCLK                  PAL_LINE(GPIOA, GPIOA_SWCLK)
194
#define LINE_DRIVE_PWM2B            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM2B)
195
196
#define LINE_DRIVE_SENSE2           PAL_LINE(GPIOB, GPIOB_DRIVE_SENSE2)
197
#define LINE_POWER_EN               PAL_LINE(GPIOB, GPIOB_POWER_EN)
198
#define LINE_DRIVE_PWM2A            PAL_LINE(GPIOB, GPIOB_DRIVE_PWM2A)
199
#define LINE_COMPASS_DRDY           PAL_LINE(GPIOB, GPIOB_COMPASS_DRDY)
200
#define LINE_DRIVE_ENC1A            PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1A)
201
#define LINE_DRIVE_ENC1B            PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1B)
202
#define LINE_COMPASS_SCL            PAL_LINE(GPIOB, GPIOB_COMPASS_SCL)
203
#define LINE_COMPASS_SDA            PAL_LINE(GPIOB, GPIOB_COMPASS_SDA)
204
#define LINE_IR_SCL                 PAL_LINE(GPIOB, GPIOB_IR_SCL)
205
#define LINE_IR_SDA                 PAL_LINE(GPIOB, GPIOB_IR_SDA)
206
#define LINE_IR_INT                 PAL_LINE(GPIOB, GPIOB_IR_INT)
207
#define LINE_GYRO_DRDY              PAL_LINE(GPIOB, GPIOB_GYRO_DRDY)
208
#define LINE_SYS_UART_UP            PAL_LINE(GPIOB, GPIOB_SYS_UART_UP)
209
#define LINE_ACCEL_INT_N            PAL_LINE(GPIOB, GPIOB_ACCEL_INT_N)
210
211
#define LINE_DRIVE_SENSE1           PAL_LINE(GPIOC, GPIOC_DRIVE_SENSE1)
212
#define LINE_SYS_INT_N              PAL_LINE(GPIOC, GPIOC_SYS_INT_N)
213
#define LINE_PATH_DCSTAT            PAL_LINE(GPIOC, GPIOC_PATH_DCSTAT)
214
#define LINE_PATH_DCEN              PAL_LINE(GPIOC, GPIOC_PATH_DCEN)
215
#define LINE_DRIVE_ENC2B            PAL_LINE(GPIOC, GPIOC_DRIVE_ENC2B)
216
#define LINE_DRIVE_ENC2A            PAL_LINE(GPIOC, GPIOC_DRIVE_ENC2A)
217
#define LINE_SYS_PD_N               PAL_LINE(GPIOC, GPIOC_SYS_PD_N)
218
#define LINE_SYS_REG_EN             PAL_LINE(GPIOC, GPIOC_SYS_REG_EN)
219
#define LINE_SYS_UART_RX            PAL_LINE(GPIOC, GPIOC_SYS_UART_RX)
220
#define LINE_SYS_UART_TX            PAL_LINE(GPIOC, GPIOC_SYS_UART_TX)
221
#define LINE_ACCEL_SS_N             PAL_LINE(GPIOC, GPIOC_ACCEL_SS_N)
222
#define LINE_GYRO_SS_N              PAL_LINE(GPIOC, GPIOC_GYRO_SS_N)
223
224
#define LINE_OSC_IN                 PAL_LINE(GPIOD, GPIOD_OSC_IN)
225
#define LINE_OSC_OUT                PAL_LINE(GPIOD, GPIOD_OSC_OUT)
226
#define LINE_SYS_WARMRST_N          PAL_LINE(GPIOD, GPIOD_SYS_WARMRST_N)
227
228
/*
229
 * I/O ports initial setup, this configuration is established soon after reset
230
 * in the initialization code.
231
 * Please refer to the STM32 Reference Ma