Fix WS2812 led definition
[inav.git] / src / main / target / PIXRACER / target.c
blob294c962f2489368b00f97a9aa2aaca4ee6e78d2e
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 #include <stdint.h>
20 #include <platform.h>
21 #include "drivers/io.h"
22 #include "drivers/pwm_mapping.h"
23 #include "drivers/timer.h"
24 #include "drivers/sensor.h"
25 #include "drivers/bus.h"
27 BUSDEV_REGISTER_SPI_TAG(busdev_mpu9250, DEVHW_MPU9250, MPU9250_SPI_BUS, MPU9250_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU9250_ALIGN);
28 BUSDEV_REGISTER_SPI_TAG(busdev_icm20608, DEVHW_MPU6500, ICM20608_SPI_BUS, ICM20608_CS_PIN, NONE, 1, DEVFLAGS_NONE, IMU_MPU6500_ALIGN);
30 BUSDEV_REGISTER_SPI_TAG(busdev_ms5611, DEVHW_MS5611, MS5611_SPI_BUS, MS5611_CS_PIN, NONE, 0, DEVFLAGS_USE_RAW_REGISTERS, 0);
32 BUSDEV_REGISTER_I2C_TAG(busdev_hmc5883, DEVHW_HMC5883, MAG_I2C_BUS, 0x1E, NONE, 0, DEVFLAGS_NONE, 0);
33 BUSDEV_REGISTER_I2C_TAG(busdev_qmc5883, DEVHW_QMC5883, MAG_I2C_BUS, 0x0D, NONE, 0, DEVFLAGS_NONE, 0);
34 BUSDEV_REGISTER_I2C_TAG(busdev_mag3110, DEVHW_MAG3110, MAG_I2C_BUS, 0x0E, NONE, 0, DEVFLAGS_NONE, 0);
36 // PixRacer has built-in HMC5983 compass on the same SPI bus as MPU9250
37 BUSDEV_REGISTER_SPI_TAG(busdev_hmc5983_spi, DEVHW_HMC5883, MPU9250_SPI_BUS, PE15, NONE, 1, DEVFLAGS_NONE, 0);
39 timerHardware_t timerHardware[] = {
40 DEF_TIM(TIM3, CH3, PB0, TIM_USE_PPM, 0, 0 ), // PPM shared uart6 pc7
42 DEF_TIM(TIM1, CH4, PE14, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S1_OUT
43 DEF_TIM(TIM1, CH3, PE13, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S2_OUT
44 DEF_TIM(TIM1, CH2, PE11, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S3_OUT
45 DEF_TIM(TIM1, CH1, PE9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S4_OUT
47 DEF_TIM(TIM4, CH2, PD13, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S5_OUT
48 DEF_TIM(TIM4, CH3, PD14, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S6_OUT
51 const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);