makes GPIO_PIN_RST optional for the sx1276
[ExpressLRS.git] / src / variants / GHOST_TX / variant_GHOST_TX.h
blobb429560f9d222b000fa7548d3b1660d501bc6e47
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 // USB connector on the top, MCU side
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
52 #define PA11 9
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
60 #define PC13 17
61 #define PC14 18
62 #define PC15 19
63 #define PA0 20
64 #define PA1 21
65 #define PA2 22
66 #define PA3 23
67 #define PA4 24
68 #define PA5 25
69 #define PA6 26
70 #define PA7 27
71 #define PB0 28
72 #define PB1 29
73 #define PB10 30
74 #define PB11 31
75 #define PB2 32
76 #define PA13 33
77 #define PA14 34
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
86 #define LED_RED PB4
87 #define LED_BLUE PB5
88 #define LED_BUILTIN LED_BLUE
90 // SPI Definitions
91 #define PIN_SPI_SS PA4
92 #define PIN_SPI_MOSI PA7
93 #define PIN_SPI_MISO PA6
94 #define PIN_SPI_SCK PA5
96 // I2C Definitions
97 #define PIN_WIRE_SDA PA10
98 #define PIN_WIRE_SCL PA9
100 // Timer Definitions
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
106 // UART Definitions
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
120 #ifdef __cplusplus
121 } // extern "C"
122 #endif
123 /*----------------------------------------------------------------------------
124 * Arduino objects - C++ only
125 *----------------------------------------------------------------------------*/
127 #ifdef __cplusplus
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
145 #endif
147 #endif /* _VARIANT_ARDUINO_STM32_ */