2 *******************************************************************************
3 * Copyright (c) 2021, STMicroelectronics
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
11 *******************************************************************************
14 #ifndef _VARIANT_ARDUINO_STM32_
15 #define _VARIANT_ARDUINO_STM32_
20 /*----------------------------------------------------------------------------
22 *----------------------------------------------------------------------------*/
61 #define NUM_DIGITAL_PINS 37
62 #define NUM_ANALOG_INPUTS 9
65 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
67 #define TIMER_TONE TIM6
70 #define TIMER_SERVO TIM7
74 #ifndef SERIAL_UART_INSTANCE
75 #define SERIAL_UART_INSTANCE 1
78 // Default pin used for generic 'Serial' instance
79 // Mandatory for Firmata
81 #define PIN_SERIAL_RX PA10
84 #define PIN_SERIAL_TX PA9
88 //#define HAL_DAC_MODULE_ENABLED
90 #define ALT1 (1 << (STM_PIN_AFNUM_SHIFT+0))
91 #define ALT2 (1 << (STM_PIN_AFNUM_SHIFT+1))
92 #define ALT3 (1 << (STM_PIN_AFNUM_SHIFT+2))
93 #define ALT4 (1 << (STM_PIN_AFNUM_SHIFT+3))
95 // Adjust IRQ priority
96 #define TIM_IRQ_PRIO 4
97 #define EXTI_IRQ_PRIO 4
103 /*----------------------------------------------------------------------------
104 * Arduino objects - C++ only
105 *----------------------------------------------------------------------------*/
108 // These serial port names are intended to allow libraries and architecture-neutral
109 // sketches to automatically default to the correct port name for a particular type
110 // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
111 // the first hardware serial port whose RX/TX pins are not dedicated to another use.
113 // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
115 // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
117 // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
119 // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
121 // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
122 // pins are NOT connected to anything by default.
123 #define SERIAL_PORT_MONITOR Serial
124 #define SERIAL_PORT_HARDWARE Serial
127 #endif /* _VARIANT_ARDUINO_STM32_ */