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/>.
20 #define TARGET_BOARD_IDENTIFIER "DOGE"
22 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT
34 #define BEEPER_INVERTED
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
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
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
55 #define SPI1_SCK_PIN PB3
56 #define SPI1_SCK_PIN_SOURCE GPIO_PinSource3
58 #define SPI1_MISO_PIN PB4
59 #define SPI1_MISO_PIN_SOURCE GPIO_PinSource4
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
67 #define SPI2_SCK_PIN PB13
68 #define SPI2_SCK_PIN_SOURCE GPIO_PinSource13
70 #define SPI2_MISO_PIN PB14
71 #define SPI2_MISO_PIN_SOURCE GPIO_PinSource14
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
82 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
85 // #define USE_FAKE_GYRO
86 #define USE_GYRO_MPU6500
87 #define USE_GYRO_SPI_MPU6500
88 #define GYRO_MPU6500_ALIGN CW270_DEG // ??
91 // #define USE_FAKE_ACC
92 #define USE_ACC_MPU6500
93 #define USE_ACC_SPI_MPU6500
94 #define ACC_MPU6500_ALIGN CW270_DEG // ??
97 #define USE_BARO_BMP280
98 #define USE_BARO_SPI_BMP280
105 #define SERIAL_PORT_COUNT 4
108 #define UART1_TX_PIN GPIO_Pin_6
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
117 #define UART2_TX_PIN GPIO_Pin_2
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
126 #define UART3_TX_PIN GPIO_Pin_10
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
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
142 #define VBAT_ADC_GPIO GPIOA
143 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
144 #define VBAT_ADC_CHANNEL ADC_Channel_1
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
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
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)