Ensure that we don't initialise more motors than are defined in target.h. Make MAX_PW...
[betaflight.git] / src / main / target / COLIBRI_RACE / target.h
blob167c43b20304c804282f75ec0a3d8c112e03b360
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 // MPU6500 interrupt
30 #define USE_EXTI
31 #define MPU_INT_EXTI PA5
32 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
33 #define USE_MPU_DATA_READY_SIGNAL
34 #define ENSURE_MPU_DATA_READY_IS_LOW
35 //#define DEBUG_MPU_DATA_READY_INTERRUPT
37 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOA
38 #define MPU6500_CS_PIN PA4
39 #define MPU6500_SPI_INSTANCE SPI1
41 #define MPU6000_CS_PIN PA4
42 #define MPU6000_SPI_INSTANCE SPI1
44 #define USE_SPI
45 #define USE_SPI_DEVICE_1
47 #define SPI1_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
48 #define SPI1_SCK_PIN PB3
49 #define SPI1_MISO_PIN PB4
50 #define SPI1_MOSI_PIN PB5
52 #define GYRO
53 #define USE_GYRO_MPU6500
54 #define USE_GYRO_SPI_MPU6500
55 #define GYRO_MPU6500_ALIGN CW270_DEG
57 #define ACC
58 #define USE_ACC_MPU6500
59 #define USE_ACC_SPI_MPU6500
60 #define ACC_MPU6500_ALIGN CW270_DEG
62 #define BARO
63 #define USE_BARO_MS5611
65 #define MAG
66 #define USE_MPU9250_MAG // Bypass enable
67 #define USE_MAG_HMC5883
68 #define USE_MAG_AK8975
70 #define USE_VCP
71 #define USE_UART1
72 #define USE_UART2
73 #define USE_UART3
74 #define SERIAL_PORT_COUNT 4
76 #define UART1_TX_PIN PC4
77 #define UART1_RX_PIN PC5
79 #define UART2_TX_PIN PA14
80 #define UART2_RX_PIN PA15
82 #define UART3_TX_PIN PB10
83 #define UART3_RX_PIN PB11
85 #define USE_I2C
86 #define I2C_DEVICE (I2CDEV_2)
88 #define I2C2_SCL_PIN PA9
89 #define I2C2_SDA_PIN PA10
91 #define USE_ADC
92 #define ADC_INSTANCE ADC1
93 #define VBAT_ADC_PIN PC0
94 #define CURRENT_METER_ADC_PIN PC1
95 #define RSSI_ADC_PIN PC2
96 #define EXTERNAL1_ADC_PIN PC3
98 #define LED_STRIP
99 #define USE_COLIBTI_RACE_LED_DEFAULT_CONFIG
101 #define WS2811_PIN PA6 // TIM16_CH1
102 #define WS2811_TIMER TIM16
103 #define WS2811_DMA_CHANNEL DMA1_Channel3
104 #define WS2811_IRQ DMA1_Channel3_IRQn
105 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
106 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
108 #define DEFAULT_FEATURES FEATURE_VBAT
109 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
110 #define SERIALRX_PROVIDER SERIALRX_SBUS
111 #define SERIALRX_UART SERIAL_PORT_USART3
113 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
115 // Number of available PWM outputs
116 #define MAX_PWM_OUTPUT_PORTS 10
118 // IO - assuming 303 in 64pin package, TODO
119 #define TARGET_IO_PORTA 0xffff
120 #define TARGET_IO_PORTB 0xffff
121 #define TARGET_IO_PORTC 0xffff
122 #define TARGET_IO_PORTD (BIT(2))
123 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
125 #define USABLE_TIMER_CHANNEL_COUNT 11
126 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(15))