amiro-os / modules / PowerManagement_1-1 / board.h @ b309b751
History | View | Annotate | Download (108.956 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 | 53710ca3 | Marc Rothmann | /**
|
| 20 | 37bacabf | Thomas Schöpping | * @file
|
| 21 | 53710ca3 | Marc Rothmann | * @brief PowerManagement v1.1 Board specific macros.
|
| 22 | *
|
||
| 23 | * @addtogroup powermanagement_board
|
||
| 24 | * @{
|
||
| 25 | */
|
||
| 26 | |||
| 27 | e545e620 | Thomas Schöpping | #ifndef _BOARD_H_
|
| 28 | #define _BOARD_H_
|
||
| 29 | |||
| 30 | /*
|
||
| 31 | 043cdf33 | Thomas Schöpping | * Setup for AMiRo PowerManagement v1.1 board.
|
| 32 | e545e620 | Thomas Schöpping | */
|
| 33 | |||
| 34 | /*
|
||
| 35 | * Board identifier.
|
||
| 36 | */
|
||
| 37 | #define BOARD_POWERMANAGEMENT
|
||
| 38 | #define BOARD_NAME "AMiRo PowerManagement" |
||
| 39 | #define BOARD_VERSION "1.1" |
||
| 40 | |||
| 41 | /*
|
||
| 42 | * Board oscillators-related settings.
|
||
| 43 | * NOTE: LSE not fitted.
|
||
| 44 | */
|
||
| 45 | #if !defined(STM32_LSECLK)
|
||
| 46 | #define STM32_LSECLK 0U |
||
| 47 | #endif
|
||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK)
|
||
| 50 | #define STM32_HSECLK 8000000U |
||
| 51 | #endif
|
||
| 52 | |||
| 53 | /*
|
||
| 54 | * Board voltages.
|
||
| 55 | * Required for performance limits calculation.
|
||
| 56 | */
|
||
| 57 | #define STM32_VDD 330U |
||
| 58 | |||
| 59 | /*
|
||
| 60 | * MCU type as defined in the ST header.
|
||
| 61 | */
|
||
| 62 | #define STM32F405xx
|
||
| 63 | |||
| 64 | /*
|
||
| 65 | * STM32F4 alternate function definitions
|
||
| 66 | */
|
||
| 67 | #define STM32F4xx_AF_system 0U |
||
| 68 | #define STM32F4xx_AF_TIM1to2 1U |
||
| 69 | #define STM32F4xx_AF_TIM3to5 2U |
||
| 70 | #define STM32F4xx_AF_TIM8to11 3U |
||
| 71 | #define STM32F4xx_AF_I2C1to3 4U |
||
| 72 | #define STM32F4xx_AF_SPI1to2 5U |
||
| 73 | #define STM32F4xx_AF_SPI3 6U |
||
| 74 | #define STM32F4xx_AF_USART1to3 7U |
||
| 75 | #define STM32F4xx_AF_USART4to6 8U |
||
| 76 | #define STM32F4xx_AF_CAN1to2_TIM12to14 9U |
||
| 77 | #define STM32F4xx_AF_OTG_HSFS 10U |
||
| 78 | #define STM32F4xx_AF_ETH 11U |
||
| 79 | #define STM32F4xx_AF_FSMC_SDIO_OTGHS 12U |
||
| 80 | #define STM32F4xx_AF_DCMI 13U |
||
| 81 | #define STM32F4xx_AF_EVENTOUT 15U |
||
| 82 | |||
| 83 | /*
|
||
| 84 | * IO pins assignments.
|
||
| 85 | */
|
||
| 86 | #define GPIOA_WKUP 0U |
||
| 87 | #define GPIOA_PIN1 1U |
||
| 88 | #define GPIOA_SYS_UART_TX 2U |
||
| 89 | #define GPIOA_SYS_UART_RX 3U |
||
| 90 | #define GPIOA_SYS_SPI_SS0_N 4U |
||
| 91 | #define GPIOA_SYS_SPI_SCLK 5U |
||
| 92 | #define GPIOA_SYS_SPI_MISO 6U |
||
| 93 | #define GPIOA_SYS_SPI_MOSI 7U |
||
| 94 | #define GPIOA_SYS_REG_EN 8U |
||
| 95 | #define GPIOA_PROG_RX 9U |
||
| 96 | #define GPIOA_PROG_TX 10U |
||
| 97 | #define GPIOA_CAN_RX 11U |
||
| 98 | #define GPIOA_CAN_TX 12U |
||
| 99 | #define GPIOA_SWDIO 13U |
||
| 100 | #define GPIOA_SWCLK 14U |
||
| 101 | #define GPIOA_SYS_SPI_SS1_N 15U |
||
| 102 | |||
| 103 | #define GPIOB_IR_INT1_N 0U |
||
| 104 | #define GPIOB_VSYS_SENSE 1U |
||
| 105 | #define GPIOB_POWER_EN 2U |
||
| 106 | #define GPIOB_SYS_UART_DN 3U |
||
| 107 | #define GPIOB_CHARGE_STAT2A 4U |
||
| 108 | #define GPIOB_BUZZER 5U |
||
| 109 | #define GPIOB_GAUGE_BATLOW2 6U |
||
| 110 | #define GPIOB_GAUGE_BATGD2_N 7U |
||
| 111 | #define GPIOB_GAUGE_SCL2 8U |
||
| 112 | #define GPIOB_GAUGE_SDA2 9U |
||
| 113 | #define GPIOB_GAUGE_SCL1 10U |
||
| 114 | #define GPIOB_GAUGE_SDA1 11U |
||
| 115 | #define GPIOB_LED 12U |
||
| 116 | #define GPIOB_BT_RTS 13U |
||
| 117 | #define GPIOB_BT_CTS 14U |
||
| 118 | #define GPIOB_SYS_UART_UP 15U |
||
| 119 | |||
| 120 | #define GPIOC_CHARGE_STAT1A 0U |
||
| 121 | #define GPIOC_GAUGE_BATLOW1 1U |
||
| 122 | #define GPIOC_GAUGE_BATGD1_N 2U |
||
| 123 | #define GPIOC_CHARGE_EN1_N 3U |
||
| 124 | #define GPIOC_IR_INT2_N 4U |
||
| 125 | #define GPIOC_TOUCH_INT_N 5U |
||
| 126 | #define GPIOC_SYS_DONE 6U |
||
| 127 | #define GPIOC_SYS_PROG_N 7U |
||
| 128 | #define GPIOC_PATH_DC 8U |
||
| 129 | #define GPIOC_SYS_SPI_DIR 9U |
||
| 130 | #define GPIOC_BT_RX 10U |
||
| 131 | #define GPIOC_BT_TX 11U |
||
| 132 | #define GPIOC_SYS_INT_N 12U |
||
| 133 | #define GPIOC_SYS_PD_N 13U |
||
| 134 | #define GPIOC_SYS_WARMRST_N 14U |
||
| 135 | #define GPIOC_BT_RST 15U |
||
| 136 | |||
| 137 | #define GPIOD_PIN0 0U |
||
| 138 | #define GPIOD_PIN1 1U |
||
| 139 | #define GPIOD_CHARGE_EN2_N 2U |
||
| 140 | #define GPIOD_PIN3 3U |
||
| 141 | #define GPIOD_PIN4 4U |
||
| 142 | #define GPIOD_PIN5 5U |
||
| 143 | #define GPIOD_PIN6 6U |
||
| 144 | #define GPIOD_PIN7 7U |
||
| 145 | #define GPIOD_PIN8 8U |
||
| 146 | #define GPIOD_PIN9 9U |
||
| 147 | #define GPIOD_PIN10 10U |
||
| 148 | #define GPIOD_PIN11 11U |
||
| 149 | #define GPIOD_PIN12 12U |
||
| 150 | #define GPIOD_PIN13 13U |
||
| 151 | #define GPIOD_PIN14 14U |
||
| 152 | #define GPIOD_PIN15 15U |
||
| 153 | |||
| 154 | #define GPIOE_PIN0 0U |
||
| 155 | #define GPIOE_PIN1 1U |
||
| 156 | #define GPIOE_PIN2 2U |
||
| 157 | #define GPIOE_PIN3 3U |
||
| 158 | #define GPIOE_PIN4 4U |
||
| 159 | #define GPIOE_PIN5 5U |
||
| 160 | #define GPIOE_PIN6 6U |
||
| 161 | #define GPIOE_PIN7 7U |
||
| 162 | #define GPIOE_PIN8 8U |
||
| 163 | #define GPIOE_PIN9 9U |
||
| 164 | #define GPIOE_PIN10 10U |
||
| 165 | #define GPIOE_PIN11 11U |
||
| 166 | #define GPIOE_PIN12 12U |
||
| 167 | #define GPIOE_PIN13 13U |
||
| 168 | #define GPIOE_PIN14 14U |
||
| 169 | #define GPIOE_PIN15 15U |
||
| 170 | |||
| 171 | #define GPIOF_PIN0 0U |
||
| 172 | #define GPIOF_PIN1 1U |
||
| 173 | #define GPIOF_PIN2 2U |
||
| 174 | #define GPIOF_PIN3 3U |
||
| 175 | #define GPIOF_PIN4 4U |
||
| 176 | #define GPIOF_PIN5 5U |
||
| 177 | #define GPIOF_PIN6 6U |
||
| 178 | #define GPIOF_PIN7 7U |
||
| 179 | #define GPIOF_PIN8 8U |
||
| 180 | #define GPIOF_PIN9 9U |
||
| 181 | #define GPIOF_PIN10 10U |
||
| 182 | #define GPIOF_PIN11 11U |
||
| 183 | #define GPIOF_PIN12 12U |
||
| 184 | #define GPIOF_PIN13 13U |
||
| 185 | #define GPIOF_PIN14 14U |
||
| 186 | #define GPIOF_PIN15 15U |
||
| 187 | |||
| 188 | #define GPIOG_PIN0 0U |
||
| 189 | #define GPIOG_PIN1 1U |
||
| 190 | #define GPIOG_PIN2 2U |
||
| 191 | #define GPIOG_PIN3 3U |
||
| 192 | #define GPIOG_PIN4 4U |
||
| 193 | #define GPIOG_PIN5 5U |
||
| 194 | #define GPIOG_PIN6 6U |
||
| 195 | #define GPIOG_PIN7 7U |
||
| 196 | #define GPIOG_PIN8 8U |
||
| 197 | #define GPIOG_PIN9 9U |
||
| 198 | #define GPIOG_PIN10 10U |
||
| 199 | #define GPIOG_PIN11 11U |
||
| 200 | #define GPIOG_PIN12 12U |
||
| 201 | #define GPIOG_PIN13 13U |
||
| 202 | #define GPIOG_PIN14 14U |
||
| 203 | #define GPIOG_PIN15 15U |
||
| 204 | |||
| 205 | #define GPIOH_OSC_IN 0U |
||
| 206 | #define GPIOH_OSC_OUT 1U |
||
| 207 | #define GPIOH_PIN2 2U |
||
| 208 | #define GPIOH_PIN3 3U |
||
| 209 | #define GPIOH_PIN4 4U |
||
| 210 | #define GPIOH_PIN5 5U |
||
| 211 | #define GPIOH_PIN6 6U |
||
| 212 | #define GPIOH_PIN7 7U |
||
| 213 | #define GPIOH_PIN8 8U |
||
| 214 | #define GPIOH_PIN9 9U |
||
| 215 | #define GPIOH_PIN10 10U |
||
| 216 | #define GPIOH_PIN11 11U |
||
| 217 | #define GPIOH_PIN12 12U |
||
| 218 | #define GPIOH_PIN13 13U |
||
| 219 | #define GPIOH_PIN14 14U |
||
| 220 | #define GPIOH_PIN15 15U |
||
| 221 | |||
| 222 | #define GPIOI_PIN0 0U |
||
| 223 | #define GPIOI_PIN1 1U |
||
| 224 | #define GPIOI_PIN2 2U |
||
| 225 | #define GPIOI_PIN3 3U |
||
| 226 | #define GPIOI_PIN4 4U |
||
| 227 | #define GPIOI_PIN5 |