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/>.
19 #define TARGET_BOARD_IDENTIFIER "PXR4"
21 #define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
23 #define USBD_PRODUCT_STRING "PixRacer"
25 // Use target-specific hardware descriptors (don't use common_hardware.h)
26 #define USE_TARGET_HARDWARE_DESCRIPTORS
28 // PixRacer target requires some hardware to be set up before booting and detecting sensors
29 #define USE_HARDWARE_PREBOOT_SETUP
32 #define LED0 PB11 //red
33 #define LED1 PB3 //blue
34 #define LED2 PB1 //green
37 #define BEEPER_INVERTED
39 #define INVERTER_PIN_UART PC13
41 #define USE_IMU_MPU6500
42 #define IMU_MPU6500_ALIGN CW180_DEG_FLIP
44 #define USE_IMU_MPU9250
45 #define IMU_MPU9250_ALIGN CW180_DEG_FLIP
50 #define ICM20608_CS_PIN PC15
51 #define ICM20608_SPI_BUS BUS_SPI1
53 // MPU9250 gyro/acc/mag
54 #define MPU9250_CS_PIN PC2
55 #define MPU9250_SPI_BUS BUS_SPI1
58 #define MAG_I2C_BUS BUS_I2C1
61 #define TEMPERATURE_I2C_BUS BUS_I2C1
64 #define USE_BARO_MS5611
65 #define MS5611_CS_PIN PD7
66 #define MS5611_SPI_BUS BUS_SPI2
69 #define USE_SDCARD_SDIO
70 #define SDCARD_SDIO_DMA DMA_TAG(2,3,4)
71 #define SDCARD_SDIO_4BIT
72 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
75 #define VBUS_SENSING_PIN PA9
76 #define VBUS_SENSING_ENABLED
78 #define USE_UART1 // ESP8266
79 #define UART1_RX_PIN PB7
80 #define UART1_TX_PIN PB6
82 #define USE_UART2 // TELEM1
83 #define UART2_RX_PIN PD6
84 #define UART2_TX_PIN PD5
86 #define USE_UART3 // TELEM2
87 #define UART3_RX_PIN PD9
88 #define UART3_TX_PIN PD8
90 #define USE_UART4 // GPS
91 #define UART4_RX_PIN PA1
92 #define UART4_TX_PIN PA0
94 #define USE_UART6 // SerialRX (RX line is used only)
95 #define UART6_RX_PIN PC7
96 #define UART6_TX_PIN PC6
98 #define USE_UART7 // DEBUG connector
99 #define UART7_RX_PIN PE7
100 #define UART7_TX_PIN PE8
102 #define USE_UART8 // FRS
103 #define UART8_RX_PIN PE0
104 #define UART8_TX_PIN PE1
106 #define SERIAL_PORT_COUNT 8
110 #define USE_SPI_DEVICE_1 // Acc/Gyro/Compass
111 #define SPI1_NSS_PIN PC2
112 #define SPI1_SCK_PIN PA5
113 #define SPI1_MISO_PIN PA6
114 #define SPI1_MOSI_PIN PA7
116 #define USE_SPI_DEVICE_2 // FRAM/BARO
117 #define SPI2_SCK_PIN PB10
118 #define SPI2_MISO_PIN PB14
119 #define SPI2_MOSI_PIN PB15
122 #define USE_I2C_DEVICE_1
123 #define USE_I2C_PULLUP
128 #define BOARD_HAS_VOLTAGE_DIVIDER
130 #define ADC_CHANNEL_1_PIN PA2
131 #define ADC_CHANNEL_2_PIN PA3
132 #define ADC_CHANNEL_3_PIN PC1
133 #define VBAT_ADC_CHANNEL ADC_CHN_1
134 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
135 #define RSSI_ADC_CHANNEL ADC_CHN_3
137 // SDCARD not yet supported
138 //#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
140 #define SERIALRX_PROVIDER SERIALRX_SBUS
141 #define SERIALRX_UART SERIAL_PORT_USART6
143 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
144 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
146 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
148 // Number of available PWM outputs
149 #define MAX_PWM_OUTPUT_PORTS 6
151 #define TARGET_IO_PORTA 0xffff
152 #define TARGET_IO_PORTB 0xffff
153 #define TARGET_IO_PORTC 0xffff
154 #define TARGET_IO_PORTD 0xffff
155 #define TARGET_IO_PORTE 0xffff