Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / FF_PIKOF4 / target.h
blob7a871e78cc8f969c383d2780efac5c37c170bf90
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
22 #if defined(FF_PIKOF4OSD)
23 #define TARGET_BOARD_IDENTIFIER "PKOS"
24 #define USBD_PRODUCT_STRING "PikoF4OSD"
25 #else
26 #define TARGET_BOARD_IDENTIFIER "PIK4"
27 #define USBD_PRODUCT_STRING "PikoF4"
28 #endif
29 #define USE_TARGET_CONFIG
30 /*--------------LED----------------*/
31 #if defined(FF_PIKOF4OSD)
32 #define LED0_PIN PB5
33 #define LED1_PIN PB4
34 #else
35 #define LED0_PIN PA15
36 #define LED1_PIN PB6
37 #endif
38 /*---------------------------------*/
40 /*------------BEEPER---------------*/
41 #define USE_BEEPER
42 #define BEEPER_PIN PA14
43 #define BEEPER_INVERTED
44 /*---------------------------------*/
46 /*------------SENSORS--------------*/
47 // MPU interrupt
48 #define USE_EXTI
49 #define USE_GYRO_EXTI
50 #define GYRO_1_EXTI_PIN PC4
51 #define USE_MPU_DATA_READY_SIGNAL
52 #define ENSURE_MPU_DATA_READY_IS_LOW
54 #if defined(FF_PIKOF4OSD)
55 #define GYRO_1_CS_PIN PA15
56 #define GYRO_1_SPI_INSTANCE SPI3
57 #else
58 #define GYRO_1_CS_PIN PA4
59 #define GYRO_1_SPI_INSTANCE SPI1
60 #endif
62 #define USE_GYRO
63 #define USE_GYRO_SPI_MPU6000
64 #define USE_GYRO_SPI_MPU6500
65 #define GYRO_1_ALIGN CW180_DEG
67 #define USE_ACC
68 #define USE_ACC_SPI_MPU6000
69 #define USE_ACC_SPI_MPU6500
70 /*---------------------------------*/
72 #if defined(FF_PIKOF4OSD)
73 /*-------------OSD-----------------*/
74 #define USE_MAX7456
75 #define MAX7456_SPI_INSTANCE SPI1
76 #define MAX7456_SPI_CS_PIN PA4
77 /*---------------------------------*/
78 #else
79 /*------------FLASH----------------*/
80 #define FLASH_CS_PIN PB3
81 #define FLASH_SPI_INSTANCE SPI3
83 #define USE_FLASHFS
84 #define USE_FLASH_M25P16
85 /*---------------------------------*/
86 #endif
88 /*-----------USB-UARTs-------------*/
89 #define USE_VCP
90 //#define USB_DETECT_PIN PA8
91 //#define USE_USB_DETECT
93 #define USE_UART1
94 #define UART1_RX_PIN PA10
95 #define UART1_TX_PIN PA9
97 #define USE_UART3
98 #define UART3_RX_PIN PB11
99 #define UART3_TX_PIN PB10
100 #if defined(FF_PIKOF4OSD)
101 #define INVERTER_PIN_UART3 PC3
102 #else
103 #define INVERTER_PIN_UART3 PC8
104 #endif
106 #define USE_UART4
107 #define UART4_TX_PIN PA0
108 #define UART4_RX_PIN PA1
110 #define USE_UART6
111 #define UART6_RX_PIN PC7
112 #define UART6_TX_PIN PC6
114 #define SERIAL_PORT_COUNT 5
117 /*---------------------------------*/
119 /*-------------SPIs----------------*/
120 #define USE_SPI
122 #define USE_SPI_DEVICE_1
123 #define SPI1_NSS_PIN PA4
124 #define SPI1_SCK_PIN PA5
125 #define SPI1_MISO_PIN PA6
126 #define SPI1_MOSI_PIN PA7
128 #define USE_SPI_DEVICE_3
129 #if defined(FF_PIKOF4OSD)
130 #define SPI3_NSS_PIN PA15
131 #else
132 #define SPI3_NSS_PIN PB3
133 #endif
134 #define SPI3_SCK_PIN PC10
135 #define SPI3_MISO_PIN PC11
136 #define SPI3_MOSI_PIN PC12
137 /*---------------------------------*/
139 /*-------------ADCs----------------*/
140 #define USE_ADC
141 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
142 #define VBAT_ADC_PIN PC2
143 #if defined(FF_PIKOF4OSD)
144 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
145 #define CURRENT_METER_ADC_PIN PC1
146 #define CURRENT_METER_SCALE_DEFAULT 250
147 #endif
148 /*---------------------------------*/
150 /*-------------ESCs----------------*/
151 #define USE_ESCSERIAL
152 #define ESCSERIAL_TIMER_TX_PIN PA3 // (HARDARE=0)
153 /*---------------------------------*/
155 /*--------DEFAULT VALUES-----------*/
156 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
157 #if defined(FF_PIKOF4OSD)
158 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD )
159 #endif
160 #define SERIALRX_PROVIDER SERIALRX_SBUS
161 #define SERIALRX_UART SERIAL_PORT_USART3
163 #define TARGET_IO_PORTA 0xffff
164 #define TARGET_IO_PORTB 0xffff
165 #define TARGET_IO_PORTC 0xffff
166 #define TARGET_IO_PORTD (BIT(2))
167 /*---------------------------------*/
169 /*--------------TIMERS-------------*/
170 #if defined(FF_PIKOF4OSD)
171 #define USABLE_TIMER_CHANNEL_COUNT 7
172 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) )
173 #else
174 #define USABLE_TIMER_CHANNEL_COUNT 5
175 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) )
176 #endif
177 /*---------------------------------*/