|
1 | 1 | /*
|
| 2 | + ******************************************************************************* |
| 3 | + * Copyright (c) 2017, STMicroelectronics |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Redistribution and use in source and binary forms, with or without |
| 7 | + * modification, are permitted provided that the following conditions are met: |
| 8 | + * |
| 9 | + * 1. Redistributions of source code must retain the above copyright notice, |
| 10 | + * this list of conditions and the following disclaimer. |
| 11 | + * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | + * this list of conditions and the following disclaimer in the documentation |
| 13 | + * and/or other materials provided with the distribution. |
| 14 | + * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| 15 | + * may be used to endorse or promote products derived from this software |
| 16 | + * without specific prior written permission. |
| 17 | + * |
| 18 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 22 | + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 24 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 25 | + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 | + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | + ******************************************************************************* |
| 29 | + */ |
| 30 | + |
| 31 | +#ifndef _VARIANT_ARDUINO_STM32_ |
| 32 | +#define _VARIANT_ARDUINO_STM32_ |
| 33 | + |
| 34 | +#ifdef __cplusplus |
| 35 | +extern "C" { |
| 36 | +#endif // __cplusplus |
| 37 | + |
| 38 | +#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ |
| 39 | + |
| 40 | +/*---------------------------------------------------------------------------- |
| 41 | + * Pins |
| 42 | + *----------------------------------------------------------------------------*/ |
| 43 | + |
| 44 | +#define PG9 0 |
| 45 | +#define PG14 1 |
| 46 | +#define PF15 2 |
| 47 | +#define PE13 3 |
| 48 | +#define PF14 4 |
| 49 | +#define PE11 5 |
| 50 | +#define PE9 6 |
| 51 | +#define PF13 7 |
| 52 | +#define PF12 8 |
| 53 | +#define PD15 9 |
| 54 | +#define PD14 10 |
| 55 | +#define PA7 A10 |
| 56 | +#define PA6 A11 |
| 57 | +#define PA5 A12 |
| 58 | +#define PB9 14 |
| 59 | +#define PB8 15 |
| 60 | +#define PC6 16 |
| 61 | +#define PB15 17 |
| 62 | +#define PB13 18 |
| 63 | +#define PB12 19 |
| 64 | +#define PA15 20 |
| 65 | +#define PC7 21 |
| 66 | +#define PB5 22 |
| 67 | +#define PB3 23 |
| 68 | +#define PA4 A13 |
| 69 | +#define PB4 25 |
| 70 | +#define PB6 26 |
| 71 | +#define PB2 27 |
| 72 | +#define PD13 28 |
| 73 | +#define PD12 29 |
| 74 | +#define PD11 30 |
| 75 | +#define PE2 31 |
| 76 | +#define PA0 A14 |
| 77 | +#define PB0 33 // LED1 |
| 78 | +#define PE0 34 |
| 79 | +#define PB11 35 |
| 80 | +#define PB10 36 |
| 81 | +#define PE15 37 |
| 82 | +#define PE14 38 |
| 83 | +#define PE12 39 |
| 84 | +#define PE10 40 |
| 85 | +#define PE7 41 |
| 86 | +#define PE8 42 |
| 87 | +#define PC8 43 |
| 88 | +#define PC9 44 |
| 89 | +#define PC10 45 |
| 90 | +#define PC11 46 |
| 91 | +#define PC12 47 |
| 92 | +#define PD2 48 |
| 93 | +#define PG2 49 |
| 94 | +#define PG3 50 |
| 95 | +#define PD7 51 |
| 96 | +#define PD6 52 |
| 97 | +#define PD5 53 |
| 98 | +#define PD4 54 |
| 99 | +#define PD3 55 |
| 100 | +// 56 is PE2 (31) |
| 101 | +#define PE4 57 |
| 102 | +#define PE5 58 |
| 103 | +#define PE6 59 |
| 104 | +#define PE3 60 |
| 105 | +#define PF8 A15 |
| 106 | +#define PF7 A16 |
| 107 | +#define PF9 A17 |
| 108 | +#define PG1 64 |
| 109 | +#define PG0 65 |
| 110 | +#define PD1 66 |
| 111 | +#define PD0 67 |
| 112 | +#define PF0 68 |
| 113 | +#define PF1 69 |
| 114 | +#define PF2 70 |
| 115 | +// 71 is PA7 (11) |
| 116 | +// 72 is NC/* |
2 | 117 | Copyright (c) 2011 Arduino. All right reserved.
|
3 | 118 |
|
4 | 119 | This library is free software; you can redistribute it and/or
|
|
23 | 138 | extern "C" {
|
24 | 139 | #endif // __cplusplus
|
25 | 140 |
|
| 141 | +#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ |
| 142 | + |
26 | 143 | /*----------------------------------------------------------------------------
|
27 | 144 | * Pins
|
28 | 145 | *----------------------------------------------------------------------------*/
|
@@ -181,3 +298,134 @@ extern "C" {
|
181 | 298 | #endif
|
182 | 299 |
|
183 | 300 | #endif /* _VARIANT_ARDUINO_STM32_ */
|
| 301 | + |
| 302 | +#define PA3 A0 |
| 303 | +#define PC0 A1 |
| 304 | +#define PC3 A2 |
| 305 | +#define PF3 A3 |
| 306 | +#define PF5 A4 |
| 307 | +#define PF10 A5 |
| 308 | +#define PB1 A6 |
| 309 | +#define PC2 A7 |
| 310 | +#define PF4 A8 |
| 311 | +#define PF6 A9 |
| 312 | + |
| 313 | +// This must be a literal |
| 314 | +#define NUM_DIGITAL_PINS 88 |
| 315 | +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS |
| 316 | +#define NUM_ANALOG_INPUTS 18 |
| 317 | + |
| 318 | +// On-board LED pin number |
| 319 | +#define LED_BUILTIN PB0 |
| 320 | +#define LED_GREEN LED_BUILTIN |
| 321 | +#define LED_BLUE PB7 |
| 322 | +#define LED_RED PB14 |
| 323 | + |
| 324 | +// On-board user button |
| 325 | +#define USER_BTN PC13 |
| 326 | + |
| 327 | +// Timer Definitions |
| 328 | +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin |
| 329 | +#define TIMER_TONE TIM6 |
| 330 | +#define TIMER_SERVO TIM7 |
| 331 | + |
| 332 | +// UART Definitions |
| 333 | +#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link |
| 334 | +// Default pin used for 'Serial' instance (ex: ST-Link) |
| 335 | +// Mandatory for Firmata |
| 336 | +#define PIN_SERIAL_RX PD9 |
| 337 | +#define PIN_SERIAL_TX PD8 |
| 338 | + |
| 339 | +// Below SPI and I2C definitions already done in the core |
| 340 | +// Could be redefined here if differs from the default one |
| 341 | +// SPI Definitions |
| 342 | +#define PIN_SPI_SS PD14 // 10 - Default for Arduino connector compatibility |
| 343 | +#define PIN_SPI_MOSI PA7 // 11 - Default for Arduino connector compatibility |
| 344 | +#define PIN_SPI_MISO PA6 // 12 - Default for Arduino connector compatibility |
| 345 | +#define PIN_SPI_SCK PA5 // 13 - Default for Arduino connector compatibility |
| 346 | + |
| 347 | +// I2C Definitions |
| 348 | +#define PIN_WIRE_SDA PB9 // 14 - Default for Arduino connector compatibility |
| 349 | +#define PIN_WIRE_SCL PB8 // 15 - Default for Arduino connector compatibility |
| 350 | + |
| 351 | +/* Extra HAL modules */ |
| 352 | +#define HAL_MODULE_ENABLED |
| 353 | + |
| 354 | +/* #define HAL_ADC_MODULE_ENABLED */ |
| 355 | +/* #define HAL_CRYP_MODULE_ENABLED */ |
| 356 | +/* #define HAL_CAN_MODULE_ENABLED */ |
| 357 | +/* #define HAL_CEC_MODULE_ENABLED */ |
| 358 | +/* #define HAL_CRC_MODULE_ENABLED */ |
| 359 | +/* #define HAL_CRYP_MODULE_ENABLED */ |
| 360 | +/* #define HAL_DAC_MODULE_ENABLED */ |
| 361 | +/* #define HAL_DCMI_MODULE_ENABLED */ |
| 362 | +/* #define HAL_DMA2D_MODULE_ENABLED */ |
| 363 | +#define HAL_ETH_MODULE_ENABLED |
| 364 | +/* #define HAL_NAND_MODULE_ENABLED */ |
| 365 | +/* #define HAL_NOR_MODULE_ENABLED */ |
| 366 | +/* #define HAL_SRAM_MODULE_ENABLED */ |
| 367 | +/* #define HAL_SDRAM_MODULE_ENABLED */ |
| 368 | +/* #define HAL_HASH_MODULE_ENABLED */ |
| 369 | +/* #define HAL_I2S_MODULE_ENABLED */ |
| 370 | +/* #define HAL_IWDG_MODULE_ENABLED */ |
| 371 | +/* #define HAL_LPTIM_MODULE_ENABLED */ |
| 372 | +/* #define HAL_LTDC_MODULE_ENABLED */ |
| 373 | +/* #define HAL_QSPI_MODULE_ENABLED */ |
| 374 | +/* #define HAL_RNG_MODULE_ENABLED */ |
| 375 | +/* #define HAL_RTC_MODULE_ENABLED */ |
| 376 | +/* #define HAL_SAI_MODULE_ENABLED */ |
| 377 | +/* #define HAL_SD_MODULE_ENABLED */ |
| 378 | +/* #define HAL_MMC_MODULE_ENABLED */ |
| 379 | +/* #define HAL_SPDIFRX_MODULE_ENABLED */ |
| 380 | +#define HAL_SPI_MODULE_ENABLED |
| 381 | +/* #define HAL_TIM_MODULE_ENABLED */ |
| 382 | +#define HAL_UART_MODULE_ENABLED |
| 383 | +/* #define HAL_USART_MODULE_ENABLED */ |
| 384 | +/* #define HAL_IRDA_MODULE_ENABLED */ |
| 385 | +/* #define HAL_SMARTCARD_MODULE_ENABLED */ |
| 386 | +/* #define HAL_WWDG_MODULE_ENABLED */ |
| 387 | +#define HAL_PCD_MODULE_ENABLED |
| 388 | +/* #define HAL_HCD_MODULE_ENABLED */ |
| 389 | +/* #define HAL_DFSDM_MODULE_ENABLED */ |
| 390 | +/* #define HAL_DSI_MODULE_ENABLED */ |
| 391 | +/* #define HAL_JPEG_MODULE_ENABLED */ |
| 392 | +/* #define HAL_MDIOS_MODULE_ENABLED */ |
| 393 | +/* #define HAL_SMBUS_MODULE_ENABLED */ |
| 394 | +/* #define HAL_EXTI_MODULE_ENABLED */ |
| 395 | +#define HAL_GPIO_MODULE_ENABLED |
| 396 | +#define HAL_EXTI_MODULE_ENABLED |
| 397 | +#define HAL_DMA_MODULE_ENABLED |
| 398 | +#define HAL_RCC_MODULE_ENABLED |
| 399 | +#define HAL_FLASH_MODULE_ENABLED |
| 400 | +#define HAL_PWR_MODULE_ENABLED |
| 401 | +#define HAL_I2C_MODULE_ENABLED |
| 402 | +#define HAL_CORTEX_MODULE_ENABLED |
| 403 | + |
| 404 | +#ifdef __cplusplus |
| 405 | +} // extern "C" |
| 406 | +#endif |
| 407 | +/*---------------------------------------------------------------------------- |
| 408 | + * Arduino objects - C++ only |
| 409 | + *----------------------------------------------------------------------------*/ |
| 410 | + |
| 411 | +#ifdef __cplusplus |
| 412 | +// These serial port names are intended to allow libraries and architecture-neutral |
| 413 | +// sketches to automatically default to the correct port name for a particular type |
| 414 | +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 415 | +// the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 416 | +// |
| 417 | +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 418 | +// |
| 419 | +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 420 | +// |
| 421 | +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 422 | +// |
| 423 | +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 424 | +// |
| 425 | +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 426 | +// pins are NOT connected to anything by default. |
| 427 | +#define SERIAL_PORT_MONITOR Serial |
| 428 | +#define SERIAL_PORT_HARDWARE Serial |
| 429 | +#endif |
| 430 | + |
| 431 | +#endif /* _VARIANT_ARDUINO_STM32_ */ |
0 commit comments