Fixed conditionals for 4 way ESC boot loader.
[betaflight.git] / src / main / target / AIKONF4 / target.h
blob4c92818b0b07eb6423c95ce1d16536e4efd565f0
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight 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 * Cleanflight and Betaflight 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/>.
21 #pragma once
23 #define TARGET_BOARD_IDENTIFIER "AIK4"
24 #define USBD_PRODUCT_STRING "AIKONF4"
26 #define LED0_PIN PB4
27 #define USE_BEEPER
28 #define BEEPER_PIN PB5
29 #define BEEPER_INVERTED
31 #define ENABLE_DSHOT_DMAR true
33 #define INVERTER_PIN_UART1 PC0
35 #define USE_EXTI
37 #define USE_GYRO
38 #define USE_GYRO_SPI_MPU6000
39 #define USE_GYRO_SPI_MPU6500
40 #define GYRO_1_CS_PIN SPI1_NSS_PIN
41 #define GYRO_1_SPI_INSTANCE SPI1
42 #define GYRO_1_ALIGN CW0_DEG
44 #define USE_ACC
45 #define USE_ACC_SPI_MPU6000
46 #define USE_ACC_SPI_MPU6500
47 #define ACC_1_ALIGN CW0_DEG
49 #define USE_GYRO_EXTI
50 #define GYRO_1_EXTI_PIN PC4
51 #define USE_MPU_DATA_READY_SIGNAL
53 #define USE_BARO
54 #define USE_BARO_BMP280
56 #define USE_MAX7456
57 #define MAX7456_SPI_INSTANCE SPI3
58 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
59 #define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD)
60 #define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
62 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
63 #define USE_FLASHFS
64 #define USE_FLASH_M25P16
65 #define FLASH_CS_PIN SPI2_NSS_PIN
66 #define FLASH_SPI_INSTANCE SPI2
68 #define USE_VCP
69 #define USE_USB_DETECT
70 #define USB_DETECT_PIN PD2
72 #define USE_UART1
73 #define UART1_RX_PIN PA10
75 #define USE_UART2
76 #define UART2_RX_PIN PA3
77 #define UART2_TX_PIN PA2
79 #define USE_UART3
80 #define UART3_RX_PIN PB11
81 #define UART3_TX_PIN PB10
83 #define USE_UART4
84 #define UART4_TX_PIN PA0
86 #define USE_SOFTSERIAL1
87 #define SOFTSERIAL1_TX_PIN PA9
89 #define USE_SOFTSERIAL2
90 #define SOFTSERIAL2_RX_PIN PA1
92 #define SERIAL_PORT_COUNT 7 // VCP, USART1, USART3, USART4, USART6, SOFT_SERIAL1, SOFT_SERIAL2
94 #define USE_ESCSERIAL
95 #define ESCSERIAL_TIMER_TX_PIN PB6 // (HARDARE=0,PPM)
97 #define USE_SPI
98 #define USE_SPI_DEVICE_1
99 #define SPI1_NSS_PIN PA4
100 #define SPI1_SCK_PIN PA5
101 #define SPI1_MISO_PIN PA6
102 #define SPI1_MOSI_PIN PA7
104 #define USE_SPI_DEVICE_2
105 #define SPI2_NSS_PIN PB12
106 #define SPI2_SCK_PIN PB13
107 #define SPI2_MISO_PIN PB14
108 #define SPI2_MOSI_PIN PB15
110 #define USE_SPI_DEVICE_3
111 #define SPI3_NSS_PIN PA15
112 #define SPI3_SCK_PIN PC10
113 #define SPI3_MISO_PIN PC11
114 #define SPI3_MOSI_PIN PC12
116 #define USE_I2C
117 #define USE_I2C_DEVICE_1
118 #define I2C_DEVICE (I2CDEV_1)
119 #define I2C1_SCL PB8
120 #define I2C1_SDA PB9
122 #define USE_ADC
123 #define CURRENT_METER_ADC_PIN PC1
124 #define VBAT_ADC_PIN PC2
125 #define RSSI_ADC_PIN PC3
126 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
127 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
129 #define SERIALRX_PROVIDER SERIALRX_SBUS
130 #define SERIALRX_UART SERIAL_PORT_USART1
132 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
133 #define DEFAULT_FEATURES ( FEATURE_OSD | FEATURE_SOFTSERIAL )
135 #define TARGET_IO_PORTA ( BIT(15) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0) )
136 #define TARGET_IO_PORTB ( BIT(15) | BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(1) | BIT(0) )
137 #define TARGET_IO_PORTC ( BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8) | BIT(7) | BIT(6) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0) )
138 #define TARGET_IO_PORTD ( BIT(2) )
140 #define USABLE_TIMER_CHANNEL_COUNT 13
141 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(9) )