Add Winbond 25Q128 flash driver
[betaflight.git] / src / main / target / SPEKTRUMF400 / target.h
blobffeca200276b0b6fa50649c90500a42654403211
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 "SKF4"
25 #define USBD_PRODUCT_STRING "SpektrumF400"
27 #define LED0_PIN PA15
28 #define LED1_PIN PC8
30 #define USE_BEEPER
31 #define BEEPER_PIN PC2
32 #define BEEPER_INVERTED
34 #define USE_SPI
36 #define USE_SPI_DEVICE_1
37 #define SPI1_NSS_PIN PA4
38 #define SPI1_SCK_PIN PA5
39 #define SPI1_MISO_PIN PA6
40 #define SPI1_MOSI_PIN PA7
42 #define USE_SPI_DEVICE_2
43 #define SPI2_NSS_PIN PB12
44 #define SPI2_SCK_PIN PB13
45 #define SPI2_MISO_PIN PB14
46 #define SPI2_MOSI_PIN PB15
48 //#define USE_FLASHFS
49 //#define USE_FLASH_M25P16
51 //#define FLASH_CS_PIN PB12
52 //#define FLASH_SPI_INSTANCE SPI2
54 #define USE_GYRO
55 #define USE_GYRO_SPI_MPU6500
56 #define USE_GYRO_SPI_MPU9250
57 #define GYRO_1_ALIGN CW270_DEG
59 #define USE_ACC
60 #define USE_ACC_SPI_MPU6500
61 #define USE_ACC_SPI_MPU9250
63 #define GYRO_1_CS_PIN PB12
64 #define GYRO_1_SPI_INSTANCE SPI2
66 #define USE_EXTI
67 #define USE_GYRO_EXTI
68 #define GYRO_1_EXTI_PIN PC13
69 #define USE_MPU_DATA_READY_SIGNAL
70 #define ENSURE_MPU_DATA_READY_IS_LOW
72 #define USE_VCP
74 #define USE_UART1
75 #define UART1_TX_PIN PA9
76 #define UART1_RX_PIN PA10
78 #define USE_UART2
79 #define UART2_TX_PIN PA2
80 #define UART2_RX_PIN PA3
82 #define USE_UART3
83 #define UART3_RX_PIN PC11
84 #define UART3_TX_PIN PC10
86 #define USE_UART4
87 #define UART4_RX_PIN PA1
88 #define UART4_TX_PIN PA0
90 #define USE_UART5
91 //#define UART5_RX_PIN PC12 // XXX ???
92 #define UART5_TX_PIN PC12
94 #define USE_SOFTSERIAL1
95 #define USE_SOFTSERIAL2
97 #define SERIAL_PORT_COUNT 8
99 #define USE_ESCSERIAL
100 #define ESCSERIAL_TIMER_TX_PIN PB8
102 #define USE_I2C
104 #define USE_I2C_DEVICE_1
105 #define I2C1_SCL PB8
106 #define I2C1_SDA PB9
108 #define USE_I2C_DEVICE_2
109 #define I2C2_SCL NONE // PB10, Shared with UART3_TX
110 #define I2C2_SDA NONE // PB11, Shared with UART3_RX
112 #define I2C_DEVICE (I2CDEV_1)
114 #define USE_ADC
115 #define ADC_INSTANCE ADC1
116 #define ADC1_DMA_OPT 1 // DMA 2 Stream 4 Channel 0 (compat default)
117 #define VBAT_ADC_PIN PC0
118 #define CURRENT_METER_ADC_PIN PC3
120 #define TARGET_XTAL_MHZ 12
122 #define TARGET_IO_PORTA (0xffff & ~(BIT(14)|BIT(13)))
123 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)))
124 #define TARGET_IO_PORTC 0xffff
125 #define TARGET_IO_PORTD BIT(2)
127 #define USABLE_TIMER_CHANNEL_COUNT 11
128 #define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(5)|TIM_N(8)|TIM_N(9))