Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / target / AOCODARCF4V3 / target.h
blob0c95564162e66c8f0497bda33c6f19636ef7cd13
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 USE_TARGET_CONFIG
22 #ifdef AOCODARCF4V3
23 #define TARGET_BOARD_IDENTIFIER "AOF4V3"
24 #define USBD_PRODUCT_STRING "AOCODARCF4V3"
25 #else
26 #define TARGET_BOARD_IDENTIFIER "AOF4V3SD"
27 #define USBD_PRODUCT_STRING "AOCODARCF4V3_SD"
28 #endif
30 // ******** Board LEDs **********************
31 #define LED0 PC13
33 // ******* Beeper ***********
34 #define BEEPER PB8
35 #define BEEPER_INVERTED
38 // ******* GYRO and ACC ********
39 #define USE_IMU_MPU6500
40 #define IMU_MPU6500_ALIGN CW90_DEG
41 #define MPU6500_SPI_BUS BUS_SPI1
42 #define MPU6500_CS_PIN PA4
44 #define USE_IMU_MPU6000
45 #define IMU_MPU6000_ALIGN CW90_DEG
46 #define MPU6000_SPI_BUS BUS_SPI1
47 #define MPU6000_CS_PIN PA4
49 #define USE_IMU_ICM42605
50 #define IMU_ICM42605_ALIGN CW90_DEG
51 #define ICM42605_SPI_BUS BUS_SPI1
52 #define ICM42605_CS_PIN PA4
55 // *************** Baro **************************
56 #define USE_I2C
57 #define USE_I2C_DEVICE_1
59 #define I2C1_SCL PB6 // SCL
60 #define I2C1_SDA PB7 // SDA
61 #define DEFAULT_I2C_BUS BUS_I2C1
63 #define USE_BARO
64 #define BARO_I2C_BUS DEFAULT_I2C_BUS
66 #define USE_BARO_BMP280
67 #define USE_BARO_MS5611
68 #define USE_BARO_DPS310
69 #define USE_BARO_SPL06
71 //*********** Magnetometer / Compass *************
72 #define USE_MAG
73 #define MAG_I2C_BUS DEFAULT_I2C_BUS
74 #define USE_MAG_ALL
76 // ******* SERIAL ********
77 #define USE_VCP
78 #define VBUS_SENSING_PIN PB12
79 #define VBUS_SENSING_ENABLED
81 #define USE_UART1
82 #define UART1_TX_PIN PA9
83 #define UART1_RX_PIN PA10
85 #define USE_UART2
86 #define UART2_TX_PIN PA2
87 #define UART2_RX_PIN PA3
89 #define USE_UART3
90 #define UART3_TX_PIN PC10
91 #define UART3_RX_PIN PC11
93 #define USE_UART4
94 #define UART4_TX_PIN PA0
95 #define UART4_RX_PIN PA1
97 #define USE_UART5
98 #define UART5_TX_PIN PC12
99 #define UART5_RX_PIN PD2
102 #define SERIAL_PORT_COUNT 6
105 // ******* SPI ********
106 #define USE_SPI
108 #define USE_SPI_DEVICE_1
109 #define SPI1_NSS_PIN PA4
110 #define SPI1_SCK_PIN PA5
111 #define SPI1_MISO_PIN PA6
112 #define SPI1_MOSI_PIN PA7
114 #define USE_SPI_DEVICE_2
115 #define SPI2_NSS_PIN PA13
116 #define SPI2_SCK_PIN PB13
117 #define SPI2_MISO_PIN PB14
118 #define SPI2_MOSI_PIN PB15
120 #define USE_SPI_DEVICE_3
121 #define SPI3_NSS_PIN PC0
122 #define SPI3_SCK_PIN PB3
123 #define SPI3_MISO_PIN PB4
124 #define SPI3_MOSI_PIN PB5
126 // ******* ADC ********
127 #define USE_ADC
128 #define ADC_CHANNEL_1_PIN PC1
129 #define ADC_CHANNEL_2_PIN PC2
130 #define ADC_CHANNEL_3_PIN PC3
132 #define VBAT_ADC_CHANNEL ADC_CHN_2
133 #define RSSI_ADC_CHANNEL ADC_CHN_3
134 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
136 #define VBAT_SCALE_DEFAULT 1100
137 #define CURRENT_METER_SCALE 206
139 // ******* OSD ********
140 #define USE_OSD
141 #define USE_MAX7456
142 #define MAX7456_SPI_BUS BUS_SPI2
143 #define MAX7456_CS_PIN PA13
145 //******* FLASH ********
146 #if defined(AOCODARCF4V3_SD)
147 #define USE_SDCARD
148 #define USE_SDCARD_SPI
149 #define SDCARD_SPI_BUS BUS_SPI3
150 #define SDCARD_CS_PIN PC0
151 #define SDCARD_DETECT_INVERTED
152 #define SDCARD_DETECT_PIN PC14
153 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
154 #else
155 #define USE_FLASHFS
156 #define USE_FLASH_M25P16
157 #define M25P16_SPI_BUS BUS_SPI3
158 #define M25P16_CS_PIN PC0
159 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
160 #endif
161 // *************** PINIO ***************************
162 #define USE_PINIO
163 #define USE_PINIOBOX
164 #define PINIO1_PIN PC5 // VTX power switcher
165 #define PINIO2_PIN PA14 //bluetooth
166 #define PINIO3_PIN PC15 //Camera control
167 #define PINIO1_FLAGS PINIO_FLAGS_INVERTED
168 #define PINIO2_FLAGS PINIO_FLAGS_INVERTED
170 //************ LEDSTRIP *****************
171 #define USE_LED_STRIP
172 #define WS2811_PIN PB1
174 // ******* FEATURES ********
175 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
176 #define SERIALRX_UART SERIAL_PORT_USART2
177 #define SERIALRX_PROVIDER SERIALRX_CRSF
179 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_GPS | FEATURE_BLACKBOX | FEATURE_LED_STRIP)
181 #define TARGET_IO_PORTA 0xffff
182 #define TARGET_IO_PORTB 0xffff
183 #define TARGET_IO_PORTC 0xffff
184 #define TARGET_IO_PORTD 0xffff
186 #define MAX_PWM_OUTPUT_PORTS 10
188 // ESC-related features
189 #define USE_DSHOT
190 #define USE_SERIALSHOT
191 #define USE_ESC_SENSOR
192 #define USE_SERIAL_4WAY_BLHELI_INTERFACE