Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / target / BETAFPVF435 / target.h
blobfa025b9d7fd1451a29e399b74b20d4a9df4a1e11
1 /*
2 * This file is part of INAV.
4 * INAV 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 * INAV 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/>.
20 //https://www.arterychip.com/download/DS/DS_AT32F435_437_V2.02-EN.pdf
21 #pragma once
23 #define TARGET_BOARD_IDENTIFIER "BHER"
24 #define USBD_PRODUCT_STRING "BETAFPVF435"
26 #define LED0 PB5
28 #define USE_BEEPER
29 #define BEEPER PB4
30 #define BEEPER_INVERTED
32 //#define ENABLE_DSHOT_DMAR DSHOT_DMAR_AUTO
33 //#define DSHOT_BITBANG_DEFAULT DSHOT_BITBANG_AUTO
34 #define ENABLE_DSHOT
36 // *************** Gyro & ACC **********************
37 #define USE_SPI
38 #define USE_SPI_DEVICE_1
40 #define SPI1_SCK_PIN PA5
41 #define SPI1_MISO_PIN PA6
42 #define SPI1_MOSI_PIN PA7
44 #define SPI1_NSS_PIN PA4
45 //#define GYRO_1_SPI_INSTANCE SPI1
47 //#define USE_EXTI
48 //#define USE_GYRO_EXTI
49 //#define GYRO_1_EXTI_PIN PC4
50 //#define USE_MPU_DATA_READY_SIGNAL
51 //#define ENSURE_MPU_DATA_READY_IS_LOW
53 // MPU6000
54 #define USE_IMU_MPU6000
55 #define IMU_MPU6000_ALIGN CW270_DEG
56 #define MPU6000_SPI_BUS BUS_SPI1
57 #define MPU6000_CS_PIN SPI1_NSS_PIN
59 // ICM42605/ICM42688P
60 #define USE_IMU_ICM42605
61 #define IMU_ICM42605_ALIGN CW270_DEG
62 #define ICM42605_SPI_BUS BUS_SPI1
63 #define ICM42605_CS_PIN SPI1_NSS_PIN
65 //#define USE_ACC
66 #define USE_IMU_BMI270
67 #define IMU_BMI270_ALIGN CW270_DEG
68 #define BMI270_SPI_BUS BUS_SPI1
69 #define BMI270_CS_PIN SPI1_NSS_PIN
71 // *************** Baro **************************
72 #define USE_BARO
73 #define USE_BARO_BMP280
74 #define SPI3_NSS_PIN PB3
75 #define BMP280_SPI_BUS BUS_SPI3
76 #define BMP280_CS_PIN SPI3_NSS_PIN
77 #define USE_BARO_DPS310
78 #define DPS310_SPI_BUS BUS_SPI3
79 #define DPS310_CS_PIN SPI3_NSS_PIN
81 // *************** BLACKBOX **************************
82 #define USE_SPI_DEVICE_2
83 #define SPI2_SCK_PIN PB13
84 #define SPI2_MISO_PIN PB14
85 #define SPI2_MOSI_PIN PB15
87 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
88 #define USE_FLASHFS
89 #define FLASH_CS_PIN PB12
91 #define USE_FLASH_M25P16
92 #define M25P16_SPI_BUS BUS_SPI2
93 #define M25P16_CS_PIN FLASH_CS_PIN
94 #define USE_FLASH_W25N01G // 1Gb NAND flash support
95 #define W25N01G_SPI_BUS BUS_SPI2
96 #define W25N01G_CS_PIN FLASH_CS_PIN
97 #define USE_FLASH_W25M // Stacked die support
98 #define W25M_SPI_BUS BUS_SPI2
99 #define W25M_CS_PIN FLASH_CS_PIN
100 #define USE_FLASH_W25M512 // 512Kb (256Kb x 2 stacked) NOR flash support
101 #define W25M512_SPI_BUS BUS_SPI2
102 #define W25M512_CS_PIN FLASH_CS_PIN
103 #define USE_FLASH_W25M02G // 2Gb (1Gb x 2 stacked) NAND flash support
104 #define W25M02G_SPI_BUS BUS_SPI2
105 #define W25M02G_CS_PIN FLASH_CS_PIN
107 // *************** OSD *****************************
108 #define USE_SPI_DEVICE_3
109 #define SPI3_SCK_PIN PC10
110 #define SPI3_MISO_PIN PC11
111 #define SPI3_MOSI_PIN PC12
113 #if 0
114 #define USE_MAX7456
115 #define MAX7456_SPI_BUS BUS_SPI3
116 #define MAX7456_CS_PIN PA15
117 #endif
119 // I2C
120 #define USE_I2C
121 #define USE_I2C_DEVICE_2
122 #define I2C2_SCL PB10 // SCL pad
123 #define I2C2_SDA PB11 // SDA pad
124 #define USE_I2C_PULLUP
126 #define USE_BARO
127 #define BARO_I2C_BUS BUS_I2C2
128 #define USE_BARO_BMP280
129 #define USE_BARO_DPS310
131 // *************** UART *****************************
132 #define USE_VCP
133 #define USE_USB_DETECT
134 //#define USB_DETECT_PIN PC5
137 #define USE_UART1
138 #define UART1_RX_PIN PA10
139 #define UART1_TX_PIN PA9
141 #define USE_UART3
142 #define UART3_RX_PIN PB11
143 #define UART3_TX_PIN PB10
144 #define USE_UART_INVERTER
145 #define INVERTER_PIN_UART3_RX PC9
146 #define INVERTER_PIN_USART3_RX PC9
148 #define USE_UART4
149 #define UART4_RX_PIN PA1
150 #define UART4_TX_PIN PA0
152 #define USE_UART5
153 #define UART5_RX_PIN PD2
154 #define UART5_TX_PIN PD2
156 #define USE_UART6
157 #define UART6_RX_PIN PC7
158 #define UART6_TX_PIN PC6
160 #define SERIAL_PORT_COUNT 6
162 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
163 #define SERIALRX_PROVIDER SERIALRX_CRSF
164 #define SERIALRX_UART SERIAL_PORT_USART3
166 // *************** ADC *****************************
167 #define USE_ADC
168 #define ADC_INSTANCE ADC1
169 #define ADC1_DMA_STREAM DMA2_CHANNEL5
170 #define ADC_CHANNEL1_PIN PC2
171 #define ADC_CHANNEL2_PIN PC1
172 #define ADC_CHANNEL3_PIN PC0
173 #define VBAT_ADC_CHANNEL ADC_CHN_1
174 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
175 #define RSSI_ADC_CHANNEL ADC_CHN_3
177 #define USE_LED_STRIP
178 #define WS2811_PIN PB6
180 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP )
181 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
182 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
184 #define VBAT_SCALE_DEFAULT 110
185 #define CURRENT_METER_SCALE_DEFAULT 800
187 #define TARGET_IO_PORTA 0xffff
188 #define TARGET_IO_PORTB 0xffff
189 #define TARGET_IO_PORTC 0xffff
190 #define TARGET_IO_PORTD 0xffff
191 #define TARGET_IO_PORTE BIT(2)
192 #define TARGET_IO_PORTH (BIT(1)|BIT(2)|BIT(3))
195 #define MAX_PWM_OUTPUT_PORTS 8
197 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
198 #define USE_DSHOT
199 #define USE_ESC_SENSOR
200 #define USE_ESCSERIAL
201 #define USE_RPM_FILTER