amiro-os / modules / DiWheelDrive_1-1 / board.h @ a93a1019
History | View | Annotate | Download (42.801 KB)
| 1 | e545e620 | Thomas Schöpping | /*
|
|---|---|---|---|
| 2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
| 3 | 96621a83 | Thomas Schöpping | Copyright (C) 2016..2020 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 DiWheeDrive v1.1 Board specific macros.
|
| 22 | *
|
||
| 23 | * @addtogroup diwheeldrive_board
|
||
| 24 | * @{
|
||
| 25 | */
|
||
| 26 | |||
| 27 | 6ff06bbf | Thomas Schöpping | #ifndef BOARD_H
|
| 28 | #define BOARD_H
|
||
| 29 | e545e620 | Thomas Schöpping | |
| 30 | cda14729 | Thomas Schöpping | /*===========================================================================*/
|
| 31 | /* Driver constants. */
|
||
| 32 | /*===========================================================================*/
|
||
| 33 | |||
| 34 | e545e620 | Thomas Schöpping | /*
|
| 35 | 043cdf33 | Thomas Schöpping | * Setup for AMiRo DiWheelDrive v1.1 board.
|
| 36 | e545e620 | Thomas Schöpping | */
|
| 37 | |||
| 38 | /*
|
||
| 39 | * Board identifier.
|
||
| 40 | */
|
||
| 41 | 3cb82b1a | Thomas Schöpping | #define BOARD_DIWHEELDRIVE_1_1
|
| 42 | #define BOARD_NAME "AMiRo DiWheelDrive v1.1" |
||
| 43 | e545e620 | Thomas Schöpping | |
| 44 | /*
|
||
| 45 | * Board oscillators-related settings.
|
||
| 46 | * NOTE: LSE not fitted.
|
||
| 47 | */
|
||
| 48 | #if !defined(STM32_LSECLK)
|
||
| 49 | #define STM32_LSECLK 0U |
||
| 50 | #endif
|
||
| 51 | |||
| 52 | #if !defined(STM32_HSECLK)
|
||
| 53 | #define STM32_HSECLK 8000000U |
||
| 54 | #endif
|
||
| 55 | |||
| 56 | /*
|
||
| 57 | * Board voltages.
|
||
| 58 | * Required for performance limits calculation.
|
||
| 59 | */
|
||
| 60 | #define STM32_VDD 330U |
||
| 61 | |||
| 62 | /*
|
||
| 63 | * MCU type as defined in the ST header.
|
||
| 64 | */
|
||
| 65 | #define STM32F103xE
|
||
| 66 | |||
| 67 | /*
|
||
| 68 | * IO pins assignments.
|
||
| 69 | */
|
||
| 70 | #define GPIOA_WKUP 0U |
||
| 71 | #define GPIOA_LED 1U |
||
| 72 | #define GPIOA_DRIVE_PWM1A 2U |
||
| 73 | #define GPIOA_DRIVE_PWM1B 3U |
||
| 74 | #define GPIOA_PIN4 4U |
||
| 75 | #define GPIOA_MOTION_SCLK 5U |
||
| 76 | #define GPIOA_MOTION_MISO 6U |
||
| 77 | #define GPIOA_MOTION_MOSI 7U |
||
| 78 | #define GPIOA_PIN8 8U |
||
| 79 | #define GPIOA_PROG_RX 9U |
||
| 80 | #define GPIOA_PROG_TX 10U |
||
| 81 | #define GPIOA_CAN_RX 11U |
||
| 82 | #define GPIOA_CAN_TX 12U |
||
| 83 | #define GPIOA_SWDIO 13U |
||
| 84 | #define GPIOA_SWCLK 14U |
||
| 85 | #define GPIOA_DRIVE_PWM2B 15U |
||
| 86 | |||
| 87 | #define GPIOB_PIN0 0U |
||
| 88 | #define GPIOB_DRIVE_SENSE2 1U |
||
| 89 | #define GPIOB_POWER_EN 2U |
||
| 90 | #define GPIOB_DRIVE_PWM2A 3U |
||
| 91 | #define GPIOB_PIN4 4U |
||
| 92 | #define GPIOB_COMPASS_DRDY 5U |
||
| 93 | #define GPIOB_DRIVE_ENC1A 6U |
||
| 94 | #define GPIOB_DRIVE_ENC1B 7U |
||
| 95 | #define GPIOB_COMPASS_SCL 8U |
||
| 96 | #define GPIOB_COMPASS_SDA 9U |
||
| 97 | #define GPIOB_IR_SCL 10U |
||
| 98 | #define GPIOB_IR_SDA 11U |
||
| 99 | #define GPIOB_IR_INT 12U |
||
| 100 | #define GPIOB_GYRO_DRDY 13U |
||
| 101 | #define GPIOB_SYS_UART_UP 14U |
||
| 102 | #define GPIOB_ACCEL_INT_N 15U |
||
| 103 | |||
| 104 | #define GPIOC_DRIVE_SENSE1 0U |
||
| 105 | #define GPIOC_SYS_INT_N 1U |
||
| 106 | #define GPIOC_PIN2 2U |
||
| 107 | #define GPIOC_PATH_DCSTAT 3U |
||
| 108 | #define GPIOC_PIN4 4U |
||
| 109 | #define GPIOC_PATH_DCEN 5U |
||
| 110 | #define GPIOC_DRIVE_ENC2B 6U |
||
| 111 | #define GPIOC_DRIVE_ENC2A 7U |
||
| 112 | #define GPIOC_SYS_PD_N 8U |
||
| 113 | #define GPIOC_SYS_REG_EN 9U |
||
| 114 | #define GPIOC_SYS_UART_RX 10U |
||
| 115 | #define GPIOC_SYS_UART_TX 11U |
||
| 116 | #define GPIOC_PIN12 12U |
||
| 117 | #define GPIOC_ACCEL_SS_N 13U |
||
| 118 | #define GPIOC_GYRO_SS_N 14U |
||
| 119 | #define GPIOC_PIN15 15U |
||
| 120 | |||
| 121 | #define GPIOD_OSC_IN 0U |
||
| 122 | #define GPIOD_OSC_OUT 1U |
||
| 123 | #define GPIOD_SYS_WARMRST_N 2U |
||
| 124 | #define GPIOD_PIN3 3U |
||
| 125 | #define GPIOD_PIN4 4U |
||
| 126 | #define GPIOD_PIN5 5U |
||
| 127 | #define GPIOD_PIN6 6U |
||
| 128 | #define GPIOD_PIN7 7U |
||
| 129 | #define GPIOD_PIN8 8U |
||
| 130 | #define GPIOD_PIN9 9U |
||
| 131 | #define GPIOD_PIN10 10U |
||
| 132 | #define GPIOD_PIN11 11U |
||
| 133 | #define GPIOD_PIN12 12U |
||
| 134 | #define GPIOD_PIN13 13U |
||
| 135 | #define GPIOD_PIN14 14U |
||
| 136 | #define GPIOD_PIN15 15U |
||
| 137 | |||
| 138 | #define GPIOE_PIN0 0U |
||
| 139 | #define GPIOE_PIN1 1U |
||
| 140 | #define GPIOE_PIN2 2U |
||
| 141 | #define GPIOE_PIN3 3U |
||
| 142 | #define GPIOE_PIN4 4U |
||
| 143 | #define GPIOE_PIN5 5U |
||
| 144 | #define GPIOE_PIN6 6U |
||
| 145 | #define GPIOE_PIN7 7U |
||
| 146 | #define GPIOE_PIN8 8U |
||
| 147 | #define GPIOE_PIN9 9U |
||
| 148 | #define GPIOE_PIN10 10U |
||
| 149 | #define GPIOE_PIN11 11U |
||
| 150 | #define GPIOE_PIN12 12U |
||
| 151 | #define GPIOE_PIN13 13U |
||
| 152 | #define GPIOE_PIN14 14U |
||
| 153 | #define GPIOE_PIN15 15U |
||
| 154 | |||
| 155 | #define GPIOF_PIN0 0U |
||
| 156 | #define GPIOF_PIN1 1U |
||
| 157 | #define GPIOF_PIN2 2U |
||
| 158 | #define GPIOF_PIN3 3U |
||
| 159 | #define GPIOF_PIN4 4U |
||
| 160 | #define GPIOF_PIN5 5U |
||
| 161 | #define GPIOF_PIN6 6U |
||
| 162 | #define GPIOF_PIN7 7U |
||
| 163 | #define GPIOF_PIN8 8U |
||
| 164 | #define GPIOF_PIN9 9U |
||
| 165 | #define GPIOF_PIN10 10U |
||
| 166 | #define GPIOF_PIN11 11U |
||
| 167 | #define GPIOF_PIN12 12U |
||
| 168 | #define GPIOF_PIN13 13U |
||
| 169 | #define GPIOF_PIN14 14U |
||
| 170 | #define GPIOF_PIN15 15U |
||
| 171 | |||
| 172 | #define GPIOG_PIN0 0U |
||
| 173 | #define GPIOG_PIN1 1U |
||
| 174 | #define GPIOG_PIN2 2U |
||
| 175 | #define GPIOG_PIN3 3U |
||
| 176 | #define GPIOG_PIN4 4U |
||
| 177 | #define GPIOG_PIN5 5U |
||
| 178 | #define GPIOG_PIN6 6U |
||
| 179 | #define GPIOG_PIN7 7U |
||
| 180 | #define GPIOG_PIN8 8U |
||
| 181 | #define GPIOG_PIN9 9U |
||
| 182 | #define GPIOG_PIN10 10U |
||
| 183 | #define GPIOG_PIN11 11U |
||
| 184 | #define GPIOG_PIN12 12U |
||
| 185 | #define GPIOG_PIN13 13U |
||
| 186 | #define GPIOG_PIN14 14U |
||
| 187 | #define GPIOG_PIN15 15U |
||
| 188 | |||
| 189 | /*
|
||
| 190 | * IO lines assignments.
|
||
| 191 | */
|
||
| 192 | #define LINE_WKUP PAL_LINE(GPIOA, GPIOA_WKUP)
|
||
| 193 | #define LINE_LED PAL_LINE(GPIOA, GPIOA_LED)
|
||
| 194 | #define LINE_DRIVE_PWM1A PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1A)
|
||
| 195 | #define LINE_DRIVE_PWM1B PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1B)
|
||
| 196 | #define LINE_MOTION_SCLK PAL_LINE(GPIOA, GPIOA_MOTION_SCLK)
|
||
| 197 | #define LINE_MOTION_MISO PAL_LINE(GPIOA, GPIOA_MOTION_MISO)
|
||
| 198 | #define LINE_MOTION_MOSI PAL_LINE(GPIOA, GPIOA_MOTION_MOSI)
|
||
| 199 | #define LINE_PROG_RX PAL_LINE(GPIOA, GPIOA_PROG_RX)
|
||
| 200 | #define LINE_PROG_TX PAL_LINE(GPIOA, GPIOA_PROG_TX)
|
||
| 201 | #define LINE_CAN_RX PAL_LINE(GPIOA, GPIOA_CAN_RX)
|
||
| 202 | #define LINE_CAN_TX PAL_LINE(GPIOA, GPIOA_CAN_TX)
|
||
| 203 | #define LINE_SWDIO PAL_LINE(GPIOA, GPIOA_SWDIO)
|
||
| 204 | #define LINE_SWCLK PAL_LINE(GPIOA, GPIOA_SWCLK)
|
||
| 205 | #define LINE_DRIVE_PWM2B PAL_LINE(GPIOA, GPIOA_DRIVE_PWM2B)
|
||
| 206 | |||
| 207 | #define LINE_DRIVE_SENSE2 PAL_LINE(GPIOB, GPIOB_DRIVE_SENSE2)
|
||
| 208 | #define LINE_POWER_EN PAL_LINE(GPIOB, GPIOB_POWER_EN)
|
||
| 209 | #define LINE_DRIVE_PWM2A PAL_LINE(GPIOB, GPIOB_DRIVE_PWM2A)
|
||
| 210 | #define LINE_COMPASS_DRDY PAL_LINE(GPIOB, GPIOB_COMPASS_DRDY)
|
||
| 211 | #define LINE_DRIVE_ENC1A PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1A)
|
||
| 212 | #define LINE_DRIVE_ENC1B PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1B)
|
||
| 213 | #define LINE_COMPASS_SCL PAL_LINE(GPIOB, GPIOB_COMPASS_SCL)
|
||
| 214 | #define LINE_COMPASS_SDA PAL_LINE(GPIOB, GPIOB_COMPASS_SDA)
|
||
| 215 | #define LINE_IR_SCL PAL_LINE(GPIOB, GPIOB_IR_SCL)
|
||
| 216 | #define LINE_IR_SDA PAL_LINE(GPIOB, GPIOB_IR_SDA)
|
||
| 217 | #define LINE_IR_INT PAL_LINE(GPIOB, GPIOB_IR_INT)
|
||
| 218 | #define LINE_GYRO_DRDY PAL_LINE(GPIOB, GPIOB_GYRO_DRDY)
|
||
| 219 | #define LINE_SYS_UART_UP PAL_LINE(GPIOB, GPIOB_SYS_UART_UP)
|
||
| 220 | #define LINE_ACCEL_INT_N PAL_LINE(GPIOB, GPIOB_ACCEL_INT_N)
|
||
| 221 | |||
| 222 | #define LINE_DRIVE_SENSE1 PAL_LINE(GPIOC, GPIOC_DRIVE_SENSE1)
|
||
| 223 | #define LINE_SYS_INT_N PAL_LINE(GPIOC, GPIOC_SYS_INT_N)
|
||
| 224 | #define LINE_PATH_DCSTAT PAL_LINE(GPIOC, GPIOC_PATH_DCSTAT)
|
||
| 225 | #define LINE_PATH_DCEN PAL_LINE(GPIOC, GPIOC_PATH_DCEN)
|
||
| 226 | #define LINE_DRIVE_EN |