Fix WS2812 led definition
[inav.git] / src / main / target / PIXRACER / target.h
blob738fc1ad91479592936223c8ff4600cd5df5c870
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 #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
36 #define BEEPER PA15
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
47 #define USE_DUAL_GYRO
49 // ICM20608
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
57 #define USE_MAG
58 #define MAG_I2C_BUS BUS_I2C1
59 #define USE_MAG_MPU9250
60 #define USE_MAG_HMC5883
61 #define USE_MAG_QMC5883
62 #define USE_MAG_IST8310
63 #define USE_MAG_IST8308
64 #define USE_MAG_MAG3110
65 #define USE_MAG_LIS3MDL
67 #define TEMPERATURE_I2C_BUS BUS_I2C1
69 #define USE_BARO
70 #define USE_BARO_MS5611
71 #define MS5611_CS_PIN PD7
72 #define MS5611_SPI_BUS BUS_SPI2
74 #define USE_SDCARD
75 #define USE_SDCARD_SDIO
76 #define SDCARD_SDIO_DMA DMA_TAG(2,3,4)
77 #define SDCARD_SDIO_4BIT
78 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
80 #define USE_VCP
81 #define VBUS_SENSING_PIN PA9
82 #define VBUS_SENSING_ENABLED
84 #define USE_UART1 // ESP8266
85 #define UART1_RX_PIN PB7
86 #define UART1_TX_PIN PB6
88 #define USE_UART2 // TELEM1
89 #define UART2_RX_PIN PD6
90 #define UART2_TX_PIN PD5
92 #define USE_UART3 // TELEM2
93 #define UART3_RX_PIN PD9
94 #define UART3_TX_PIN PD8
96 #define USE_UART4 // GPS
97 #define UART4_RX_PIN PA1
98 #define UART4_TX_PIN PA0
100 #define USE_UART6 // SerialRX (RX line is used only)
101 #define UART6_RX_PIN PC7
102 #define UART6_TX_PIN PC6
104 #define USE_UART7 // DEBUG connector
105 #define UART7_RX_PIN PE7
106 #define UART7_TX_PIN PE8
108 #define USE_UART8 // FRS
109 #define UART8_RX_PIN PE0
110 #define UART8_TX_PIN PE1
112 #define SERIAL_PORT_COUNT 8
114 #define USE_SPI
116 #define USE_SPI_DEVICE_1 // Acc/Gyro/Compass
117 #define SPI1_NSS_PIN PC2
118 #define SPI1_SCK_PIN PA5
119 #define SPI1_MISO_PIN PA6
120 #define SPI1_MOSI_PIN PA7
122 #define USE_SPI_DEVICE_2 // FRAM/BARO
123 #define SPI2_SCK_PIN PB10
124 #define SPI2_MISO_PIN PB14
125 #define SPI2_MOSI_PIN PB15
127 #define USE_I2C
128 #define USE_I2C_DEVICE_1
129 #define USE_I2C_PULLUP
130 #define I2C1_SCL PB8
131 #define I2C1_SDA PB9
134 #define BOARD_HAS_VOLTAGE_DIVIDER
135 #define USE_ADC
136 #define ADC_CHANNEL_1_PIN PA2
137 #define ADC_CHANNEL_2_PIN PA3
138 #define ADC_CHANNEL_3_PIN PC1
139 #define VBAT_ADC_CHANNEL ADC_CHN_1
140 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
141 #define RSSI_ADC_CHANNEL ADC_CHN_3
143 // SDCARD not yet supported
144 //#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
146 #define SERIALRX_PROVIDER SERIALRX_SBUS
147 #define SERIALRX_UART SERIAL_PORT_USART6
149 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
150 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
152 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
154 // Number of available PWM outputs
155 #define MAX_PWM_OUTPUT_PORTS 6
157 #define TARGET_IO_PORTA 0xffff
158 #define TARGET_IO_PORTB 0xffff
159 #define TARGET_IO_PORTC 0xffff
160 #define TARGET_IO_PORTD 0xffff
161 #define TARGET_IO_PORTE 0xffff