Ensure that we don't initialise more motors than are defined in target.h. Make MAX_PW...
[betaflight.git] / src / main / target / LUX_RACE / target.h
blobd84a60a58dda2f54de3effecd855df9ff658e716
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
20 #define TARGET_BOARD_IDENTIFIER "LUX"
22 #define LED0 PC15
23 #define LED1 PC14
24 #define LED2 PC13
26 #define BEEPER PB13
27 #define BEEPER_INVERTED
29 // MPU6500 interrupt
30 #define USE_EXTI
31 #define MPU_INT_EXTI PA5
32 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
33 //#define DEBUG_MPU_DATA_READY_INTERRUPT
34 #define USE_MPU_DATA_READY_SIGNAL
35 #define ENSURE_MPU_DATA_READY_IS_LOW
37 #define USE_SPI
38 #define USE_SPI_DEVICE_1
40 #define SPI1_SCK_PIN PB3
41 #define SPI1_MISO_PIN PB4
42 #define SPI1_MOSI_PIN PB5
43 #define SPI1_NSS_PIN PA4
45 #define MPU6500_CS_PIN SPI1_NSS_PIN
46 #define MPU6500_SPI_INSTANCE SPI1
48 #define GYRO
49 #define USE_GYRO_MPU6500
50 #define USE_GYRO_SPI_MPU6500
51 #define GYRO_MPU6500_ALIGN CW270_DEG
53 #define ACC
54 #define USE_ACC_MPU6500
55 #define USE_ACC_SPI_MPU6500
56 #define ACC_MPU6500_ALIGN CW270_DEG
58 #define USB_IO
60 #define USE_VCP
61 #define USE_UART1
62 #define USE_UART2
63 #define USE_UART3
64 #define SERIAL_PORT_COUNT 4
66 #define UART1_TX_PIN PC4
67 #define UART1_RX_PIN PC5
69 #define UART2_TX_PIN PA14
70 #define UART2_RX_PIN PA15
72 #define UART3_TX_PIN PB10
73 #define UART3_RX_PIN PB11
75 #define USE_I2C
76 #define I2C_DEVICE (I2CDEV_2)
78 #define USE_ADC
79 #define ADC_INSTANCE ADC1
80 #define VBAT_ADC_PIN PC0
81 #define CURRENT_METER_ADC_PIN PC1
82 #define RSSI_ADC_PIN PC2
83 #define EXTERNAL1_ADC_PIN PC3
85 #define LED_STRIP
86 #define WS2811_PIN PA6 // TIM16_CH1
87 #define WS2811_TIMER TIM16
88 #define WS2811_DMA_CHANNEL DMA1_Channel3
89 #define WS2811_IRQ DMA1_Channel3_IRQn
90 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
91 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
94 #define SPEKTRUM_BIND
95 // USART1, PC5
96 #define BIND_PIN PC5
98 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
99 #undef GPS_PROTO_NMEA
100 #undef GPS_PROTO_UBLOX
101 #undef GPS_PROTO_I2C_NAV
102 #undef GPS_PROTO_NAZA
104 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
105 #define DEFAULT_FEATURES FEATURE_VBAT
107 // Number of available PWM outputs
108 #define MAX_PWM_OUTPUT_PORTS 10
110 // IO - assuming 303 in 64pin package, TODO
111 #define TARGET_IO_PORTA 0xffff
112 #define TARGET_IO_PORTB 0xffff
113 #define TARGET_IO_PORTC 0xffff
114 #define TARGET_IO_PORTD (BIT(2))
115 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
117 #define USABLE_TIMER_CHANNEL_COUNT 11
118 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(15))