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)
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/>.
22 #if defined(FF_PIKOF4OSD)
23 #define TARGET_BOARD_IDENTIFIER "PKOS"
24 #define USBD_PRODUCT_STRING "PikoF4OSD"
26 #define TARGET_BOARD_IDENTIFIER "PIK4"
27 #define USBD_PRODUCT_STRING "PikoF4"
29 #define USE_TARGET_CONFIG
30 /*--------------LED----------------*/
31 #if defined(FF_PIKOF4OSD)
38 /*---------------------------------*/
40 /*------------BEEPER---------------*/
42 #define BEEPER_PIN PA14
43 #define BEEPER_INVERTED
44 /*---------------------------------*/
46 /*------------SENSORS--------------*/
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
58 #define GYRO_1_CS_PIN PA4
59 #define GYRO_1_SPI_INSTANCE SPI1
63 #define USE_GYRO_SPI_MPU6000
64 #define USE_GYRO_SPI_MPU6500
65 #define GYRO_1_ALIGN CW180_DEG
68 #define USE_ACC_SPI_MPU6000
69 #define USE_ACC_SPI_MPU6500
70 /*---------------------------------*/
72 #if defined(FF_PIKOF4OSD)
73 /*-------------OSD-----------------*/
75 #define MAX7456_SPI_INSTANCE SPI1
76 #define MAX7456_SPI_CS_PIN PA4
77 /*---------------------------------*/
79 /*------------FLASH----------------*/
80 #define FLASH_CS_PIN PB3
81 #define FLASH_SPI_INSTANCE SPI3
84 #define USE_FLASH_M25P16
85 /*---------------------------------*/
88 /*-----------USB-UARTs-------------*/
90 //#define USB_DETECT_PIN PA8
91 //#define USE_USB_DETECT
94 #define UART1_RX_PIN PA10
95 #define UART1_TX_PIN PA9
98 #define UART3_RX_PIN PB11
99 #define UART3_TX_PIN PB10
100 #if defined(FF_PIKOF4OSD)
101 #define INVERTER_PIN_UART3 PC3
103 #define INVERTER_PIN_UART3 PC8
107 #define UART4_TX_PIN PA0
108 #define UART4_RX_PIN PA1
111 #define UART6_RX_PIN PC7
112 #define UART6_TX_PIN PC6
114 #define SERIAL_PORT_COUNT 5
117 /*---------------------------------*/
119 /*-------------SPIs----------------*/
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
132 #define SPI3_NSS_PIN PB3
134 #define SPI3_SCK_PIN PC10
135 #define SPI3_MISO_PIN PC11
136 #define SPI3_MOSI_PIN PC12
137 /*---------------------------------*/
139 /*-------------ADCs----------------*/
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
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 )
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) )
174 #define USABLE_TIMER_CHANNEL_COUNT 5
175 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) )
177 /*---------------------------------*/