|
| 1 | +/* |
| 2 | + ******************************************************************************* |
| 3 | + * Copyright (c) 2020-2021, STMicroelectronics |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * This software component is licensed by ST under BSD 3-Clause license, |
| 7 | + * the "License"; You may not use this file except in compliance with the |
| 8 | + * License. You may obtain a copy of the License at: |
| 9 | + * opensource.org/licenses/BSD-3-Clause |
| 10 | + * |
| 11 | + ******************************************************************************* |
| 12 | +*/ |
| 13 | +#pragma once |
| 14 | + |
| 15 | +/*---------------------------------------------------------------------------- |
| 16 | + * Pins |
| 17 | + *----------------------------------------------------------------------------*/ |
| 18 | + |
| 19 | +#define PG9 0 |
| 20 | +#define PG14 1 |
| 21 | +#define PF15 2 |
| 22 | +#define PE13 3 |
| 23 | +#define PF14 4 |
| 24 | +#define PE11 5 |
| 25 | +#define PE9 6 |
| 26 | +#define PF13 7 |
| 27 | +#define PF12 8 |
| 28 | +#define PD15 9 |
| 29 | +#define PD14 10 |
| 30 | +#define PA7 PIN_A10 |
| 31 | +#define PA6 PIN_A11 |
| 32 | +#define PA5 PIN_A12 |
| 33 | +#define PB9 14 |
| 34 | +#define PB8 15 |
| 35 | +#define PC6 16 |
| 36 | +#define PB15 17 |
| 37 | +#define PB13 18 |
| 38 | +#define PB12 19 |
| 39 | +#define PA15 20 |
| 40 | +#define PC7 21 |
| 41 | +#define PB5 22 |
| 42 | +#define PB3 23 |
| 43 | +#define PA4 PIN_A13 |
| 44 | +#define PB4 25 |
| 45 | +#define PB6 26 |
| 46 | +#define PB2 27 |
| 47 | +#define PD13 28 |
| 48 | +#define PD12 29 |
| 49 | +#define PD11 30 |
| 50 | +#define PE2 31 |
| 51 | +#define PA0 PIN_A14 |
| 52 | +#define PB0 PIN_A23 // LED_GREEN |
| 53 | +#define PE0 34 |
| 54 | +#define PB11 35 |
| 55 | +#define PB10 36 |
| 56 | +#define PE15 37 |
| 57 | +#define PE14 38 |
| 58 | +#define PE12 39 |
| 59 | +#define PE10 40 |
| 60 | +#define PE7 41 |
| 61 | +#define PE8 42 |
| 62 | +#define PC8 43 |
| 63 | +#define PC9 44 |
| 64 | +#define PC10 45 |
| 65 | +#define PC11 46 |
| 66 | +#define PC12 47 |
| 67 | +#define PD2 48 |
| 68 | +#define PG2 49 |
| 69 | +#define PG3 50 |
| 70 | +#define PD7 51 |
| 71 | +#define PD6 52 |
| 72 | +#define PD5 53 |
| 73 | +#define PD4 54 |
| 74 | +#define PD3 55 |
| 75 | +// 56 is PE2 (31) |
| 76 | +#define PE4 57 |
| 77 | +#define PE5 58 |
| 78 | +#define PE6 59 |
| 79 | +#define PE3 60 |
| 80 | +#define PF8 PIN_A15 |
| 81 | +#define PF7 PIN_A16 |
| 82 | +#define PF9 PIN_A17 |
| 83 | +#define PG1 64 |
| 84 | +#define PG0 65 |
| 85 | +#define PD1 66 |
| 86 | +#define PD0 67 |
| 87 | +#define PF0 68 |
| 88 | +#define PF1 69 |
| 89 | +#define PF2 70 |
| 90 | +// 71 is PA7 (11) |
| 91 | +// 72 is NC |
| 92 | +#define PB7 73 // LED_BLUE |
| 93 | +#define PB14 74 // LED_RED |
| 94 | +#define PC13 75 // USER_BTN |
| 95 | +#define PD9 76 // Serial Rx |
| 96 | +#define PD8 77 // Serial Tx |
| 97 | +#define PA3 PIN_A0 |
| 98 | +#define PC0 PIN_A1 |
| 99 | +#define PC3 PIN_A2 |
| 100 | +#define PF3 PIN_A3 |
| 101 | +#define PF5 PIN_A4 |
| 102 | +#define PF10 PIN_A5 |
| 103 | +#define PB1 PIN_A6 |
| 104 | +#define PC2 PIN_A7 |
| 105 | +#define PF4 PIN_A8 |
| 106 | +#define PF6 PIN_A9 |
| 107 | +// ST Morpho |
| 108 | +#define PA1 PIN_A18 |
| 109 | +#define PA2 PIN_A19 |
| 110 | +#define PA8 90 |
| 111 | +#define PA9 91 |
| 112 | +#define PA10 92 |
| 113 | +#define PA11 93 |
| 114 | +#define PA12 94 |
| 115 | +#define PA13 95 // SWD |
| 116 | +#define PA14 96 // SWD |
| 117 | +#define PC1 PIN_A20 |
| 118 | +#define PC4 PIN_A21 |
| 119 | +#define PC5 PIN_A22 |
| 120 | +#define PC14 100 |
| 121 | +#define PC15 101 |
| 122 | +#define PD10 102 |
| 123 | +#define PE1 103 |
| 124 | +#define PF11 104 |
| 125 | +#define PG4 105 |
| 126 | +#define PG5 106 |
| 127 | +#define PG6 107 |
| 128 | +#define PG7 108 |
| 129 | +#define PG8 109 |
| 130 | +#define PG10 110 |
| 131 | +#define PG11 111 |
| 132 | +#define PG12 112 |
| 133 | +#define PG13 113 |
| 134 | +#define PG15 114 |
| 135 | +#define PH0 115 // MCO |
| 136 | +#define PH1 116 |
| 137 | + |
| 138 | +// Alternate pins number |
| 139 | +#define PA0_ALT1 (PA0 | ALT1) |
| 140 | +#define PA0_ALT2 (PA0 | ALT2) |
| 141 | +#define PA1_ALT1 (PA1 | ALT1) |
| 142 | +#define PA1_ALT2 (PA1 | ALT2) |
| 143 | +#define PA2_ALT1 (PA2 | ALT1) |
| 144 | +#define PA2_ALT2 (PA2 | ALT2) |
| 145 | +#define PA3_ALT1 (PA3 | ALT1) |
| 146 | +#define PA3_ALT2 (PA3 | ALT2) |
| 147 | +#define PA4_ALT1 (PA4 | ALT1) |
| 148 | +#define PA5_ALT1 (PA5 | ALT1) |
| 149 | +#define PA6_ALT1 (PA6 | ALT1) |
| 150 | +#define PA7_ALT1 (PA7 | ALT1) |
| 151 | +#define PA7_ALT2 (PA7 | ALT2) |
| 152 | +#define PA7_ALT3 (PA7 | ALT3) |
| 153 | +#define PA15_ALT1 (PA15 | ALT1) |
| 154 | +#define PB0_ALT1 (PB0 | ALT1) |
| 155 | +#define PB0_ALT2 (PB0 | ALT2) |
| 156 | +#define PB1_ALT1 (PB1 | ALT1) |
| 157 | +#define PB1_ALT2 (PB1 | ALT2) |
| 158 | +#define PB3_ALT1 (PB3 | ALT1) |
| 159 | +#define PB4_ALT1 (PB4 | ALT1) |
| 160 | +#define PB5_ALT1 (PB5 | ALT1) |
| 161 | +#define PB8_ALT1 (PB8 | ALT1) |
| 162 | +#define PB9_ALT1 (PB9 | ALT1) |
| 163 | +#define PB14_ALT1 (PB14 | ALT1) |
| 164 | +#define PB14_ALT2 (PB14 | ALT2) |
| 165 | +#define PB15_ALT1 (PB15 | ALT1) |
| 166 | +#define PB15_ALT2 (PB15 | ALT2) |
| 167 | +#define PC0_ALT1 (PC0 | ALT1) |
| 168 | +#define PC0_ALT2 (PC0 | ALT2) |
| 169 | +#define PC1_ALT1 (PC1 | ALT1) |
| 170 | +#define PC1_ALT2 (PC1 | ALT2) |
| 171 | +#define PC2_ALT1 (PC2 | ALT1) |
| 172 | +#define PC2_ALT2 (PC2 | ALT2) |
| 173 | +#define PC3_ALT1 (PC3 | ALT1) |
| 174 | +#define PC3_ALT2 (PC3 | ALT2) |
| 175 | +#define PC4_ALT1 (PC4 | ALT1) |
| 176 | +#define PC5_ALT1 (PC5 | ALT1) |
| 177 | +#define PC6_ALT1 (PC6 | ALT1) |
| 178 | +#define PC7_ALT1 (PC7 | ALT1) |
| 179 | +#define PC8_ALT1 (PC8 | ALT1) |
| 180 | +#define PC9_ALT1 (PC9 | ALT1) |
| 181 | +#define PC10_ALT1 (PC10 | ALT1) |
| 182 | +#define PC11_ALT1 (PC11 | ALT1) |
| 183 | + |
| 184 | +// This must be a literal |
| 185 | +#define NUM_DIGITAL_PINS 117 |
| 186 | +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS |
| 187 | +#define NUM_ANALOG_INPUTS 24 |
| 188 | + |
| 189 | +// On-board LED pin number |
| 190 | +#ifndef LED_BUILTIN |
| 191 | + #define LED_BUILTIN PB0 |
| 192 | +#endif |
| 193 | +#define LED_GREEN LED_BUILTIN |
| 194 | +#define LED_BLUE PB7 |
| 195 | +#define LED_RED PB14 |
| 196 | + |
| 197 | +// On-board user button |
| 198 | +#ifndef USER_BTN |
| 199 | + #define USER_BTN PC13 |
| 200 | +#endif |
| 201 | + |
| 202 | +// Timer Definitions |
| 203 | +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin |
| 204 | +#ifndef TIMER_TONE |
| 205 | + #define TIMER_TONE TIM6 |
| 206 | +#endif |
| 207 | +#ifndef TIMER_SERVO |
| 208 | + #define TIMER_SERVO TIM7 |
| 209 | +#endif |
| 210 | + |
| 211 | +// UART Definitions |
| 212 | +#ifndef SERIAL_UART_INSTANCE |
| 213 | + #define SERIAL_UART_INSTANCE 3 //Connected to ST-Link |
| 214 | +#endif |
| 215 | +// Serial pin used for console (ex: stlink) |
| 216 | +// Rerquired by Firmata |
| 217 | +#ifndef PIN_SERIAL_RX |
| 218 | + #define PIN_SERIAL_RX PD9 |
| 219 | +#endif |
| 220 | +#ifndef PIN_SERIAL_TX |
| 221 | + #define PIN_SERIAL_TX PD8 |
| 222 | +#endif |
| 223 | + |
| 224 | +// Value of the External oscillator in Hz |
| 225 | +#define HSE_VALUE 8000000U |
| 226 | + |
| 227 | +/* Extra HAL modules */ |
| 228 | +#if !defined(HAL_DAC_MODULE_DISABLED) |
| 229 | + #define HAL_DAC_MODULE_ENABLED |
| 230 | +#endif |
| 231 | +#if !defined(HAL_ETH_MODULE_DISABLED) |
| 232 | + #define HAL_ETH_MODULE_ENABLED |
| 233 | +#endif |
| 234 | +#if !defined(HAL_QSPI_MODULE_DISABLED) |
| 235 | + #define HAL_QSPI_MODULE_ENABLED |
| 236 | +#endif |
| 237 | +#if !defined(HAL_SD_MODULE_DISABLED) |
| 238 | + #define HAL_SD_MODULE_ENABLED |
| 239 | +#endif |
| 240 | + |
| 241 | +// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration. |
| 242 | +// By default 2MB single bank |
| 243 | +#define FLASH_BASE_ADDRESS 0x081C0000 |
| 244 | +#define FLASH_DATA_SECTOR 11 |
| 245 | + |
| 246 | +/*---------------------------------------------------------------------------- |
| 247 | + * Arduino objects - C++ only |
| 248 | + *----------------------------------------------------------------------------*/ |
| 249 | + |
| 250 | +#ifdef __cplusplus |
| 251 | + // These serial port names are intended to allow libraries and architecture-neutral |
| 252 | + // sketches to automatically default to the correct port name for a particular type |
| 253 | + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 254 | + // the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 255 | + // |
| 256 | + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 257 | + // |
| 258 | + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 259 | + // |
| 260 | + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 261 | + // |
| 262 | + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 263 | + // |
| 264 | + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 265 | + // pins are NOT connected to anything by default. |
| 266 | + #ifndef SERIAL_PORT_MONITOR |
| 267 | + #define SERIAL_PORT_MONITOR Serial |
| 268 | + #endif |
| 269 | + #ifndef SERIAL_PORT_HARDWARE |
| 270 | + // KH mod to add Serial1, for ESP-AT |
| 271 | + //#define SERIAL_PORT_HARDWARE Serial |
| 272 | + #define SERIAL_PORT_HARDWARE Serial1 |
| 273 | + #endif |
| 274 | +#endif |
0 commit comments