Add Winbond 25Q128 flash driver
[betaflight.git] / src / main / target / AIKONF4 / target.h
blob68c8ae5c6fd37f4af9793d281c0bdeed8e50676c
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 DSHOT_DMAR_ON
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
48 #define USE_GYRO_EXTI
49 #define GYRO_1_EXTI_PIN PC4
50 #define USE_MPU_DATA_READY_SIGNAL
52 #define USE_BARO
53 #define USE_BARO_BMP280
55 #define USE_MAX7456
56 #define MAX7456_SPI_INSTANCE SPI3
57 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
59 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
60 #define USE_FLASHFS
61 #define USE_FLASH_M25P16
62 #define FLASH_CS_PIN SPI2_NSS_PIN
63 #define FLASH_SPI_INSTANCE SPI2
65 #define USE_VCP
66 #define USE_USB_DETECT
67 #define USB_DETECT_PIN PD2
69 #define USE_UART1
70 #define UART1_RX_PIN PA10
72 #define USE_UART2
73 #define UART2_RX_PIN PA3
74 #define UART2_TX_PIN PA2
76 #define USE_UART3
77 #define UART3_RX_PIN PB11
78 #define UART3_TX_PIN PB10
80 #define USE_UART4
81 #define UART4_TX_PIN PA0
83 #define USE_SOFTSERIAL1
84 #define SOFTSERIAL1_TX_PIN PA9
86 #define USE_SOFTSERIAL2
87 #define SOFTSERIAL2_RX_PIN PA1
89 #define SERIAL_PORT_COUNT 7 // VCP, USART1, USART3, USART4, USART6, SOFT_SERIAL1, SOFT_SERIAL2
91 #define USE_ESCSERIAL
92 #define ESCSERIAL_TIMER_TX_PIN PB6 // (HARDARE=0,PPM)
94 #define USE_SPI
95 #define USE_SPI_DEVICE_1
96 #define SPI1_NSS_PIN PA4
97 #define SPI1_SCK_PIN PA5
98 #define SPI1_MISO_PIN PA6
99 #define SPI1_MOSI_PIN PA7
101 #define USE_SPI_DEVICE_2
102 #define SPI2_NSS_PIN PB12
103 #define SPI2_SCK_PIN PB13
104 #define SPI2_MISO_PIN PB14
105 #define SPI2_MOSI_PIN PB15
107 #define USE_SPI_DEVICE_3
108 #define SPI3_NSS_PIN PA15
109 #define SPI3_SCK_PIN PC10
110 #define SPI3_MISO_PIN PC11
111 #define SPI3_MOSI_PIN PC12
113 #define USE_I2C
114 #define USE_I2C_DEVICE_1
115 #define I2C_DEVICE (I2CDEV_1)
116 #define I2C1_SCL PB8
117 #define I2C1_SDA PB9
119 #define USE_ADC
120 #define CURRENT_METER_ADC_PIN PC1
121 #define VBAT_ADC_PIN PC2
122 #define RSSI_ADC_PIN PC3
123 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
124 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
126 #define SERIALRX_PROVIDER SERIALRX_SBUS
127 #define SERIALRX_UART SERIAL_PORT_USART1
129 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
130 #define DEFAULT_FEATURES ( FEATURE_OSD | FEATURE_SOFTSERIAL )
132 #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) )
133 #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) )
134 #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) )
135 #define TARGET_IO_PORTD ( BIT(2) )
137 #define USABLE_TIMER_CHANNEL_COUNT 13
138 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(9) )