Create release.yml
[betaflight.git] / src / main / target / MOTOLABF4 / target.h
blobf4958b128c3022d5acc3c3d723333d8d79a34724
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 USE_TARGET_CONFIG
24 #undef USE_MSP_DISPLAYPORT
26 #ifdef MLTEMPF4
27 #define TARGET_BOARD_IDENTIFIER "MLTE"
28 #else
29 #define TARGET_BOARD_IDENTIFIER "MLTY"
30 #endif
32 #define USBD_PRODUCT_STRING "MotoLabF4"
34 #define LED0_PIN PC3
35 //#define LED1 PC4
37 #define USE_BEEPER
38 #define BEEPER_PIN PB4
39 #define BEEPER_INVERTED
41 #define GYRO_1_CS_PIN PA4
42 #define GYRO_1_SPI_INSTANCE SPI1
44 #define USE_ACC
45 #define USE_ACC_SPI_MPU6000
46 #define GYRO_1_ALIGN CW180_DEG
48 #define USE_GYRO
49 #define USE_GYRO_SPI_MPU6000
51 // MPU6000 interrupts
52 #define USE_EXTI
53 #define USE_GYRO_EXTI
54 #define GYRO_1_EXTI_PIN PC5
55 #define USE_MPU_DATA_READY_SIGNAL
56 //#define ENSURE_MPU_DATA_READY_IS_LOW
57 //#define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
59 #define USE_SPI_DEVICE_3 // MAX7456 on V1.2
60 #define SPI3_NSS_PIN PA15
61 #define SPI3_SCK_PIN PC10
62 #define SPI3_MISO_PIN PC11
63 #define SPI3_MOSI_PIN PC12
65 #define USE_MAX7456
66 #define MAX7456_SPI_INSTANCE SPI3
67 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
69 #define USE_VCP
70 //#define USB_DETECT_PIN PC15
71 //#define USE_USB_DETECT
73 #define USE_UART1
74 #define UART1_RX_PIN PA10
75 #define UART1_TX_PIN PA9
77 #define USE_UART2
78 #define UART2_RX_PIN PA3
79 #define UART2_TX_PIN PA2
81 // Pins are available, not connected
82 //#define USE_UART3
83 //#define UART3_RX_PIN PB11
84 //#define UART3_TX_PIN PB10
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 PD2
92 #define UART5_TX_PIN PC12 // not connected
94 #ifdef MLTEMPF4
95 #define USE_UART6
96 #define UART6_RX_PIN PC7
97 #define UART6_TX_PIN PC6
98 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART2, UART4, UART5, USART6
99 #else
100 #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART2, UART4, UART5
101 #define USE_VTX_RTC6705
102 #define USE_VTX_RTC6705_SOFTSPI
103 #define RTC6705_SPI_MOSI_PIN PC6
104 #define RTC6705_SPICLK_PIN PC2
105 #define RTC6705_CS_PIN PC7
106 #endif
108 #define USE_ESCSERIAL
109 #define ESCSERIAL_TIMER_TX_PIN PB8
111 #define USE_SPI
112 #define USE_SPI_DEVICE_1 // MPU6000
113 #define USE_SPI_DEVICE_2 // SDcard
115 #define USE_SDCARD
116 #define USE_SDCARD_SPI
117 #define SDCARD_DETECT_INVERTED
118 #define SDCARD_DETECT_PIN PC13
119 #define SDCARD_SPI_INSTANCE SPI2
120 #define SDCARD_SPI_CS_PIN PB12
121 #define SDCARD_SPI_CS_CFG IOCFG_OUT_OD
122 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
124 // Pins are available unless USART3 is connected, not connected
125 //#define USE_I2C
126 //#define I2C_DEVICE (I2CDEV_2)
128 #define USE_ADC
129 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
130 #define VBAT_ADC_PIN PC0
131 #define CURRENT_METER_ADC_PIN PC1
132 // Reserved pins, not connected
133 //#define RSSI_ADC_PIN PC2
135 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
136 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
137 #define SERIALRX_PROVIDER SERIALRX_SBUS
138 #define SERIALRX_UART SERIAL_PORT_UART5
139 #define SBUS_TELEMETRY_UART SERIAL_PORT_UART4
140 #define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_OSD)
141 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
142 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
143 #define CURRENT_METER_SCALE_DEFAULT 140
145 #define TARGET_IO_PORTA 0xffff
146 #define TARGET_IO_PORTB 0xffff
147 #define TARGET_IO_PORTC 0xffff
148 #define TARGET_IO_PORTD (BIT(2))
150 #define USABLE_TIMER_CHANNEL_COUNT 8
151 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) )