Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / target / FF_PIKOF4 / target.h
blobf786467209160ff3e4b1339d62131a9964422673
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
19 #if defined(FF_PIKOF4OSD)
20 #define TARGET_BOARD_IDENTIFIER "PKOS"
21 #define USBD_PRODUCT_STRING "PikoF4OSD"
22 #else
23 #define TARGET_BOARD_IDENTIFIER "PIK4"
24 #define USBD_PRODUCT_STRING "PikoF4"
25 #endif
26 /*--------------LED----------------*/
27 #if defined(FF_PIKOF4OSD)
28 #define LED0 PB5
29 #define LED1 PB4
30 #else
31 #define LED0 PA15
32 #define LED1 PB6
33 #endif
34 /*---------------------------------*/
36 /*------------BEEPER---------------*/
37 #define BEEPER PA14
38 #define BEEPER_INVERTED
39 /*---------------------------------*/
41 /*----------CAMERA CONTROL---------*/
42 // #define CAMERA_CONTROL_PIN PB7
43 /*---------------------------------*/
45 #if defined(FF_PIKOF4OSD)
46 #define MPU6000_CS_PIN PA15
47 #define MPU6000_SPI_BUS BUS_SPI3
49 #define MPU6500_CS_PIN PA15
50 #define MPU6500_SPI_BUS BUS_SPI3
51 #else
52 #define MPU6000_CS_PIN PA4
53 #define MPU6000_SPI_BUS BUS_SPI1
55 #define MPU6500_CS_PIN PA4
56 #define MPU6500_SPI_BUS BUS_SPI1
57 #endif
59 #define USE_IMU_MPU6000
60 #define IMU_MPU6000_ALIGN CW180_DEG
62 #define USE_IMU_MPU6500
63 #define IMU_MPU6500_ALIGN CW180_DEG
64 /*---------------------------------*/
66 #if defined(FF_PIKOF4OSD)
67 /*-------------OSD-----------------*/
68 #define USE_MAX7456
69 #define MAX7456_SPI_BUS BUS_SPI1
70 #define MAX7456_CS_PIN PA4
71 //#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz
72 //#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
73 /*---------------------------------*/
74 #else
75 /*------------FLASH----------------*/
76 #define M25P16_CS_PIN PB3
77 #define M25P16_SPI_BUS BUS_SPI3
79 #define USE_FLASHFS
80 #define USE_FLASH_M25P16
81 /*---------------------------------*/
82 #endif
84 /*-----------USB-UARTs-------------*/
85 #define USB_IO
86 #define USE_VCP
87 //#define VBUS_SENSING_PIN PA8
88 //#define VBUS_SENSING_ENABLED
90 #define USE_UART_INVERTER
92 #define USE_UART1
93 #define UART1_RX_PIN PA10
94 #define UART1_TX_PIN PA9
96 #define USE_UART3
97 #define UART3_RX_PIN PB11
98 #define UART3_TX_PIN PB10
99 #if defined(FF_PIKOF4OSD)
100 #define INVERTER_PIN_UART3_RX PC3
101 #else
102 #define INVERTER_PIN_UART3_RX PC8
103 #endif
105 #define USE_UART4
106 #define UART4_TX_PIN PA0
107 #define UART4_RX_PIN PA1
109 #define USE_UART6
110 #define UART6_RX_PIN PC7
111 #define UART6_TX_PIN PC6
113 #define SERIAL_PORT_COUNT 5
116 /*---------------------------------*/
118 /*-------------SPIs----------------*/
119 #define USE_SPI
121 #define USE_SPI_DEVICE_1
122 #define SPI1_NSS_PIN PA4
123 #define SPI1_SCK_PIN PA5
124 #define SPI1_MISO_PIN PA6
125 #define SPI1_MOSI_PIN PA7
127 #define USE_SPI_DEVICE_3
128 #if defined(FF_PIKOF4OSD)
129 #define SPI3_NSS_PIN PA15
130 #else
131 #define SPI3_NSS_PIN PB3
132 #endif
133 #define SPI3_SCK_PIN PC10
134 #define SPI3_MISO_PIN PC11
135 #define SPI3_MOSI_PIN PC12
136 /*---------------------------------*/
138 /*-------------ADCs----------------*/
139 #define USE_ADC
140 #define ADC1_DMA_STREAM DMA2_Stream0
141 #define ADC_CHANNEL_1_PIN PC2
142 #define VBAT_ADC_CHANNEL ADC_CHN_1
143 #if defined(FF_PIKOF4OSD)
144 #define ADC_CHANNEL_2_PIN PC1
145 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
146 #endif
147 /*---------------------------------*/
149 /*-----------LED Strip-------------*/
150 #define USE_LED_STRIP
151 #define WS2811_PIN PB7
152 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST2_HANDLER
153 #define WS2811_DMA_STREAM DMA1_Stream2
154 #define WS2811_DMA_CHANNEL DMA_Channel_3
155 /*---------------------------------*/
157 /*-------------ESCs----------------*/
158 #define USE_ESC_SENSOR
159 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
160 #define USE_ESCSERIAL
161 #define ESCSERIAL_TIMER_TX_PIN PA3 // (HARDARE=0)
162 /*---------------------------------*/
164 /*--------DEFAULT VALUES-----------*/
165 #if defined(FF_PIKOF4OSD)
166 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD )
167 #endif
168 #define SERIALRX_PROVIDER SERIALRX_SBUS
169 #define SERIALRX_UART SERIAL_PORT_USART3
171 #define TARGET_IO_PORTA 0xffff
172 #define TARGET_IO_PORTB 0xffff
173 #define TARGET_IO_PORTC 0xffff
174 #define TARGET_IO_PORTD (BIT(2))
175 /*---------------------------------*/
177 /*--------------TIMERS-------------*/
178 #if defined(FF_PIKOF4OSD)
179 #define MAX_PWM_OUTPUT_PORTS 7
180 #else
181 #define MAX_PWM_OUTPUT_PORTS 5
182 #endif
183 /*---------------------------------*/