Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / target / HAKRCF411D / target.h
blob5b3a479ed19110fb7e4588946d7bc9eb04db7bcb
1 /*
2 * This file is part of INAV.
4 * INAV is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * INAV 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. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with INAV. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "H41D"
21 #define USBD_PRODUCT_STRING "HAKRCF411D"
23 #define USE_TARGET_CONFIG
25 /*** Indicators ***/
26 #define LED0 PC13
27 #define LED1 PC14
28 #define BEEPER PB2
29 #define BEEPER_INVERTED
31 /*** SPI & I2C ***/
32 #define USE_SPI
33 #define USE_SPI_DEVICE_1
34 #define SPI1_NSS_PIN PA4
35 #define SPI1_SCK_PIN PA5
36 #define SPI1_MISO_PIN PA6
37 #define SPI1_MOSI_PIN PA7
39 #define USE_SPI_DEVICE_2
40 #define SPI2_SCK_PIN PB13
41 #define SPI2_MISO_PIN PB14
42 #define SPI2_MOSI_PIN PB15
44 #define USE_I2C
45 #define USE_I2C_DEVICE_1
46 #define I2C1_SCL PB8
47 #define I2C1_SDA PB9
49 /*** IMU sensors ***/
51 // MPU6000
52 #define USE_IMU_MPU6000
53 #define IMU_MPU6000_ALIGN CW180_DEG
54 #define MPU6000_SPI_BUS BUS_SPI1
55 #define MPU6000_CS_PIN SPI1_NSS_PIN
57 // ICM42605/ICM42688P
58 #define USE_IMU_ICM42605
59 #define IMU_ICM42605_ALIGN CW180_DEG
60 #define ICM42605_SPI_BUS BUS_SPI1
61 #define ICM42605_CS_PIN SPI1_NSS_PIN
63 //BMI270
64 #define USE_IMU_BMI270
65 #define IMU_BMI270_ALIGN CW180_DEG
66 #define BMI270_SPI_BUS BUS_SPI1
67 #define BMI270_CS_PIN SPI1_NSS_PIN
69 /*** OSD ***/
70 #define USE_MAX7456
71 #define MAX7456_SPI_BUS BUS_SPI2
72 #define MAX7456_CS_PIN PB12
74 /*** Onboard flash ***/
75 #define USE_FLASHFS
76 #define USE_FLASH_M25P16
77 #define M25P16_CS_PIN PA0
78 #define M25P16_SPI_BUS BUS_SPI2
80 /*** UARTs ***/
81 #define USE_VCP
82 #define VBUS_SENSING_PIN PC15
83 #define VBUS_SENSING_ENABLED
85 #define USE_UART1
86 #define UART1_TX_PIN PA9
87 #define UART1_RX_PIN PA10
89 #define USE_UART2
90 #define UART2_TX_PIN PA2
91 #define UART2_RX_PIN PA3
93 #define USE_SOFTSERIAL1
94 #define SOFTSERIAL_1_TX_PIN PA15
95 #define SOFTSERIAL_1_RX_PIN PB3
97 #define SERIAL_PORT_COUNT 4
99 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
100 #define SERIALRX_PROVIDER SERIALRX_SBUS
101 #define SERIALRX_UART SERIAL_PORT_USART2
103 /*** I2C (Baro/Mag/Pitot) ***/
104 #define DEFAULT_I2C_BUS BUS_I2C1
106 #define USE_BARO
107 #define BARO_I2C_BUS BUS_I2C1
108 #define USE_BARO_BMP280
109 #define USE_BARO_SPL06
110 #define USE_BARO_DPS310
112 #define TEMPERATURE_I2C_BUS BUS_I2C1
114 #define USE_MAG
115 #define MAG_I2C_BUS BUS_I2C1
116 #define USE_MAG_ALL
118 #define PITOT_I2C_BUS BUS_I2C1
120 /*** PINIO ***/
121 #define USE_PINIO
122 #define USE_PINIOBOX
123 #define PINIO1_PIN PB10
124 #define PINIO2_PIN PC14
126 /*** ADC ***/
127 #define USE_ADC
128 #define ADC_INSTANCE ADC1
129 #define ADC1_DMA_STREAM DMA2_Stream0
130 #define ADC_CHANNEL_1_PIN PB0
131 #define ADC_CHANNEL_2_PIN PB1
132 #define VBAT_ADC_CHANNEL ADC_CHN_1
133 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
135 /*** WS2812 LEDs ***/
136 #define USE_LED_STRIP
137 #define WS2811_PIN PA8
139 /*** Misc ***/
140 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
142 #define USE_DSHOT
143 //#define USE_ESC_SENSOR
145 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
147 #define TARGET_IO_PORTA 0xffff
148 #define TARGET_IO_PORTB 0xffff
149 #define TARGET_IO_PORTC 0xffff
150 #define TARGET_IO_PORTD (BIT(2))
152 #define MAX_PWM_OUTPUT_PORTS 4