Add Winbond 25Q128 flash driver
[betaflight.git] / src / main / target / MERAKRCF722 / target.h
blobe478889dadbd20080cb32e18a2e96304099240f9
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 "MEF7"
24 #define USBD_PRODUCT_STRING "MERAKRCF722"
26 #define LED0_PIN PC13
28 #define USE_BEEPER
29 #define BEEPER_PIN PC14
30 #define BEEPER_INVERTED
32 // *************** Gyro & ACC **********************
33 #define USE_SPI
34 #define USE_SPI_DEVICE_2
36 #define SPI2_SCK_PIN PB13
37 #define SPI2_MISO_PIN PB14
38 #define SPI2_MOSI_PIN PB15
40 #define GYRO_1_CS_PIN PB12
41 #define GYRO_1_SPI_INSTANCE SPI2
43 #define USE_EXTI
44 #define USE_GYRO_EXTI
45 #define GYRO_1_EXTI_PIN PC4
46 #define USE_MPU_DATA_READY_SIGNAL
48 #define USE_GYRO
49 #define USE_GYRO_SPI_MPU6000
50 #define GYRO_1_ALIGN CW0_DEG
52 #define USE_ACC
53 #define USE_ACC_SPI_MPU6000
55 // *************** BLACKBOX **************************
56 #define USE_SPI_DEVICE_1
57 #define SPI1_SCK_PIN PA5
58 #define SPI1_MISO_PIN PA6
59 #define SPI1_MOSI_PIN PA7
61 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
62 #define USE_FLASHFS
63 #define USE_FLASH_M25P16
64 #define FLASH_CS_PIN PA4
65 #define FLASH_SPI_INSTANCE SPI1
67 // *************** OSD *****************************
68 #define USE_SPI_DEVICE_3
69 #define SPI3_SCK_PIN PB3
70 #define SPI3_MISO_PIN PB4
71 #define SPI3_MOSI_PIN PB5
73 #define USE_MAX7456
74 #define MAX7456_SPI_INSTANCE SPI3
75 #define MAX7456_SPI_CS_PIN PA15
77 // *************** I2C **************************
78 #define USE_I2C
79 #define USE_I2C_DEVICE_1
80 #define I2C_DEVICE (I2CDEV_1)
81 #define I2C1_SCL PB6
82 #define I2C1_SDA PB7
84 // *************** BARO **************************
85 #define USE_BARO
86 #define BARO_I2C_INSTANCE (I2CDEV_1)
87 #define USE_BARO_BMP085
88 #define USE_BARO_BMP280
89 #define USE_BARO_MS5611
91 // *************** MAG **************************
92 #define USE_MAG
93 #define MAG_I2C_INSTANCE (I2CDEV_1)
94 #define USE_MAG_AK8975
95 #define USE_MAG_HMC5883
96 #define USE_MAG_QMC5883l
98 // *************** UART *****************************
99 #define USE_VCP
101 #define USE_UART1
102 #define UART1_RX_PIN PA10
103 #define UART1_TX_PIN PA9
105 #define USE_UART2
106 #define UART2_RX_PIN PA3
107 #define UART2_TX_PIN PA2
109 #define USE_UART3
110 #define UART3_RX_PIN PB11
111 #define UART3_TX_PIN PB10
113 #define USE_UART4
114 #define UART4_RX_PIN PC11
115 #define UART4_TX_PIN PC10
117 #define USE_UART5
118 #define UART5_RX_PIN PD2
119 #define UART5_TX_PIN PC12
121 #define USE_SOFTSERIAL1
122 #define USE_SOFTSERIAL2
124 #define SERIAL_PORT_COUNT 8
126 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
127 #define SERIALRX_PROVIDER SERIALRX_SBUS
129 // *************** ADC *****************************
130 #define USE_ADC
131 #define ADC_INSTANCE ADC1
132 #define ADC1_DMA_OPT 0
134 #define VBAT_ADC_PIN PC2
135 #define CURRENT_METER_ADC_PIN PC1
136 #define RSSI_ADC_PIN PC3
138 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
139 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
140 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
141 #define CURRENT_METER_SCALE_DEFAULT 179
143 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
145 #define USE_ESCSERIAL
146 #define ESCSERIAL_TIMER_TX_PIN PA3
148 #define TARGET_IO_PORTA 0xffff
149 #define TARGET_IO_PORTB 0xffff
150 #define TARGET_IO_PORTC 0xffff
151 #define TARGET_IO_PORTD (BIT(2))
153 #define USABLE_TIMER_CHANNEL_COUNT 9
154 #define USED_TIMERS (TIM_N(1)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8)|TIM_N(11))