amiro-os / modules / LightRing_1-0 / board.h @ 732a4657
History | View | Annotate | Download (39.849 KB)
1 | e545e620 | Thomas Schöpping | /*
|
---|---|---|---|
2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
3 | 84f0ce9e | Thomas Schöpping | Copyright (C) 2016..2019 Thomas Schöpping et al.
|
4 | e545e620 | Thomas Schöpping | |
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 | 53710ca3 | Marc Rothmann | /**
|
20 | 37bacabf | Thomas Schöpping | * @file
|
21 | 53710ca3 | Marc Rothmann | * @brief LightRing v1.0 Board specific macros.
|
22 | *
|
||
23 | * @addtogroup lightring_board
|
||
24 | * @{
|
||
25 | */
|
||
26 | |||
27 | 6ff06bbf | Thomas Schöpping | #ifndef BOARD_H
|
28 | #define BOARD_H
|
||
29 | e545e620 | Thomas Schöpping | |
30 | /*
|
||
31 | 043cdf33 | Thomas Schöpping | * Setup for AMiRo LightRing v1.0 board.
|
32 | e545e620 | Thomas Schöpping | */
|
33 | |||
34 | /*
|
||
35 | * Board identifier.
|
||
36 | */
|
||
37 | 3cb82b1a | Thomas Schöpping | #define BOARD_LIGHTRING_1_0
|
38 | #define BOARD_NAME "AMiRo LightRing v1.0" |
||
39 | e545e620 | Thomas Schöpping | |
40 | /*
|
||
41 | * Board oscillators-related settings.
|
||
42 | * NOTE: LSE not fitted.
|
||
43 | */
|
||
44 | #if !defined(STM32_LSECLK)
|
||
45 | #define STM32_LSECLK 0U |
||
46 | #endif
|
||
47 | |||
48 | #if !defined(STM32_HSECLK)
|
||
49 | #define STM32_HSECLK 8000000U |
||
50 | #endif
|
||
51 | |||
52 | /*
|
||
53 | * Board voltages.
|
||
54 | * Required for performance limits calculation.
|
||
55 | */
|
||
56 | #define STM32_VDD 330U |
||
57 | |||
58 | /*
|
||
59 | * MCU type as defined in the ST header.
|
||
60 | */
|
||
61 | #define STM32F103xE
|
||
62 | |||
63 | /*
|
||
64 | * IO pins assignments.
|
||
65 | */
|
||
66 | #define GPIOA_PIN0 0U |
||
67 | #define GPIOA_PIN1 1U |
||
68 | #define GPIOA_LASER_RX 2U |
||
69 | #define GPIOA_LASER_TX 3U |
||
70 | #define GPIOA_LIGHT_BLANK 4U |
||
71 | #define GPIOA_LIGHT_SCLK 5U |
||
72 | #define GPIOA_PIN6 6U |
||
73 | #define GPIOA_LIGHT_MOSI 7U |
||
74 | #define GPIOA_PIN8 8U |
||
75 | #define GPIOA_PROG_RX 9U |
||
76 | #define GPIOA_PROG_TX 10U |
||
77 | #define GPIOA_CAN_RX 11U |
||
78 | #define GPIOA_CAN_TX 12U |
||
79 | #define GPIOA_SWDIO 13U |
||
80 | #define GPIOA_SWCLK 14U |
||
81 | #define GPIOA_PIN15 15U |
||
82 | |||
83 | #define GPIOB_PIN0 0U |
||
84 | #define GPIOB_PIN1 1U |
||
85 | #define GPIOB_LASER_EN 2U |
||
86 | #define GPIOB_PIN3 3U |
||
87 | #define GPIOB_PIN4 4U |
||
88 | #define GPIOB_LASER_OC_N 5U |
||
89 | #define GPIOB_SYS_UART_DN 6U |
||
90 | #define GPIOB_PIN7 7U |
||
91 | #define GPIOB_WL_GDO2 8U |
||
92 | #define GPIOB_WL_GDO0 9U |
||
93 | #define GPIOB_MEM_SCL 10U |
||
94 | #define GPIOB_MEM_SDA 11U |
||
95 | #define GPIOB_WL_SS_N 12U |
||
96 | #define GPIOB_WL_SCLK 13U |
||
97 | #define GPIOB_WL_MISO 14U |
||
98 | #define GPIOB_WL_MOSI 15U |
||
99 | |||
100 | #define GPIOC_PIN0 0U |
||
101 | #define GPIOC_PIN1 1U |
||
102 | #define GPIOC_PIN2 2U |
||
103 | #define GPIOC_PIN3 3U |
||
104 | #define GPIOC_LIGHT_XLAT 4U |
||
105 | #define GPIOC_PIN5 5U |
||
106 | #define GPIOC_PIN6 6U |
||
107 | #define GPIOC_PIN7 7U |
||
108 | #define GPIOC_PIN8 8U |
||
109 | #define GPIOC_PIN9 9U |
||
110 | #define GPIOC_SYS_UART_RX 10U |
||
111 | #define GPIOC_SYS_UART_TX 11U |
||
112 | #define GPIOC_PIN12 12U |
||
113 | #define GPIOC_PIN13 13U |
||
114 | #define GPIOC_SYS_PD_N 14U |
||
115 | #define GPIOC_PIN15 15U |
||
116 | |||
117 | #define GPIOD_OSC_IN 0U |
||
118 | #define GPIOD_OSC_OUT 1U |
||
119 | #define GPIOD_SYS_INT_N 2U |
||
120 | #define GPIOD_PIN3 3U |
||
121 | #define GPIOD_PIN4 4U |
||
122 | #define GPIOD_PIN5 5U |
||
123 | #define GPIOD_PIN6 6U |
||
124 | #define GPIOD_PIN7 7U |
||
125 | #define GPIOD_PIN8 8U |
||
126 | #define GPIOD_PIN9 9U |
||
127 | #define GPIOD_PIN10 10U |
||
128 | #define GPIOD_PIN11 11U |
||
129 | #define GPIOD_PIN12 12U |
||
130 | #define GPIOD_PIN13 13U |
||
131 | #define GPIOD_PIN14 14U |
||
132 | #define GPIOD_PIN15 15U |
||
133 | |||
134 | #define GPIOE_PIN0 0U |
||
135 | #define GPIOE_PIN1 1U |
||
136 | #define GPIOE_PIN2 2U |
||
137 | #define GPIOE_PIN3 3U |
||
138 | #define GPIOE_PIN4 4U |
||
139 | #define GPIOE_PIN5 5U |
||
140 | #define GPIOE_PIN6 6U |
||
141 | #define GPIOE_PIN7 7U |
||
142 | #define GPIOE_PIN8 8U |
||
143 | #define GPIOE_PIN9 9U |
||
144 | #define GPIOE_PIN10 10U |
||
145 | #define GPIOE_PIN11 11U |
||
146 | #define GPIOE_PIN12 12U |
||
147 | #define GPIOE_PIN13 13U |
||
148 | #define GPIOE_PIN14 14U |
||
149 | #define GPIOE_PIN15 15U |
||
150 | |||
151 | #define GPIOF_PIN0 0U |
||
152 | #define GPIOF_PIN1 1U |
||
153 | #define GPIOF_PIN2 2U |
||
154 | #define GPIOF_PIN3 3U |
||
155 | #define GPIOF_PIN4 4U |
||
156 | #define GPIOF_PIN5 5U |
||
157 | #define GPIOF_PIN6 6U |
||
158 | #define GPIOF_PIN7 7U |
||
159 | #define GPIOF_PIN8 8U |
||
160 | #define GPIOF_PIN9 9U |
||
161 | #define GPIOF_PIN10 10U |
||
162 | #define GPIOF_PIN11 11U |
||
163 | #define GPIOF_PIN12 12U |
||
164 | #define GPIOF_PIN13 13U |
||
165 | #define GPIOF_PIN14 14U |
||
166 | #define GPIOF_PIN15 15U |
||
167 | |||
168 | #define GPIOG_PIN0 0U |
||
169 | #define GPIOG_PIN1 1U |
||
170 | #define GPIOG_PIN2 2U |
||
171 | #define GPIOG_PIN3 3U |
||
172 | #define GPIOG_PIN4 4U |
||
173 | #define GPIOG_PIN5 5U |
||
174 | #define GPIOG_PIN6 6U |
||
175 | #define GPIOG_PIN7 7U |
||
176 | #define GPIOG_PIN8 8U |
||
177 | #define GPIOG_PIN9 9U |
||
178 | #define GPIOG_PIN10 10U |
||
179 | #define GPIOG_PIN11 11U |
||
180 | #define GPIOG_PIN12 12U |
||
181 | #define GPIOG_PIN13 13U |
||
182 | #define GPIOG_PIN14 14U |
||
183 | #define GPIOG_PIN15 15U |
||
184 | |||
185 | /*
|
||
186 | * IO lines assignments.
|
||
187 | */
|
||
188 | #define LINE_LASER_RX PAL_LINE(GPIOA, GPIOA_LASER_RX)
|
||
189 | #define LINE_LASER_TX PAL_LINE(GPIOA, GPIOA_LASER_TX)
|
||
190 | #define LINE_LIGHT_BLANK PAL_LINE(GPIOA, GPIOA_LIGHT_BLANK)
|
||
191 | #define LINE_LIGHT_SCLK PAL_LINE(GPIOA, GPIOA_LIGHT_SCLK)
|
||
192 | #define LINE_LIGHT_MOSI PAL_LINE(GPIOA, GPIOA_LIGHT_MOSI)
|
||
193 | #define LINE_PROG_RX PAL_LINE(GPIOA, GPIOA_PROG_RX)
|
||
194 | #define LINE_PROG_TX PAL_LINE(GPIOA, GPIOA_PROG_TX)
|
||
195 | #define LINE_CAN_RX PAL_LINE(GPIOA, GPIOA_CAN_RX)
|
||
196 | #define LINE_CAN_TX PAL_LINE(GPIOA, GPIOA_CAN_TX)
|
||
197 | #define LINE_SWDIO PAL_LINE(GPIOA, GPIOA_SWDIO)
|
||
198 | #define LINE_SWCLK PAL_LINE(GPIOA, GPIOA_SWCLK)
|
||
199 | |||
200 | #define LINE_LASER_EN PAL_LINE(GPIOB, GPIOB_LASER_EN)
|
||
201 | #define LINE_LASER_OC_N PAL_LINE(GPIOB, GPIOB_LASER_OC_N)
|
||
202 | #define LINE_SYS_UART_DN PAL_LINE(GPIOB, GPIOB_SYS_UART_DN)
|
||
203 | #define LINE_WL_GDO2 PAL_LINE(GPIOB, GPIOB_WL_GDO2)
|
||
204 | #define LINE_WL_GDO0 PAL_LINE(GPIOB, GPIOB_WL_GDO0)
|
||
205 | #define LINE_MEM_SCL PAL_LINE(GPIOB, GPIOB_MEM_SCL)
|
||
206 | #define LINE_MEM_SDA PAL_LINE(GPIOB, GPIOB_MEM_SDA)
|
||
207 | #define LINE_WL_SS_N PAL_LINE(GPIOB, GPIOB_WL_SS_N)
|
||
208 | #define LINE_WL_SCLK PAL_LINE(GPIOB, GPIOB_WL_SCLK)
|
||
209 | #define LINE_WL_MISO PAL_LINE(GPIOB, GPIOB_WL_MISO)
|
||
210 | #define LINE_WL_MOSI PAL_LINE(GPIOB, GPIOB_WL_MOSI)
|
||
211 | |||
212 | #define LINE_LIGHT_XLAT PAL_LINE(GPIOC, GPIOC_LIGHT_XLAT)
|
||
213 | #define LINE_SYS_UART_RX PAL_LINE(GPIOC, GPIOC_SYS_UART_RX)
|
||
214 | #define LINE_SYS_UART_TX PAL_LINE(GPIOC, GPIOC_SYS_UART_TX)
|
||
215 | #define LINE_SYS_PD_N PAL_LINE(GPIOC, GPIOC_SYS_PD_N)
|
||
216 | |||
217 | #define LINE_SYS_INT_N PAL_LINE(GPIOD, GPIOD_SYS_INT_N)
|
||
218 | |||
219 | /*
|
||
220 | * I/O ports initial setup, this configuration is established soon after reset
|
||
221 | * in the initialization code.
|
||
222 | * Please refer to the STM32 Reference Manual for details.
|
||
223 | */
|
||
224 | #define PIN_MODE_INPUT 0U |
||
225 | #define PIN_MODE_OUTPUT_2M 2U |
||
226 | #define PIN_MODE_OUTPUT_10M 1U |
||
227 | #define PIN_MODE_OUTPUT_50M 3U |
||
228 | #define PIN_CNF_INPUT_ANALOG 0 |