Add support for setting Source and Target sysID (#2886)
[ExpressLRS.git] / src / variants / r9mx / variant_R9MX.h
blob0366c8966a44bef771585ae0ec8aa93afef23d8c
1 /*
2 *******************************************************************************
3 * Copyright (c) 2019, STMicroelectronics
4 * All rights reserved.
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_
17 #ifdef __cplusplus
18 extern "C" {
19 #endif // __cplusplus
21 /*----------------------------------------------------------------------------
22 * Pins
23 *----------------------------------------------------------------------------*/
25 #define PA10 0 // SB33 ON / SB32 OFF
26 #define PA9 1 // SB35 ON / SB34 OFF
27 #define PA12 2
28 #define PB3 3
29 #define PB5 4
30 #define PA15 5
31 #define PB10 6
32 #define PC7 7
33 #define PB6 8
34 #define PA8 9
35 #define PA11 10
36 #define PB15 11
37 #define PB14 12
38 #define PB13 13 // LED
39 #define PB7 14
40 #define PB8 15
41 // ST Morpho
42 // CN5 Left Side
43 #define PC10 16
44 #define PC12 17
45 #define PB12 18
46 #define PA13 19
47 #define PA14 20
48 #define PC13 21 // User Button
49 #define PC14 22
50 #define PC15 23
51 #define PH0 24
52 #define PH1 25
53 #define PB4 26
54 #define PB9 27
55 // CN5 Right Side
56 #define PC11 28
57 #define PD2 29
58 // CN6 Left Side
59 #define PC9 30
60 // CN6 Right Side
61 #define PC8 31
62 #define PC6 32
63 #define PC5 33
64 #define PB0 A6
65 // #define PA10 35 - Already defined as 0 (SB33 ON / SB32 OFF)
66 // #define PA9 36 - Already defined as 1 (SB35 ON / SB34 OFF)
67 #define PB11 37
68 #define PB2 38
69 #define PB1 A7
70 #define PA7 A8
71 #define PA6 A9
72 #define PA5 A10
73 #define PA4 A11
74 #define PC4 44
75 #define PA3 45 // STLink Rx
76 #define PA2 46 // STLink Tx
77 #define PA0 A0
78 #define PA1 A1
79 #define PC3 A2
80 #define PC2 A3
81 #define PC1 A4
82 #define PC0 A5
84 // This must be a literal
85 #define NUM_DIGITAL_PINS 53
87 // This must be a literal
88 #define NUM_ANALOG_INPUTS 12
90 // On-board LED pin number
91 #define LED_BUILTIN PB13
92 #define LED_GREEN LED_BUILTIN
94 // On-board user button
95 #define USER_BTN PC13
97 // Timer Definitions (optional)
98 // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
99 #define TIMER_TONE TIM6
100 #define TIMER_SERVO TIM7
102 // UART Definitions
103 // Define here Serial instance number to map on Serial generic name
104 #define SERIAL_UART_INSTANCE 0
106 // Default pin used for 'Serial' instance (ex: ST-Link)
107 // Mandatory for Firmata
108 #define PIN_SERIAL_RX PA3
109 #define PIN_SERIAL_TX PA2
111 // Enable DAC
112 #define HAL_DAC_MODULE_ENABLED
114 // Adjust IRQ priority
115 #define TIM_IRQ_PRIO 4
116 #define EXTI_IRQ_PRIO 4
118 #ifdef __cplusplus
119 } // extern "C"
120 #endif
121 /*----------------------------------------------------------------------------
122 * Arduino objects - C++ only
123 *----------------------------------------------------------------------------*/
125 #ifdef __cplusplus
126 // These serial port names are intended to allow libraries and architecture-neutral
127 // sketches to automatically default to the correct port name for a particular type
128 // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
129 // the first hardware serial port whose RX/TX pins are not dedicated to another use.
131 // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
133 // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
135 // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
137 // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
139 // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
140 // pins are NOT connected to anything by default.
141 #define SERIAL_PORT_MONITOR Serial
142 #define SERIAL_PORT_HARDWARE Serial
143 #endif
145 #endif /* _VARIANT_ARDUINO_STM32_ */