Removed need to specify timer peripherals in the target.h files. Now present in the...
[betaflight.git] / src / main / target / LUX_RACE / target.h
blob44ef0818c2f77cf57bf70818ebb8f61eb50a06d0
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"
21 #define BOARD_HAS_VOLTAGE_DIVIDER
23 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT
25 #define LED0 PC15
26 #define LED1 PC14
27 #define LED2 PC13
29 #define BEEPER PB13
30 #define BEEPER_INVERTED
32 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOA
33 #define MPU6500_CS_GPIO GPIOA
34 #define MPU6500_CS_PIN PA4
35 #define MPU6500_SPI_INSTANCE SPI1
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
44 #define USABLE_TIMER_CHANNEL_COUNT 11
46 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
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_USART1
62 #define USE_USART2
63 #define USE_USART3
64 #define SERIAL_PORT_COUNT 4
66 #define UART1_TX_PIN GPIO_Pin_4
67 #define UART1_RX_PIN GPIO_Pin_5
68 #define UART1_GPIO GPIOC
69 #define UART1_GPIO_AF GPIO_AF_7
70 #define UART1_TX_PINSOURCE GPIO_PinSource4
71 #define UART1_RX_PINSOURCE GPIO_PinSource5
73 #define UART2_TX_PIN GPIO_Pin_14
74 #define UART2_RX_PIN GPIO_Pin_15
75 #define UART2_GPIO GPIOA
76 #define UART2_GPIO_AF GPIO_AF_7
77 #define UART2_TX_PINSOURCE GPIO_PinSource14
78 #define UART2_RX_PINSOURCE GPIO_PinSource15
80 #define UART3_TX_PIN GPIO_Pin_10
81 #define UART3_RX_PIN GPIO_Pin_11
82 #define UART3_GPIO GPIOB
83 #define UART3_GPIO_AF GPIO_AF_7
84 #define UART3_TX_PINSOURCE GPIO_PinSource10
85 #define UART3_RX_PINSOURCE GPIO_PinSource11
87 #define USE_I2C
88 #define I2C_DEVICE (I2CDEV_2)
90 #define USE_ADC
92 #define ADC_INSTANCE ADC1
93 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA1
94 #define ADC_DMA_CHANNEL DMA1_Channel1
96 #define VBAT_ADC_GPIO GPIOC
97 #define VBAT_ADC_GPIO_PIN GPIO_Pin_0
98 #define VBAT_ADC_CHANNEL ADC_Channel_6
100 #define CURRENT_METER_ADC_GPIO GPIOC
101 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
102 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_7
104 #define RSSI_ADC_GPIO GPIOC
105 #define RSSI_ADC_GPIO_PIN GPIO_Pin_2
106 #define RSSI_ADC_CHANNEL ADC_Channel_8
108 #define EXTERNAL1_ADC_GPIO GPIOC
109 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_3
110 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_9
112 #define LED_STRIP
114 #define LED_STRIP_TIMER TIM16
116 #define WS2811_GPIO GPIOA
117 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
118 #define WS2811_GPIO_AF GPIO_AF_1
119 #define WS2811_PIN GPIO_Pin_6 // TIM16_CH1
120 #define WS2811_PIN_SOURCE GPIO_PinSource6
121 #define WS2811_TIMER TIM16
122 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM16
123 #define WS2811_DMA_CHANNEL DMA1_Channel3
124 #define WS2811_IRQ DMA1_Channel3_IRQn
125 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
126 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
129 // MPU6500 interrupt
130 #define USE_EXTI
131 #define MPU_INT_EXTI PA5
132 //#define DEBUG_MPU_DATA_READY_INTERRUPT
133 #define USE_MPU_DATA_READY_SIGNAL
134 #define ENSURE_MPU_DATA_READY_IS_LOW
136 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
138 #define SPEKTRUM_BIND
139 // USART1, PC5
140 #define BIND_PIN PC5
142 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
144 // IO - assuming 303 in 64pin package, TODO
145 #define TARGET_IO_PORTA 0xffff
146 #define TARGET_IO_PORTB 0xffff
147 #define TARGET_IO_PORTC 0xffff
148 #define TARGET_IO_PORTD (BIT(2))
149 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
151 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(15))