SPRACINGF3EVO board support (#266)
[betaflight.git] / src / main / target / COLIBRI_RACE / target.h
blob8e06d9a4c07e44ffe1eca8673b587f4dddacb7c7
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 "CLBR"
22 #define LED0 PC15
23 #define LED1 PC14
24 #define LED2 PC13
26 #define BEEPER PB13
27 #define BEEPER_INVERTED
29 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOA
30 #define MPU6500_CS_GPIO GPIOA
31 #define MPU6500_CS_PIN GPIO_Pin_4
32 #define MPU6500_SPI_INSTANCE SPI1
34 #define MPU6000_CS_GPIO GPIOA
35 #define MPU6000_CS_PIN GPIO_Pin_4
36 #define MPU6000_SPI_INSTANCE SPI1
38 #define USE_SPI
39 #define USE_SPI_DEVICE_1
41 #define SPI1_GPIO GPIOB
42 #define SPI1_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
43 #define SPI1_SCK_PIN GPIO_Pin_3
44 #define SPI1_SCK_PIN_SOURCE GPIO_PinSource3
45 #define SPI1_MISO_PIN GPIO_Pin_4
46 #define SPI1_MISO_PIN_SOURCE GPIO_PinSource4
47 #define SPI1_MOSI_PIN GPIO_Pin_5
48 #define SPI1_MOSI_PIN_SOURCE GPIO_PinSource5
50 #define USABLE_TIMER_CHANNEL_COUNT 11
52 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
54 #define GYRO
55 #define USE_GYRO_MPU6500
56 #define USE_GYRO_SPI_MPU6500
57 #define GYRO_MPU6500_ALIGN CW270_DEG
59 #define ACC
60 #define USE_ACC_MPU6500
61 #define USE_ACC_SPI_MPU6500
62 #define ACC_MPU6500_ALIGN CW270_DEG
64 #define BARO
65 #define USE_BARO_MS5611
67 #define MAG
68 #define USE_MPU9250_MAG // Bypass enable
69 #define USE_MAG_HMC5883
70 #define USE_MAG_AK8975
72 #define USE_VCP
73 #define USE_USART1
74 #define USE_USART2
75 #define USE_USART3
76 #define SERIAL_PORT_COUNT 4
78 #define UART1_TX_PIN GPIO_Pin_4
79 #define UART1_RX_PIN GPIO_Pin_5
80 #define UART1_GPIO GPIOC
81 #define UART1_GPIO_AF GPIO_AF_7
82 #define UART1_TX_PINSOURCE GPIO_PinSource4
83 #define UART1_RX_PINSOURCE GPIO_PinSource5
85 #define UART2_TX_PIN GPIO_Pin_14
86 #define UART2_RX_PIN GPIO_Pin_15
87 #define UART2_GPIO GPIOA
88 #define UART2_GPIO_AF GPIO_AF_7
89 #define UART2_TX_PINSOURCE GPIO_PinSource14
90 #define UART2_RX_PINSOURCE GPIO_PinSource15
92 #define UART3_TX_PIN GPIO_Pin_10
93 #define UART3_RX_PIN GPIO_Pin_11
94 #define UART3_GPIO GPIOB
95 #define UART3_GPIO_AF GPIO_AF_7
96 #define UART3_TX_PINSOURCE GPIO_PinSource10
97 #define UART3_RX_PINSOURCE GPIO_PinSource11
99 #define USE_I2C
100 #define I2C_DEVICE (I2CDEV_2)
102 #define I2C2_SCL_GPIO GPIOA
103 #define I2C2_SCL_GPIO_AF GPIO_AF_4
104 #define I2C2_SCL_PIN GPIO_Pin_9
105 #define I2C2_SCL_PIN_SOURCE GPIO_PinSource9
106 #define I2C2_SCL_CLK_SOURCE RCC_AHBPeriph_GPIOA
107 #define I2C2_SDA_GPIO GPIOA
108 #define I2C2_SDA_GPIO_AF GPIO_AF_4
109 #define I2C2_SDA_PIN GPIO_Pin_10
110 #define I2C2_SDA_PIN_SOURCE GPIO_PinSource10
111 #define I2C2_SDA_CLK_SOURCE RCC_AHBPeriph_GPIOA
113 #define USE_ADC
114 #define ADC_INSTANCE ADC1
115 #define VBAT_ADC_PIN PC0
116 #define CURRENT_METER_ADC_PIN PC1
117 #define RSSI_ADC_PIN PC2
118 #define EXTERNAL1_ADC_PIN PC3
121 #define LED_STRIP
122 #define LED_STRIP_TIMER TIM16
124 #define USE_LED_STRIP_ON_DMA1_CHANNEL3
125 #define WS2811_GPIO GPIOA
126 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
127 #define WS2811_GPIO_AF GPIO_AF_1
128 #define WS2811_PIN GPIO_Pin_6 // TIM16_CH1
129 #define WS2811_PIN_SOURCE GPIO_PinSource6
130 #define WS2811_TIMER TIM16
131 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM16
132 #define WS2811_DMA_CHANNEL DMA1_Channel3
133 #define WS2811_IRQ DMA1_Channel3_IRQn
135 // MPU6500 interrupt
136 //#define DEBUG_MPU_DATA_READY_INTERRUPT
137 #define USE_MPU_DATA_READY_SIGNAL
138 #define ENSURE_MPU_DATA_READY_IS_LOW
140 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
142 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
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))