Add missing wifi targets for some DIY modules (#1210)
[ExpressLRS.git] / src / variants / FM30 / variant.h
blob3ca070b209cf7ce9b3dcd50207b65735d55d8edf
1 /*
2 *******************************************************************************
3 * Copyright (c) 2018, STMicroelectronics
4 * All rights reserved.
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_
33 #ifdef __cplusplus
34 extern "C" {
35 #endif // __cplusplus
37 /*----------------------------------------------------------------------------
38 * Pins
39 *----------------------------------------------------------------------------*/
41 // Bluepill USB connector on the top, MCU side - Blackpill USB connector on bottom, MCU Side (pins are reversed vertically for Arduino Ananlog pin correct sequence.
42 // Left Side
43 #define PB9 0
44 #define PB8 1
45 #define PB7 2
46 #define PB6 3
47 #define PB5 4
48 #define PB4 5
49 #define PB3 6
50 #define PA15 7
51 #define PA12 8 // USB DP
52 #define PA11 9 // USB DM
53 #define PA10 10
54 #define PA9 11
55 #define PA8 12
56 #define PB15 13
57 #define PB14 14
58 #define PB13 15
59 #define PB12 16 // LED Blackpill
60 // Right side
61 #define PC13 17 // LED Bluepill
62 #define PC14 18
63 #define PC15 19
64 #define PA0 20 // A0
65 #define PA1 21 // A1
66 #define PA2 22 // A2
67 #define PA3 23 // A3
68 #define PA4 24 // A4
69 #define PA5 25 // A5
70 #define PA6 26 // A6
71 #define PA7 27 // A7
72 #define PB0 28 // A8
73 #define PB1 29 // A9
74 #define PB10 30
75 #define PB11 31
76 // Other
77 #define PB2 32 // BOOT1
78 #define PA13 33 // SWDI0
79 #define PA14 34 // SWCLK
81 // This must be a literal
82 #define NUM_DIGITAL_PINS 35
83 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
84 #define NUM_ANALOG_INPUTS 10
85 #define NUM_ANALOG_FIRST 20
87 // On-board LED pin number
88 #if defined(ARDUINO_BLUEPILL_F103C6) || defined(ARDUINO_BLUEPILL_F103C8) ||\
89 defined(ARDUINO_BLUEPILL_F103CB)
90 #define LED_BUILTIN PC13
91 #else
92 #ifndef LED_BUILTIN
93 // Default for Blackpill
94 #define LED_BUILTIN PB12
95 #endif
96 #endif
97 #define LED_GREEN LED_BUILTIN
99 // SPI Definitions
100 #define PIN_SPI_SS PA4
101 #define PIN_SPI_MOSI PA7
102 #define PIN_SPI_MISO PA6
103 #define PIN_SPI_SCK PA5
105 // I2C Definitions
106 #define PIN_WIRE_SDA PB7
107 #define PIN_WIRE_SCL PB6
109 // Timer Definitions
110 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
111 #define TIMER_TONE TIM3
112 #define TIMER_SERVO TIM2
114 // UART Definitions
115 #define SERIAL_UART_INSTANCE 1
116 // Default pin used for 'Serial' instance
117 // Mandatory for Firmata
118 #define PIN_SERIAL_RX PA10
119 #define PIN_SERIAL_TX PA9
121 // Adjust IRQ priority
122 #define TIM_IRQ_PRIO 4
123 #define EXTI_IRQ_PRIO 4
125 #ifdef __cplusplus
126 } // extern "C"
127 #endif
128 /*----------------------------------------------------------------------------
129 * Arduino objects - C++ only
130 *----------------------------------------------------------------------------*/
132 #ifdef __cplusplus
133 // These serial port names are intended to allow libraries and architecture-neutral
134 // sketches to automatically default to the correct port name for a particular type
135 // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
136 // the first hardware serial port whose RX/TX pins are not dedicated to another use.
138 // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
140 // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
142 // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
144 // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
146 // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
147 // pins are NOT connected to anything by default.
148 #define SERIAL_PORT_MONITOR Serial
149 #define SERIAL_PORT_HARDWARE Serial1
150 #endif
152 #endif /* _VARIANT_ARDUINO_STM32_ */