Fixed CONFIG_FASTLOOP_PREFERRED_ACC related magic numbers
[betaflight.git] / src / main / target / DOGE / target.h
blob0fca6bf1e62a105760872711575e2abfba480e48
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 "DOGE"
22 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT
24 // tqfp48 pin 34
25 #define LED0 PA13
27 // tqfp48 pin 37
28 #define LED1 PA14
30 // tqfp48 pin 38
31 #define LED2 PA15
33 #define BEEPER PB2
34 #define BEEPER_INVERTED
36 // tqfp48 pin 3
37 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOC
38 #define MPU6500_CS_GPIO GPIOC
39 #define MPU6500_CS_PIN PC14
40 #define MPU6500_SPI_INSTANCE SPI1
42 // tqfp48 pin 25
43 #define BMP280_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOB
44 #define BMP280_CS_GPIO GPIOB
45 #define BMP280_CS_PIN GPIO_Pin_12
46 #define BMP280_SPI_INSTANCE SPI2
48 #define USE_SPI
49 #define USE_SPI_DEVICE_1
50 #define USE_SPI_DEVICE_2
52 #define SPI1_GPIO GPIOB
53 #define SPI1_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
54 // tqfp48 pin 39
55 #define SPI1_SCK_PIN PB3
56 #define SPI1_SCK_PIN_SOURCE GPIO_PinSource3
57 // tqfp48 pin 40
58 #define SPI1_MISO_PIN PB4
59 #define SPI1_MISO_PIN_SOURCE GPIO_PinSource4
60 // tqfp48 pin 41
61 #define SPI1_MOSI_PIN PB5
62 #define SPI1_MOSI_PIN_SOURCE GPIO_PinSource5
64 #define SPI2_GPIO GPIOB
65 #define SPI2_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
66 // tqfp48 pin 26
67 #define SPI2_SCK_PIN PB13
68 #define SPI2_SCK_PIN_SOURCE GPIO_PinSource13
69 // tqfp48 pin 27
70 #define SPI2_MISO_PIN PB14
71 #define SPI2_MISO_PIN_SOURCE GPIO_PinSource14
72 // tqfp48 pin 28
73 #define SPI2_MOSI_PIN PB15
74 #define SPI2_MOSI_PIN_SOURCE GPIO_PinSource15
76 // timer definitions in drivers/timer.c
77 // channel mapping in drivers/pwm_mapping.c
78 // only 6 outputs available on hardware
79 #define USABLE_TIMER_CHANNEL_COUNT 9
81 #define USE_ESCSERIAL
82 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
84 #define GYRO
85 // #define USE_FAKE_GYRO
86 #define USE_GYRO_MPU6500
87 #define USE_GYRO_SPI_MPU6500
88 #define GYRO_MPU6500_ALIGN CW270_DEG // ??
90 #define ACC
91 // #define USE_FAKE_ACC
92 #define USE_ACC_MPU6500
93 #define USE_ACC_SPI_MPU6500
94 #define ACC_MPU6500_ALIGN CW270_DEG // ??
96 #define BARO
97 #define USE_BARO_BMP280
98 #define USE_BARO_SPI_BMP280
100 #define USB_IO
101 #define USE_VCP
102 #define USE_USART1
103 #define USE_USART2
104 #define USE_USART3
105 #define SERIAL_PORT_COUNT 4
107 // tqfp48 pin 42
108 #define UART1_TX_PIN GPIO_Pin_6
109 // tqfp48 pin 43
110 #define UART1_RX_PIN GPIO_Pin_7
111 #define UART1_GPIO GPIOB
112 #define UART1_GPIO_AF GPIO_AF_7
113 #define UART1_TX_PINSOURCE GPIO_PinSource6
114 #define UART1_RX_PINSOURCE GPIO_PinSource7
116 // tqfp48 pin 12
117 #define UART2_TX_PIN GPIO_Pin_2
118 // tqfp48 pin 13
119 #define UART2_RX_PIN GPIO_Pin_3
120 #define UART2_GPIO GPIOA
121 #define UART2_GPIO_AF GPIO_AF_7
122 #define UART2_TX_PINSOURCE GPIO_PinSource2
123 #define UART2_RX_PINSOURCE GPIO_PinSource3
125 // tqfp48 pin 21
126 #define UART3_TX_PIN GPIO_Pin_10
127 // tqfp48 pin 22
128 #define UART3_RX_PIN GPIO_Pin_11
129 #define UART3_GPIO GPIOB
130 #define UART3_GPIO_AF GPIO_AF_7
131 #define UART3_TX_PINSOURCE GPIO_PinSource10
132 #define UART3_RX_PINSOURCE GPIO_PinSource11
134 #define USE_ADC
135 #define BOARD_HAS_VOLTAGE_DIVIDER
137 #define ADC_INSTANCE ADC2
138 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA2
139 #define ADC_DMA_CHANNEL DMA2_Channel1
141 // tqfp48 pin 14
142 #define VBAT_ADC_GPIO GPIOA
143 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
144 #define VBAT_ADC_CHANNEL ADC_Channel_1
146 // tqfp48 pin 15
147 #define CURRENT_METER_ADC_GPIO GPIOA
148 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_5
149 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_2
151 // mpu_int definition in sensors/initialisation.c
152 #define USE_EXTI
153 #define MPU_INT_EXTI PC13
154 //#define DEBUG_MPU_DATA_READY_INTERRUPT
155 #define USE_MPU_DATA_READY_SIGNAL
156 #define ENSURE_MPU_DATA_READY_IS_LOW
158 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
160 #define LED_STRIP
162 // tqfp48 pin 16
163 #define LED_STRIP_TIMER TIM16
164 #define USE_LED_STRIP_ON_DMA1_CHANNEL3
165 #define WS2811_GPIO GPIOA
166 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
167 #define WS2811_GPIO_AF GPIO_AF_1
168 #define WS2811_PIN GPIO_Pin_6 // TIM16_CH1
169 #define WS2811_PIN_SOURCE GPIO_PinSource6
170 #define WS2811_TIMER TIM16
171 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM16
172 #define WS2811_DMA_CHANNEL DMA1_Channel3
173 #define WS2811_IRQ DMA1_Channel3_IRQn
174 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
175 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
177 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
179 #define SPEKTRUM_BIND
180 // Use UART3 for speksat
181 #define BIND_PIN PB11
183 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
185 // !!TODO - check the TARGET_IO_PORTs are correct
186 #define TARGET_IO_PORTA 0xffff
187 #define TARGET_IO_PORTB 0xffff
188 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
189 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
191 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(15))
193 #define TIMER_APB1_PERIPHERALS (RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM4)
194 #define TIMER_APB2_PERIPHERALS (RCC_APB2Periph_TIM1 | RCC_APB2Periph_TIM15)
195 #define TIMER_AHB_PERIPHERALS (RCC_AHBPeriph_GPIOA | RCC_AHBPeriph_GPIOB)