Add support for setting Source and Target sysID (#2886)
[ExpressLRS.git] / src / variants / R9MM / variant_R9MM.h
blobab92d6169f2152101a771844de74635c763ec6c9
1 /*
2 Copyright (c) 2011 Arduino. All right reserved.
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.
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.
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
19 #ifndef _VARIANT_ARDUINO_STM32_
20 #define _VARIANT_ARDUINO_STM32_
22 #ifdef __cplusplus
23 extern "C" {
24 #endif // __cplusplus
26 /*----------------------------------------------------------------------------
27 * Pins
28 *----------------------------------------------------------------------------*/
30 #define PA3 0
31 #define PA2 1
32 #define PA10 2
33 #define PB3 3
34 #define PB5 4
35 #define PB4 5
36 #define PB10 6
37 #define PA8 7
38 #define PA9 8
39 #define PC7 9
40 #define PB6 10
41 #define PA7 11 // A6
42 #define PA6 12 // A7
43 #define PA5 13 // A8 - LED
44 #define PB9 14
45 #define PB8 15
46 // ST Morpho
47 // CN7 Left Side
48 #define PC10 16
49 #define PC12 17
50 // 18 is NC - BOOT0
51 #define PA13 19 // SWD
52 #define PA14 20 // SWD
53 #define PA15 21
54 #define PB7 22
55 #define PC13 23
56 #define PC14 24
57 #define PC15 25
58 #define PD0 26
59 #define PD1 27
60 #define PC2 28 // A9
61 #define PC3 29 // A10
62 // CN7 Right Side
63 #define PC11 30
64 #define PD2 31
65 // CN10 Left Side
66 #define PC9 32
67 // CN10 Right side
68 #define PC8 33
69 #define PC6 34
70 #define PC5 35 // A13
71 #define PA12 36
72 #define PA11 37
73 #define PB12 38
74 #define PB11 39
75 #define PB2 40
76 #define PB1 41 // A11
77 #define PB15 42
78 #define PB14 43
79 #define PB13 44
80 #define PC4 45 // A12
81 #define PA0 46 // A0
82 #define PA1 47 // A1
83 #define PA4 48 // A2
84 #define PB0 49 // A3
85 #define PC1 50 // A4
86 #define PC0 51 // A5
88 // This must be a literal
89 #define NUM_DIGITAL_PINS 60
90 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
91 #define NUM_ANALOG_INPUTS 14
92 #define NUM_ANALOG_FIRST 46
94 // On-board LED pin number
95 #define LED_BUILTIN 13
96 #define LED_GREEN LED_BUILTIN
98 // On-board user button
99 #define USER_BTN PC13
101 // Timer Definitions
102 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
103 #define TIMER_TONE TIM3
104 #define TIMER_SERVO TIM4
106 // UART Definitions
107 #define SERIAL_UART_INSTANCE 1 //Connected to ST-Link
108 // Default pin used for 'Serial' instance (ex: ST-Link)
109 // Mandatory for Firmata
110 #define PIN_SERIAL_RX 0
111 #define PIN_SERIAL_TX 1
112 //#define PIN_SERIAL_RX PA10
113 //#define PIN_SERIAL_TX PA9
115 // Adjust IRQ priority
116 #define TIM_IRQ_PRIO 4
117 #define EXTI_IRQ_PRIO 4
119 #ifdef __cplusplus
120 } // extern "C"
121 #endif
122 /*----------------------------------------------------------------------------
123 * Arduino objects - C++ only
124 *----------------------------------------------------------------------------*/
126 #ifdef __cplusplus
127 // These serial port names are intended to allow libraries and architecture-neutral
128 // sketches to automatically default to the correct port name for a particular type
129 // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
130 // the first hardware serial port whose RX/TX pins are not dedicated to another use.
132 // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
134 // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
136 // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
138 // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
140 // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
141 // pins are NOT connected to anything by default.
142 #define SERIAL_PORT_MONITOR Serial
143 #define SERIAL_PORT_HARDWARE Serial
144 #endif
146 #endif /* _VARIANT_ARDUINO_STM32_ */