2 *******************************************************************************
3 * Copyright (c) 2018, STMicroelectronics
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
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.
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 *******************************************************************************
30 #ifndef _VARIANT_ARDUINO_STM32_
31 #define _VARIANT_ARDUINO_STM32_
37 /*----------------------------------------------------------------------------
39 *----------------------------------------------------------------------------*/
41 // USB connector on the top, MCU side
79 // This must be a literal
80 #define NUM_DIGITAL_PINS 35
81 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
82 #define NUM_ANALOG_INPUTS 10
83 #define NUM_ANALOG_FIRST 20
85 // On-board LED pin number
88 #define LED_BUILTIN LED_BLUE
91 #define PIN_SPI_SS PA4
92 #define PIN_SPI_MOSI PA7
93 #define PIN_SPI_MISO PA6
94 #define PIN_SPI_SCK PA5
97 #define PIN_WIRE_SDA PA10
98 #define PIN_WIRE_SCL PA9
101 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
102 #define TIMER_TONE TIM6
104 #define TIMER_SERVO TIM7
107 #define SERIAL_UART_INSTANCE 3
108 // Default pin used for 'Serial' instance
109 // Mandatory for Firmata
110 #define PIN_SERIAL_RX PB11
111 #define PIN_SERIAL_TX PB10
113 // Adjust IRQ priority
114 #define TIM_IRQ_PRIO 4
115 #define EXTI_IRQ_PRIO 4
117 /* Extra HAL modules */
118 #define HAL_DAC_MODULE_ENABLED
123 /*----------------------------------------------------------------------------
124 * Arduino objects - C++ only
125 *----------------------------------------------------------------------------*/
128 // These serial port names are intended to allow libraries and architecture-neutral
129 // sketches to automatically default to the correct port name for a particular type
130 // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
131 // the first hardware serial port whose RX/TX pins are not dedicated to another use.
133 // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
135 // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
137 // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
139 // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
141 // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
142 // pins are NOT connected to anything by default.
143 #define SERIAL_PORT_MONITOR Serial
144 #define SERIAL_PORT_HARDWARE Serial3
147 #endif /* _VARIANT_ARDUINO_STM32_ */