Create release.yml
[betaflight.git] / src / main / target / WORMFC / target.h
blob6bc3ef1f85606307034b0c992af4ca268cc7d0fe
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #if defined(PIRXF4)
25 #define TARGET_BOARD_IDENTIFIER "PIRX"
26 #define USBD_PRODUCT_STRING "Pirx F4"
28 #else
30 #define TARGET_BOARD_IDENTIFIER "RRF4"
31 #define USBD_PRODUCT_STRING "Worm FC"
33 #endif
35 #define USE_TARGET_CONFIGURATION
37 //LEDs
38 #if defined(PIRXF4)
39 #define LED0_PIN PC13
40 #define LED1_PIN PC14
41 #else
42 #define LED0_PIN PA15
43 #define LED1_PIN PC14
44 #endif
46 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
48 //define camera control
49 #if defined(PIRXF4)
50 // XXX CAMERA_CONTROL_PIN is deprecated.
51 // XXX Target maintainer must create a valid timerHardware[] array entry for PA4 with TIM_USE_CAMERA_CONTROL
52 //#define CAMERA_CONTROL_PIN PA4
53 #endif
55 //BEEPER
56 #define USE_BEEPER
57 #if defined(PIRXF4)
58 #define BEEPER_PIN PA15
59 #else
60 #define BEEPER_PIN PB14
61 #endif
62 #define BEEPER_INVERTED
64 // MPU6500 interrupt
65 #define USE_EXTI
66 #if defined(PIRXF4)
67 #define GYRO_1_EXTI_PIN PC5
68 #else
69 #define GYRO_1_EXTI_PIN PC4
70 #endif
71 #define USE_MPU_DATA_READY_SIGNAL
73 #if defined(PIRXF4)
74 #define GYRO_1_CS_PIN PC4
75 #else
76 #define GYRO_1_CS_PIN PA4
77 #endif
78 #define GYRO_1_SPI_INSTANCE SPI1
80 // ACC section -- start
81 #define USE_ACC
82 #define USE_ACC_SPI_MPU6500
83 // ACC section -- end
85 // GYRO section -- start
86 #define USE_GYRO
87 #define USE_GYRO_SPI_MPU6500
88 #if defined(PIRXF4)
89 #define GYRO_1_ALIGN CW0_DEG
90 #else
91 #define GYRO_1_ALIGN CW180_DEG_FLIP
92 #endif
93 // GYRO section -- end
95 //BARO
96 #if !defined(PIRXF4)
97 #define USE_BARO
98 #define USE_BARO_SPI_LPS
99 #define BARO_SPI_INSTANCE SPI3
100 #define BARO_CS_PIN PB8
101 #endif
103 //UARTs
104 #if defined(PIRXF4)
105 #define INVERTER_PIN_UART6 PA8
106 #define INVERTER_PIN_UART3 PB1
107 #else
108 #define INVERTER_PIN_UART6 PB13
109 #define INVERTER_PIN_UART3 PB12
110 #endif
112 #define USE_VCP
113 #define USB_DETECT_PIN PA9
114 #define USE_USB_DETECT
116 #define USE_UART1
117 #define UART1_RX_PIN PB7
118 #define UART1_TX_PIN PB6
120 #if defined(PIRXF4)
121 #define USE_UART2
122 #define UART2_RX_PIN PA3
123 #define UART2_TX_PIN PA2
124 #endif
126 #define USE_UART3
127 #define UART3_RX_PIN PB11
128 #define UART3_TX_PIN PB10
130 #define USE_UART4
131 #define UART4_RX_PIN PA1
132 #define UART4_TX_PIN PA0
134 #define USE_UART6
135 #define UART6_RX_PIN PC7
136 #define UART6_TX_PIN PC6
138 #if defined(PIRXF4)
139 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART2, USART3, USART4, USART6
140 #else
141 #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART3, USART4, USART6
142 #endif
144 #define USE_ESCSERIAL
145 #define ESCSERIAL_TIMER_TX_PIN PB9
147 //SPI
148 #define USE_SPI
150 #define USE_SPI_DEVICE_1
152 #if defined(PIRXF4)
153 #define USE_SPI_DEVICE_2
154 #else
155 #define USE_SPI_DEVICE_3
156 #define SPI3_SCK_PIN PB3
157 #define SPI3_MISO_PIN PB4
158 #define SPI3_MOSI_PIN PB5
159 #endif
161 //OSD
162 #define USE_MAX7456
163 #if defined(PIRXF4)
164 #define MAX7456_SPI_INSTANCE SPI2
165 #define MAX7456_SPI_CS_PIN PB12
166 #else
167 #define MAX7456_SPI_INSTANCE SPI3
168 #define MAX7456_SPI_CS_PIN PC0
169 #endif
171 #define USE_ADC
172 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
173 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
174 #if defined(PIRXF4)
175 #define VBAT_ADC_PIN PC2
176 #define RSSI_ADC_PIN PC1
177 #define CURRENT_METER_ADC_PIN PC3
178 #else
179 #define VBAT_ADC_PIN PC1
180 #define CURRENT_METER_ADC_PIN PC2
181 #endif
183 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
184 #define SERIALRX_PROVIDER SERIALRX_SBUS
186 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
188 //SD CARD
189 #define USE_SDCARD
190 #define USE_SDCARD_SDIO
192 #define SDCARD_SDIO_DMA_OPT 0 // DMA 2 Stream 3 Channel 4
193 #define SDCARD_SPI_CS_PIN NONE //This is not used on SDIO, has to be kept for now to keep compiler happy
194 #if defined(PIRXF4)
195 #define SDCARD_DETECT_PIN PC15
196 #else
197 #define SDCARD_DETECT_PIN PB15
198 #endif
200 #define TARGET_IO_PORTA 0xffff
201 #define TARGET_IO_PORTB 0xffff
202 #define TARGET_IO_PORTC 0xffff
203 #define TARGET_IO_PORTD (BIT(2))
205 #define USABLE_TIMER_CHANNEL_COUNT 7
206 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )