amiro-os / modules / PowerManagement_1-2 / board.h @ 47e89ebf
History | View | Annotate | Download (108.439 KB)
1 | b010278f | Thomas Schöpping | /*
|
---|---|---|---|
2 | 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 | |||
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 | /**
|
||
20 | * @file
|
||
21 | * @brief PowerManagement v1.2 Board specific macros.
|
||
22 | *
|
||
23 | * @addtogroup powermanagement_board
|
||
24 | * @{
|
||
25 | */
|
||
26 | |||
27 | #ifndef BOARD_H
|
||
28 | #define BOARD_H
|
||
29 | |||
30 | /*
|
||
31 | * Setup for AMiRo PowerManagement v1.2 board.
|
||
32 | */
|
||
33 | |||
34 | /*
|
||
35 | * Board identifier.
|
||
36 | */
|
||
37 | #define BOARD_POWERMANAGEMENT_1_2
|
||
38 | #define BOARD_NAME "AMiRo PowerManagement v1.2" |
||
39 | |||
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 STM32F405xx
|
||
62 | |||
63 | /*
|
||
64 | * STM32F4 alternate function definitions
|
||
65 | */
|
||
66 | #define STM32F4xx_AF_system 0U |
||
67 | #define STM32F4xx_AF_TIM1to2 1U |
||
68 | #define STM32F4xx_AF_TIM3to5 2U |
||
69 | #define STM32F4xx_AF_TIM8to11 3U |
||
70 | #define STM32F4xx_AF_I2C1to3 4U |
||
71 | #define STM32F4xx_AF_SPI1to2 5U |
||
72 | #define STM32F4xx_AF_SPI3 6U |
||
73 | #define STM32F4xx_AF_USART1to3 7U |
||
74 | #define STM32F4xx_AF_USART4to6 8U |
||
75 | #define STM32F4xx_AF_CAN1to2_TIM12to14 9U |
||
76 | #define STM32F4xx_AF_OTG_HSFS 10U |
||
77 | #define STM32F4xx_AF_ETH 11U |
||
78 | #define STM32F4xx_AF_FSMC_SDIO_OTGHS 12U |
||
79 | #define STM32F4xx_AF_DCMI 13U |
||
80 | #define STM32F4xx_AF_EVENTOUT 15U |
||
81 | |||
82 | /*
|
||
83 | 034cb15a | Thomas Schöpping | * Identifiers for the several sensor rings, which can be attached to the PowerManagement v1.2 module.
|
84 | b010278f | Thomas Schöpping | */
|
85 | #define BOARD_NOSENSORRING 0 |
||
86 | #define BOARD_PROXIMITYSENSOR 1 |
||
87 | #define BOARD_DISTANCESENSOR_VL53L0X 2 |
||
88 | #define BOARD_DISTANCESENSOR_VL53L1X 3 |
||
89 | |||
90 | /*
|
||
91 | * Configuration macro to define which type of sensor ring is attached.
|
||
92 | */
|
||
93 | 4c72a54c | Thomas Schöpping | #if !defined(BOARD_SENSORRING) || defined(__DOXYGEN__)
|
94 | b010278f | Thomas Schöpping | #define BOARD_SENSORRING BOARD_PROXIMITYSENSOR
|
95 | 4c72a54c | Thomas Schöpping | #endif
|
96 | b010278f | Thomas Schöpping | |
97 | /*
|
||
98 | * IO pins assignments.
|
||
99 | */
|
||
100 | #define GPIOA_WKUP 0U |
||
101 | #define GPIOA_SWITCH_STATUS_N 1U |
||
102 | #define GPIOA_SYS_UART_TX 2U |
||
103 | #define GPIOA_SYS_UART_RX 3U |
||
104 | #define GPIOA_SYS_SPI_SS0_N 4U |
||
105 | #define GPIOA_SYS_SPI_SCLK 5U |
||
106 | #define GPIOA_SYS_SPI_MISO 6U |
||
107 | #define GPIOA_SYS_SPI_MOSI 7U |
||
108 | #define GPIOA_SYS_REG_EN 8U |
||
109 | #define GPIOA_PROG_RX 9U |
||
110 | #define GPIOA_PROG_TX 10U |
||
111 | #define GPIOA_CAN_RX 11U |
||
112 | #define GPIOA_CAN_TX 12U |
||
113 | #define GPIOA_SWDIO 13U |
||
114 | #define GPIOA_SWCLK 14U |
||
115 | #define GPIOA_SYS_SPI_SS1_N 15U |
||
116 | |||
117 | #define GPIOB_IR_INT1_N 0U |
||
118 | #define GPIOB_VSYS_SENSE 1U |
||
119 | #define GPIOB_POWER_EN 2U |
||
120 | #define GPIOB_SYS_UART_DN 3U |
||
121 | #define GPIOB_CHARGE_STAT2A 4U |
||
122 | #define GPIOB_BUZZER 5U |
||
123 | #define GPIOB_GAUGE_BATLOW2 6U |
||
124 | #define GPIOB_GAUGE_BATGD2_N 7U |
||
125 | #define GPIOB_GAUGE_SCL2 8U |
||
126 | #define GPIOB_GAUGE_SDA2 9U |
||
127 | #define GPIOB_GAUGE_SCL1 10U |
||
128 | #define GPIOB_GAUGE_SDA1 11U |
||
129 | #define GPIOB_LED 12U |
||
130 | #define GPIOB_BT_RTS 13U |
||
131 | #define GPIOB_BT_CTS 14U |
||
132 | #define GPIOB_SYS_UART_UP 15U |
||
133 | |||
134 | #define GPIOC_CHARGE_STAT1A 0U |
||
135 | #define GPIOC_GAUGE_BATLOW1 1U |
||
136 | #define GPIOC_GAUGE_BATGD1_N 2U |
||
137 | #define GPIOC_CHARGE_EN1_N 3U |
||
138 | #define GPIOC_IR_INT2_N 4U |
||
139 | #define GPIOC_TOUCH_INT_N 5U |
||
140 | #define GPIOC_SYS_DONE 6U |
||
141 | #define GPIOC_SYS_PROG_N 7U |
||
142 | #define GPIOC_PATH_DC 8U |
||
143 | #define GPIOC_SYS_SPI_DIR 9U |
||
144 | #define GPIOC_BT_RX 10U |
||
145 | #define GPIOC_BT_TX 11U |
||
146 | #define GPIOC_SYS_INT_N 12U |
||
147 | #define GPIOC_SYS_PD_N 13U |
||
148 | #define GPIOC_SYS_WARMRST_N 14U |
||
149 | #define GPIOC_BT_RST 15U |
||
150 | |||
151 | #define GPIOD_PIN0 0U |
||
152 | #define GPIOD_PIN1 1U |
||
153 | #define GPIOD_CHARGE_EN2_N 2U |
||
154 | #define GPIOD_PIN3 3U |
||
155 | #define GPIOD_PIN4 4U |
||
156 | #define GPIOD_PIN5 5U |
||
157 | #define GPIOD_PIN6 6U |
||
158 | #define GPIOD_PIN7 7U |
||
159 | #define GPIOD_PIN8 8U |
||
160 | #define GPIOD_PIN9 9U |
||
161 | #define GPIOD_PIN10 10U |
||
162 | #define GPIOD_PIN11 11U |
||
163 | #define GPIOD_PIN12 12U |
||
164 | #define GPIOD_PIN13 13U |
||
165 | #define GPIOD_PIN14 14U |
||
166 | #define GPIOD_PIN15 15U |
||
167 | |||
168 | #define GPIOE_PIN0 0U |
||
169 | #define GPIOE_PIN1 1U |
||
170 | #define GPIOE_PIN2 2U |
||
171 | #define GPIOE_PIN3 3U |
||
172 | #define GPIOE_PIN4 4U |
||
173 | #define GPIOE_PIN5 5U |
||
174 | #define GPIOE_PIN6 6U |
||
175 | #define GPIOE_PIN7 7U |
||
176 | #define GPIOE_PIN8 8U |
||
177 | #define GPIOE_PIN9 9U |
||
178 | #define GPIOE_PIN10 10U |
||
179 | #define GPIOE_PIN11 11U |
||
180 | #define GPIOE_PIN12 12U |
||
181 | #define GPIOE_PIN13 13U |
||
182 | #define GPIOE_PIN14 14U |
||
183 | #define GPIOE_PIN15 15U |
||
184 | |||
185 | #define GPIOF_PIN0 0U |
||
186 | #define GPIOF_PIN1 1U |
||
187 | #define GPIOF_PIN2 2U |
||
188 | #define GPIOF_PIN3 3U |
||
189 | #define GPIOF_PIN4 4U |
||
190 | #define GPIOF_PIN5 5U |
||
191 | #define GPIOF_PIN6 6U |
||
192 | #define GPIOF_PIN7 7U |
||
193 | #define GPIOF_PIN8 8U |
||
194 | #define GPIOF_PIN9 9U |
||
195 | #define GPIOF_PIN10 10U |
||
196 | #define GPIOF_PIN11 11U |
||
197 | #define GPIOF_PIN12 12U |
||
198 | #define GPIOF_PIN13 13U |
||
199 | #define GPIOF_PIN14 14U |
||
200 | #define GPIOF_PIN15 15U |
||
201 | |||
202 | #define GPIOG_PIN0 0U |
||
203 | #define GPIOG_PIN1 1U |
||
204 | #define GPIOG_PIN2 2U |
||
205 | #define GPIOG_PIN3 3U |
||
206 | #define GPIOG_PIN4 4U |
||
207 | #define GPIOG_PIN5 5U |
||
208 | #define GPIOG_PIN6 6U |
||
209 | #define GPIOG_PIN7 7U |
||
210 | #define GPIOG_PIN8 8U |
||
211 | #define GPIOG_PIN9 9U |
||
212 | #define GPIOG_PIN10 10U |
||
213 | #define GPIOG_PIN11 11U |
||
214 | #define GPIOG_PIN12 12U |
||
215 | #define GPIOG_PIN13 13U |
||
216 | #define GPIOG_PIN14 14U |
||
217 | #define GPIOG_PIN15 15U |
||
218 | |||
219 | #define GPIOH_OSC_IN 0U |
||
220 | #define GPIOH_OSC_OUT 1U |
||
221 | #define GPIOH_PIN2 2U |
||
222 | #define GPIOH_PIN3 3U |
||
223 | #define GPIOH_PIN4 4U |
||
224 | #define GPIOH_PIN5 5U |
||
225 | #define GPIOH_PIN6 6U |
||
226 | #define GPIOH_PIN7 7U |
||
227 | #define GPIOH_PIN8 8U |
||
228 | #define GPIOH_PIN9 9U |
||
229 | #define GPIOH_PIN10 10U |
||
230 |