New target: RCEXPLORERF3 (#439)
[betaflight.git] / src / main / target / RCEXPLORERF3 / target.h
blob78910b76a3493b4cdeeaf42bdd741e66c30bb318
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "REF3"
22 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
24 #define LED0 PB4
25 #define LED1 PB5
27 #define BEEPER PA0
28 #define BEEPER_INVERTED
30 #define USABLE_TIMER_CHANNEL_COUNT 6
33 #define USE_EXTI
34 #define USE_MPU_DATA_READY_SIGNAL
35 #define MPU_INT_EXTI PA15
36 #define EXTI15_10_CALLBACK_HANDLER_COUNT 1 // MPU data ready
38 #define GYRO
39 #define USE_GYRO_SPI_MPU6000
40 #define USE_ACC_SPI_MPU6000
42 #define MPU6000_CS_PIN PB12
43 #define MPU6000_SPI_INSTANCE SPI2
45 #define ACC
47 #define ACC_MPU6000_ALIGN CW180_DEG
48 #define GYRO_MPU6000_ALIGN CW180_DEG
50 #define BARO
51 #define USE_BARO_MS5611
53 #define MAG
54 #define USE_MPU9250_MAG // Enables bypass configuration
55 #define USE_MAG_AK8975
56 #define USE_MAG_HMC5883 // External
58 #define MAG_AK8975_ALIGN CW180_DEG
60 #define SONAR
61 #define SONAR_TRIGGER_PIN PA6 // RC_CH7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
62 #define SONAR_ECHO_PIN PB1 // RC_CH8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
64 #define USB_IO
66 #define USE_VCP
67 #define USE_UART1
68 #define USE_UART2
69 #define USE_UART3
70 #define SERIAL_PORT_COUNT 4
72 #define UART1_TX_PIN PB6
73 #define UART1_RX_PIN PB7
75 #define UART2_TX_PIN PA2
76 #define UART2_RX_PIN PA3
78 #define UART3_TX_PIN PB10 // PB10 (AF7)
79 #define UART3_RX_PIN PB11 // PB11 (AF7)
81 #define USE_I2C
82 #define I2C_DEVICE (I2CDEV_2) // SDA (PA10/AF4), SCL (PA9/AF4)
84 #define I2C2_SCL PA9
85 #define I2C2_SDA PA10
87 #define USE_SPI
88 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
90 #define SPI2_NSS_PIN PB12
91 #define SPI2_SCK_PIN PB13
92 #define SPI2_MISO_PIN PB14
93 #define SPI2_MOSI_PIN PB15
95 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO | SENSOR_GPS | SENSOR_MAG)
97 #define USE_ADC
98 #define BOARD_HAS_VOLTAGE_DIVIDER
100 #define ADC_INSTANCE ADC2
101 #define VBAT_ADC_PIN PA5
102 #define CURRENT_METER_ADC_PIN PB2
103 #define RSSI_ADC_PIN PA6
105 #define LED_STRIP // LED strip configuration using PWM motor output pin 5.
107 #define USE_LED_STRIP_ON_DMA1_CHANNEL3
108 #define WS2811_PIN PB8 // TIM16_CH1
109 #define WS2811_TIMER TIM16
110 #define WS2811_DMA_CHANNEL DMA1_Channel3
111 #define WS2811_IRQ DMA1_Channel3_IRQn
112 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
113 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
115 #define DEFAULT_FEATURES FEATURE_VBAT
116 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
117 #define SERIALRX_PROVIDER SERIALRX_SBUS
118 #define SERIALRX_UART SERIAL_PORT_USART2
120 #define NAV
121 #define NAV_AUTO_MAG_DECLINATION
122 #define NAV_GPS_GLITCH_DETECTION
123 #define NAV_MAX_WAYPOINTS 60
124 #define GPS
125 #define BLACKBOX
126 #define TELEMETRY
127 #define SERIAL_RX
128 #define AUTOTUNE
129 #define DISPLAY
130 #define USE_SERVOS
131 #define USE_CLI
133 #define SPEKTRUM_BIND
134 // USART3,
135 #define BIND_PIN PA3
137 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
139 // Number of available PWM outputs
140 #define MAX_PWM_OUTPUT_PORTS 6
142 #define TARGET_IO_PORTA 0xffff
143 #define TARGET_IO_PORTB 0xffff
144 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
145 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
147 #define USABLE_TIMER_CHANNEL_COUNT 6
148 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(17))