vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / CLRACINGF4AIR / target.h
blob14e5f1d3d52102741db0bf57e6d0005c4fd0252e
1 /*
2 * This is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This software is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this software. If not, see <http://www.gnu.org/licenses/>.
15 #pragma once
17 #if defined(CLRACINGF4AIRV2)
18 #define TARGET_BOARD_IDENTIFIER "CLA2"
19 #define USBD_PRODUCT_STRING "CLRACINGF4AIRV2"
20 #elif defined(CLRACINGF4AIRV3)
21 #define TARGET_BOARD_IDENTIFIER "CLA3"
22 #define USBD_PRODUCT_STRING "CLRACINGF4AIRV3"
23 #else
24 #define TARGET_BOARD_IDENTIFIER "CLRA"
25 #define USBD_PRODUCT_STRING "CLRACINGF4AIR"
26 #endif
27 #if defined(CLRACINGF4AIRV3)
28 #define LED0 PC14
29 #else
30 #define LED0 PB5
31 #endif
32 #define BEEPER PB4
33 #define BEEPER_INVERTED
35 #define USE_SPI
36 #define USE_SPI_DEVICE_1
37 #define USE_SPI_DEVICE_3
38 #define SPI3_NSS_PIN PA15
39 #define SPI3_SCK_PIN PC10
40 #define SPI3_MISO_PIN PC11
41 #if defined(CLRACINGF4AIRV3)
42 #define SPI3_MOSI_PIN PB5
43 #else
44 #define SPI3_MOSI_PIN PC12
45 #endif
47 //MPU-9250
48 #define MPU9250_CS_PIN PA4
49 #define MPU9250_SPI_BUS BUS_SPI1
50 #define USE_IMU_MPU9250
51 #define IMU_MPU9250_ALIGN CW0_DEG
53 #define USE_MAG
54 #define USE_MAG_MPU9250
56 #define USE_BARO
57 #define USE_BARO_BMP280
58 #define USE_BARO_SPI_BMP280
59 #define BMP280_SPI_BUS BUS_SPI3
60 #define BMP280_CS_PIN PB3
62 #define USE_MAX7456
63 #define MAX7456_SPI_BUS BUS_SPI3
64 #define MAX7456_CS_PIN PA15
66 #define USE_LED_STRIP
67 #define WS2811_PIN PB8
69 #define USE_VCP
71 #define USE_UART_INVERTER
73 #define USE_UART1
74 #define UART1_RX_PIN PA10
75 #define UART1_TX_PIN PA9
76 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
77 #define INVERTER_PIN_UART1_RX PC0 // PC0 used as inverter select GPIO
79 #if defined( CLRACINGF4AIRV2) || defined(CLRACINGF4AIRV3)
80 #define USE_UART2
81 #define UART2_RX_PIN PA2
82 #define UART2_TX_PIN PA3
83 #endif
84 #define USE_UART3
85 #define UART3_RX_PIN PB11
86 #define UART3_TX_PIN PB10
87 #define USE_UART4
88 #define UART4_RX_PIN PA1
89 #define UART4_TX_PIN PA0
90 #define USE_UART6
91 #define UART6_RX_PIN PC7
92 #define UART6_TX_PIN PC6
93 #if defined( CLRACINGF4AIRV2 )
94 #define SERIAL_PORT_COUNT 6 //VCP, USART1, UART2, USART3,USART4, USART6,
95 #elif defined(CLRACINGF4AIRV3)
96 #define USE_UART5
97 #define UART5_RX_PIN PD2
98 #define UART5_TX_PIN PC12
99 #define SERIAL_PORT_COUNT 7 //VCP, USART1, UART2, USART3,USART4, USART5,USART6,
100 #else
101 #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART3,USART4, USART6,
102 #endif
103 #define USE_ESCSERIAL
104 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
105 #if defined( CLRACINGF4AIRV2 ) || defined(CLRACINGF4AIRV3)
106 #define USE_I2C
107 #define I2C_DEVICE (I2CDEV_2)
108 #define I2C2_SCL PB10
109 #define I2C2_SDA PB11
111 #define TEMPERATURE_I2C_BUS BUS_I2C2
112 #define MAG_I2C_BUS BUS_I2C2
113 #endif
115 #define USE_ADC
116 #define ADC_INSTANCE ADC1
117 #define ADC_CHANNEL_1_PIN PC1
118 #define ADC_CHANNEL_2_PIN PC2
119 #define ADC_CHANNEL_3_PIN PC3
121 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
122 #define VBAT_ADC_CHANNEL ADC_CHN_2
123 #define RSSI_ADC_CHANNEL ADC_CHN_3
125 // V2 has airspeed input
126 #if defined( CLRACINGF4AIRV2 ) || defined(CLRACINGF4AIRV3)
127 #define ADC_CHANNEL_4_PIN PC5
128 #define ADC_AIRSPEED_CHANNEL ADC_CHN_4
129 #define CURRENT_METER_SCALE 250
130 #endif
132 #define USE_ESC_SENSOR
133 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_TELEMETRY| FEATURE_VBAT | FEATURE_OSD )
135 #define SPEKTRUM_BIND_PIN UART1_RX_PIN
136 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
137 // Number of available PWM outputs
138 #define MAX_PWM_OUTPUT_PORTS 8
139 #define TARGET_MOTOR_COUNT 8
141 #define TARGET_IO_PORTA (0xffff)
142 #define TARGET_IO_PORTB (0xffff)
143 #define TARGET_IO_PORTC (0xffff)
144 #define TARGET_IO_PORTD BIT(2)