amiro-os / modules / STM32F407G-DISC1 / board.h @ 732a4657
History | View | Annotate | Download (85.514 KB)
1 | 07ff44a7 | Thomas Schöpping | /*
|
---|---|---|---|
2 | 0f60c8ad | Thomas Schöpping | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
3 | Copyright (C) 2016..2019 Thomas Schöpping et al.
|
||
4 | 07ff44a7 | Thomas Schöpping | |
5 | 0f60c8ad | Thomas Schöpping | 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 | 07ff44a7 | Thomas Schöpping | |
10 | 0f60c8ad | Thomas Schöpping | 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 | 07ff44a7 | Thomas Schöpping | |
15 | 0f60c8ad | Thomas Schöpping | 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 | 07ff44a7 | Thomas Schöpping | */
|
18 | |||
19 | #ifndef BOARD_H
|
||
20 | #define BOARD_H
|
||
21 | |||
22 | /*===========================================================================*/
|
||
23 | /* Driver constants. */
|
||
24 | /*===========================================================================*/
|
||
25 | |||
26 | /*
|
||
27 | * Setup for STMicroelectronics STM32F4-Discovery board.
|
||
28 | */
|
||
29 | |||
30 | /*
|
||
31 | * Board identifier.
|
||
32 | */
|
||
33 | #define BOARD_ST_STM32F4_DISCOVERY
|
||
34 | #define BOARD_NAME "STMicroelectronics STM32F4-Discovery" |
||
35 | |||
36 | /*
|
||
37 | * Board oscillators-related settings.
|
||
38 | * NOTE: LSE not fitted.
|
||
39 | */
|
||
40 | #if !defined(STM32_LSECLK)
|
||
41 | #define STM32_LSECLK 0U |
||
42 | #endif
|
||
43 | |||
44 | #if !defined(STM32_HSECLK)
|
||
45 | #define STM32_HSECLK 8000000U |
||
46 | #endif
|
||
47 | |||
48 | /*
|
||
49 | * Board voltages.
|
||
50 | * Required for performance limits calculation.
|
||
51 | */
|
||
52 | #define STM32_VDD 300U |
||
53 | |||
54 | /*
|
||
55 | * MCU type as defined in the ST header.
|
||
56 | */
|
||
57 | #define STM32F407xx
|
||
58 | |||
59 | /*
|
||
60 | * IO pins assignments.
|
||
61 | */
|
||
62 | #define GPIOA_BUTTON 0U |
||
63 | #define GPIOA_PIN1 1U |
||
64 | #define GPIOA_PIN2 2U |
||
65 | #define GPIOA_PIN3 3U |
||
66 | #define GPIOA_LRCK 4U |
||
67 | #define GPIOA_SPC 5U |
||
68 | #define GPIOA_SDO 6U |
||
69 | #define GPIOA_SDI 7U |
||
70 | #define GPIOA_PIN8 8U |
||
71 | #define GPIOA_VBUS_FS 9U |
||
72 | #define GPIOA_OTG_FS_ID 10U |
||
73 | #define GPIOA_OTG_FS_DM 11U |
||
74 | #define GPIOA_OTG_FS_DP 12U |
||
75 | #define GPIOA_SWDIO 13U |
||
76 | #define GPIOA_SWCLK 14U |
||
77 | #define GPIOA_PIN15 15U |
||
78 | |||
79 | #define GPIOB_PIN0 0U |
||
80 | #define GPIOB_PIN1 1U |
||
81 | #define GPIOB_PIN2 2U |
||
82 | #define GPIOB_SWO 3U |
||
83 | #define GPIOB_PIN4 4U |
||
84 | #define GPIOB_PIN5 5U |
||
85 | #define GPIOB_SCL 6U |
||
86 | #define GPIOB_PIN7 7U |
||
87 | #define GPIOB_PIN8 8U |
||
88 | #define GPIOB_SDA 9U |
||
89 | #define GPIOB_CLK_IN 10U |
||
90 | #define GPIOB_PIN11 11U |
||
91 | #define GPIOB_PIN12 12U |
||
92 | #define GPIOB_PIN13 13U |
||
93 | #define GPIOB_PIN14 14U |
||
94 | #define GPIOB_PIN15 15U |
||
95 | |||
96 | #define GPIOC_OTG_FS_POWER_ON 0U |
||
97 | #define GPIOC_PIN1 1U |
||
98 | #define GPIOC_PIN2 2U |
||
99 | #define GPIOC_PDM_OUT 3U |
||
100 | #define GPIOC_PIN4 4U |
||
101 | #define GPIOC_PIN5 5U |
||
102 | #define GPIOC_PIN6 6U |
||
103 | #define GPIOC_MCLK 7U |
||
104 | #define GPIOC_PIN8 8U |
||
105 | #define GPIOC_PIN9 9U |
||
106 | #define GPIOC_SCLK 10U |
||
107 | #define GPIOC_PIN11 11U |
||
108 | #define GPIOC_SDIN 12U |
||
109 | #define GPIOC_PIN13 13U |
||
110 | #define GPIOC_PIN14 14U |
||
111 | #define GPIOC_PIN15 15U |
||
112 | |||
113 | #define GPIOD_PIN0 0U |
||
114 | #define GPIOD_PIN1 1U |
||
115 | #define GPIOD_PIN2 2U |
||
116 | #define GPIOD_PIN3 3U |
||
117 | #define GPIOD_RESET 4U |
||
118 | #define GPIOD_OVER_CURRENT 5U |
||
119 | #define GPIOD_PIN6 6U |
||
120 | #define GPIOD_PIN7 7U |
||
121 | #define GPIOD_PIN8 8U |
||
122 | #define GPIOD_PIN9 9U |
||
123 | #define GPIOD_PIN10 10U |
||
124 | #define GPIOD_PIN11 11U |
||
125 | #define GPIOD_LED4 12U |
||
126 | #define GPIOD_LED3 13U |
||
127 | #define GPIOD_LED5 14U |
||
128 | #define GPIOD_LED6 15U |
||
129 | |||
130 | #define GPIOE_INT1 0U |
||
131 | #define GPIOE_INT2 1U |
||
132 | #define GPIOE_PIN2 2U |
||
133 | #define GPIOE_CS_SPI 3U |
||
134 | #define GPIOE_PIN4 4U |
||
135 | #define GPIOE_PIN5 5U |
||
136 | #define GPIOE_PIN6 6U |
||
137 | #define GPIOE_PIN7 7U |
||
138 | #define GPIOE_PIN8 8U |
||
139 | #define GPIOE_PIN9 9U |
||
140 | #define GPIOE_PIN10 10U |
||
141 | #define GPIOE_PIN11 11U |
||
142 | #define GPIOE_PIN12 12U |
||
143 | #define GPIOE_PIN13 13U |
||
144 | #define GPIOE_PIN14 14U |
||
145 | #define GPIOE_PIN15 15U |
||
146 | |||
147 | #define GPIOF_PIN0 0U |
||
148 | #define GPIOF_PIN1 1U |
||
149 | #define GPIOF_PIN2 2U |
||
150 | #define GPIOF_PIN3 3U |
||
151 | #define GPIOF_PIN4 4U |
||
152 | #define GPIOF_PIN5 5U |
||
153 | #define GPIOF_PIN6 6U |
||
154 | #define GPIOF_PIN7 7U |
||
155 | #define GPIOF_PIN8 8U |
||
156 | #define GPIOF_PIN9 9U |
||
157 | #define GPIOF_PIN10 10U |
||
158 | #define GPIOF_PIN11 11U |
||
159 | #define GPIOF_PIN12 12U |
||
160 | #define GPIOF_PIN13 13U |
||
161 | #define GPIOF_PIN14 14U |
||
162 | #define GPIOF_PIN15 15U |
||
163 | |||
164 | #define GPIOG_PIN0 0U |
||
165 | #define GPIOG_PIN1 1U |
||
166 | #define GPIOG_PIN2 2U |
||
167 | #define GPIOG_PIN3 3U |
||
168 | #define GPIOG_PIN4 4U |
||
169 | #define GPIOG_PIN5 5U |
||
170 | #define GPIOG_PIN6 6U |
||
171 | #define GPIOG_PIN7 7U |
||
172 | #define GPIOG_PIN8 8U |
||
173 | #define GPIOG_PIN9 9U |
||
174 | #define GPIOG_PIN10 10U |
||
175 | #define GPIOG_PIN11 11U |
||
176 | #define GPIOG_PIN12 12U |
||
177 | #define GPIOG_PIN13 13U |
||
178 | #define GPIOG_PIN14 14U |
||
179 | #define GPIOG_PIN15 15U |
||
180 | |||
181 | #define GPIOH_OSC_IN 0U |
||
182 | #define GPIOH_OSC_OUT 1U |
||
183 | #define GPIOH_PIN2 2U |
||
184 | #define GPIOH_PIN3 3U |
||
185 | #define GPIOH_PIN4 4U |
||
186 | #define GPIOH_PIN5 5U |
||
187 | #define GPIOH_PIN6 6U |
||
188 | #define GPIOH_PIN7 7U |
||
189 | #define GPIOH_PIN8 8U |
||
190 | #define GPIOH_PIN9 9U |
||
191 | #define GPIOH_PIN10 10U |
||
192 | #define GPIOH_PIN11 11U |
||
193 | #define GPIOH_PIN12 12U |
||
194 | #define GPIOH_PIN13 13U |
||
195 | #define GPIOH_PIN14 14U |
||
196 | #define GPIOH_PIN15 15U |
||
197 | |||
198 | #define GPIOI_PIN0 0U |
||
199 | #define GPIOI_PIN1 1U |
||
200 | #define GPIOI_PIN2 2U |
||
201 | #define GPIOI_PIN3 3U |
||
202 | #define GPIOI_PIN4 4U |
||
203 | #define GPIOI_PIN5 5U |
||
204 | #define GPIOI_PIN6 6U |
||
205 | #define GPIOI_PIN7 7U |
||
206 | #define GPIOI_PIN8 8U |
||
207 | #define GPIOI_PIN9 9U |
||
208 | #define GPIOI_PIN10 10U |
||
209 | #define GPIOI_PIN11 11U |
||
210 | #define GPIOI_PIN12 12U |
||
211 | #define GPIOI_PIN13 13U |
||
212 | #define GPIOI_PIN14 14U |
||
213 | #define GPIOI_PIN15 15U |
||
214 | |||
215 | /*
|
||
216 | * IO lines assignments.
|
||
217 | */
|
||
218 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) |
||
219 | #define LINE_LRCK PAL_LINE(GPIOA, 4U) |
||
220 | #define LINE_SPC PAL_LINE(GPIOA, 5U) |
||
221 | #define LINE_SDO PAL_LINE(GPIOA, 6U) |
||
222 | #define LINE_SDI PAL_LINE(GPIOA, 7U) |
||
223 | #define LINE_VBUS_FS PAL_LINE(GPIOA, 9U) |
||
224 | #define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) |
||
225 | #define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) |
||
226 | #define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) |
||
227 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) |
||