|
| 1 | +/* |
| 2 | + Copyright (c) 2011 Arduino. All right reserved. |
| 3 | +
|
| 4 | + This library is free software; you can redistribute it and/or |
| 5 | + modify it under the terms of the GNU Lesser General Public |
| 6 | + License as published by the Free Software Foundation; either |
| 7 | + version 2.1 of the License, or (at your option) any later version. |
| 8 | +
|
| 9 | + This library is distributed in the hope that it will be useful, |
| 10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | + See the GNU Lesser General Public License for more details. |
| 13 | +
|
| 14 | + You should have received a copy of the GNU Lesser General Public |
| 15 | + License along with this library; if not, write to the Free Software |
| 16 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | +*/ |
| 18 | + |
| 19 | +#ifndef _VARIANT_ARDUINO_STM32_ |
| 20 | +#define _VARIANT_ARDUINO_STM32_ |
| 21 | + |
| 22 | +#ifdef __cplusplus |
| 23 | +extern "C" { |
| 24 | +#endif // __cplusplus |
| 25 | + |
| 26 | +/*---------------------------------------------------------------------------- |
| 27 | + * Pins |
| 28 | + *----------------------------------------------------------------------------*/ |
| 29 | + |
| 30 | +#define PG9 0 |
| 31 | +#define PG14 1 |
| 32 | +#define PF15 2 |
| 33 | +#define PE13 3 |
| 34 | +#define PF14 4 |
| 35 | +#define PE11 5 |
| 36 | +#define PE9 6 |
| 37 | +#define PF13 7 |
| 38 | +#define PF12 8 |
| 39 | +#define PD15 9 |
| 40 | +#define PD14 10 |
| 41 | +#define PA7 A10 |
| 42 | +#define PA6 A11 |
| 43 | +#define PA5 A12 |
| 44 | +#define PB9 14 |
| 45 | +#define PB8 15 |
| 46 | +#define PC6 16 |
| 47 | +#define PB15 17 |
| 48 | +#define PB13 18 |
| 49 | +#define PB12 19 |
| 50 | +#define PA15 20 |
| 51 | +#define PC7 21 |
| 52 | +#define PB5 22 |
| 53 | +#define PB3 23 |
| 54 | +#define PA4 A13 |
| 55 | +#define PB4 25 |
| 56 | +#define PB6 26 |
| 57 | +#define PB2 27 |
| 58 | +#define PD13 28 |
| 59 | +#define PD12 29 |
| 60 | +#define PD11 30 |
| 61 | +#define PE2 31 |
| 62 | +#define PA0 A14 |
| 63 | +#define PB0 33 // LED_GREEN |
| 64 | +#define PE0 34 |
| 65 | +#define PB11 35 |
| 66 | +#define PB10 36 |
| 67 | +#define PE15 37 |
| 68 | +#define PE14 38 |
| 69 | +#define PE12 39 |
| 70 | +#define PE10 40 |
| 71 | +#define PE7 41 |
| 72 | +#define PE8 42 |
| 73 | +#define PC8 43 |
| 74 | +#define PC9 44 |
| 75 | +#define PC10 45 |
| 76 | +#define PC11 46 |
| 77 | +#define PC12 47 |
| 78 | +#define PD2 48 |
| 79 | +#define PG2 49 |
| 80 | +#define PG3 50 |
| 81 | +#define PD7 51 |
| 82 | +#define PD6 52 |
| 83 | +#define PD5 53 |
| 84 | +#define PD4 54 |
| 85 | +#define PD3 55 |
| 86 | +// 56 is PE2 (31) |
| 87 | +#define PE4 57 |
| 88 | +#define PE5 58 |
| 89 | +#define PE6 59 |
| 90 | +#define PE3 60 |
| 91 | +#define PF8 A15 |
| 92 | +#define PF7 A16 |
| 93 | +#define PF9 A17 |
| 94 | +#define PG1 64 |
| 95 | +#define PG0 65 |
| 96 | +#define PD1 66 |
| 97 | +#define PD0 67 |
| 98 | +#define PF0 68 |
| 99 | +#define PF1 69 |
| 100 | +#define PF2 70 |
| 101 | +// 71 is PA7 (11) |
| 102 | +// 72 is NC |
| 103 | +#define PB7 73 // LED_BLUE |
| 104 | +#define PB14 74 // LED_RED |
| 105 | +#define PC13 75 // USER_BTN |
| 106 | +#define PD9 76 // Serial Rx |
| 107 | +#define PD8 77 // Serial Tx |
| 108 | +#define PA3 A0 |
| 109 | +#define PC0 A1 |
| 110 | +#define PC3 A2 |
| 111 | +#define PF3 A3 |
| 112 | +#define PF5 A4 |
| 113 | +#define PF10 A5 |
| 114 | +#define PB1 A6 |
| 115 | +#define PC2 A7 |
| 116 | +#define PF4 A8 |
| 117 | +#define PF6 A9 |
| 118 | + |
| 119 | +// This must be a literal |
| 120 | +#define NUM_DIGITAL_PINS 88 |
| 121 | +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS |
| 122 | +#define NUM_ANALOG_INPUTS 18 |
| 123 | + |
| 124 | +// On-board LED pin number |
| 125 | +#define LED_BUILTIN PB0 |
| 126 | +#define LED_GREEN LED_BUILTIN |
| 127 | +#define LED_BLUE PB7 |
| 128 | +#define LED_RED PB14 |
| 129 | + |
| 130 | +// On-board user button |
| 131 | +#define USER_BTN PC13 |
| 132 | + |
| 133 | +// Timer Definitions |
| 134 | +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin |
| 135 | +#define TIMER_TONE TIM6 |
| 136 | +#define TIMER_SERVO TIM7 |
| 137 | + |
| 138 | +// UART Definitions |
| 139 | +#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link |
| 140 | + |
| 141 | +// Serial pin used for console (ex: stlink) |
| 142 | +// Rerquired by Firmata |
| 143 | +#define PIN_SERIAL_RX PD9 |
| 144 | +#define PIN_SERIAL_TX PD8 |
| 145 | + |
| 146 | +/* Extra HAL modules */ |
| 147 | +#define HAL_DAC_MODULE_ENABLED |
| 148 | +#define HAL_ETH_MODULE_ENABLED |
| 149 | + |
| 150 | +// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration. |
| 151 | +// By default 2MB single bank |
| 152 | +#define FLASH_BASE_ADDRESS 0x081C0000 |
| 153 | +#define FLASH_DATA_SECTOR 11 |
| 154 | + |
| 155 | +#ifdef __cplusplus |
| 156 | +} // extern "C" |
| 157 | +#endif |
| 158 | +/*---------------------------------------------------------------------------- |
| 159 | + * Arduino objects - C++ only |
| 160 | + *----------------------------------------------------------------------------*/ |
| 161 | + |
| 162 | +#ifdef __cplusplus |
| 163 | + // These serial port names are intended to allow libraries and architecture-neutral |
| 164 | + // sketches to automatically default to the correct port name for a particular type |
| 165 | + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 166 | + // the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 167 | + // |
| 168 | + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 169 | + // |
| 170 | + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 171 | + // |
| 172 | + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 173 | + // |
| 174 | + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 175 | + // |
| 176 | + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 177 | + // pins are NOT connected to anything by default. |
| 178 | + #define SERIAL_PORT_MONITOR Serial |
| 179 | + |
| 180 | + // KH mod to add Serial1, for ESP-AT |
| 181 | + //#define SERIAL_PORT_HARDWARE Serial |
| 182 | + #define SERIAL_PORT_HARDWARE Serial1 |
| 183 | +#endif |
| 184 | + |
| 185 | +#endif /* _VARIANT_ARDUINO_STM32_ */ |
0 commit comments