Added common target header file.
[betaflight.git] / src / main / target / RMDO / target.h
blobaa523bfba295f88b262425ab69ec95d01a2ca309
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 "RMDO" // Ready Made RC DoDo
22 #define LED0_GPIO GPIOB
23 #define LED0_PIN Pin_3
24 #define LED0_PERIPHERAL RCC_AHBPeriph_GPIOB
26 #define BEEP_GPIO GPIOC
27 #define BEEP_PIN Pin_15
28 #define BEEP_PERIPHERAL RCC_AHBPeriph_GPIOC
29 #define BEEPER_INVERTED
31 #define USABLE_TIMER_CHANNEL_COUNT 17
33 #define EXTI_CALLBACK_HANDLER_COUNT 2 // MPU data ready and MAG data ready
35 #define USE_MPU_DATA_READY_SIGNAL
36 #define ENSURE_MPU_DATA_READY_IS_LOW
38 #define USE_MAG_DATA_READY_SIGNAL
39 #define ENSURE_MAG_DATA_READY_IS_HIGH
42 #define GYRO
43 #define USE_GYRO_MPU6050
44 #define GYRO_MPU6050_ALIGN CW270_DEG
46 #define ACC
47 #define USE_ACC_MPU6050
48 #define ACC_MPU6050_ALIGN CW270_DEG
50 #define BARO
51 #define USE_BARO_BMP280
53 #define MAG
54 #define USE_MAG_AK8975
55 #define USE_MAG_HMC5883
56 #define USE_MAG_MAG3110
58 #define USE_FLASHFS
59 #define USE_FLASH_M25P16
61 #define SONAR
62 #define SONAR_TRIGGER_PIN Pin_0 // RC_CH7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
63 #define SONAR_TRIGGER_GPIO GPIOB
64 #define SONAR_ECHO_PIN Pin_1 // RC_CH8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
65 #define SONAR_ECHO_GPIO GPIOB
66 #define SONAR_EXTI_LINE EXTI_Line1
67 #define SONAR_EXTI_PIN_SOURCE EXTI_PinSource1
68 #define SONAR_EXTI_IRQN EXTI1_IRQn
70 #define BEEPER
71 #define LED0
73 #define USE_USART1
74 #define USE_USART2
75 #define USE_USART3
76 #define USE_SOFTSERIAL1
77 #define USE_SOFTSERIAL2
78 #define SERIAL_PORT_COUNT 5
80 #ifndef UART1_GPIO
81 #define UART1_TX_PIN GPIO_Pin_9 // PA9
82 #define UART1_RX_PIN GPIO_Pin_10 // PA10
83 #define UART1_GPIO GPIOA
84 #define UART1_GPIO_AF GPIO_AF_7
85 #define UART1_TX_PINSOURCE GPIO_PinSource9
86 #define UART1_RX_PINSOURCE GPIO_PinSource10
87 #endif
89 #define UART2_TX_PIN GPIO_Pin_14 // PA14 / SWCLK
90 #define UART2_RX_PIN GPIO_Pin_15 // PA15
91 #define UART2_GPIO GPIOA
92 #define UART2_GPIO_AF GPIO_AF_7
93 #define UART2_TX_PINSOURCE GPIO_PinSource14
94 #define UART2_RX_PINSOURCE GPIO_PinSource15
96 #ifndef UART3_GPIO
97 #define UART3_TX_PIN GPIO_Pin_10 // PB10 (AF7)
98 #define UART3_RX_PIN GPIO_Pin_11 // PB11 (AF7)
99 #define UART3_GPIO_AF GPIO_AF_7
100 #define UART3_GPIO GPIOB
101 #define UART3_TX_PINSOURCE GPIO_PinSource10
102 #define UART3_RX_PINSOURCE GPIO_PinSource11
103 #endif
105 #define SOFTSERIAL_1_TIMER TIM3
106 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
107 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
108 #define SOFTSERIAL_2_TIMER TIM3
109 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
110 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
112 #define USE_I2C
113 #define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
115 #define USE_SPI
116 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
118 #define SPI2_GPIO GPIOB
119 #define SPI2_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
120 #define SPI2_NSS_PIN Pin_12
121 #define SPI2_NSS_PIN_SOURCE GPIO_PinSource12
122 #define SPI2_SCK_PIN Pin_13
123 #define SPI2_SCK_PIN_SOURCE GPIO_PinSource13
124 #define SPI2_MISO_PIN Pin_14
125 #define SPI2_MISO_PIN_SOURCE GPIO_PinSource14
126 #define SPI2_MOSI_PIN Pin_15
127 #define SPI2_MOSI_PIN_SOURCE GPIO_PinSource15
129 #define M25P16_CS_GPIO GPIOB
130 #define M25P16_CS_PIN GPIO_Pin_12
131 #define M25P16_SPI_INSTANCE SPI2
133 #define USE_ADC
134 #define BOARD_HAS_VOLTAGE_DIVIDER
137 #define ADC_INSTANCE ADC2
138 #define ADC_DMA_CHANNEL DMA2_Channel1
139 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA2
141 #define VBAT_ADC_GPIO GPIOA
142 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
143 #define VBAT_ADC_CHANNEL ADC_Channel_1
145 #define CURRENT_METER_ADC_GPIO GPIOA
146 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_5
147 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_2
149 #define RSSI_ADC_GPIO GPIOB
150 #define RSSI_ADC_GPIO_PIN GPIO_Pin_2
151 #define RSSI_ADC_CHANNEL ADC_Channel_12
153 #define LED_STRIP
154 #define LED_STRIP_TIMER TIM1
156 #define USE_LED_STRIP_ON_DMA1_CHANNEL2
157 #define WS2811_GPIO GPIOA
158 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
159 #define WS2811_GPIO_AF GPIO_AF_6
160 #define WS2811_PIN GPIO_Pin_8
161 #define WS2811_PIN_SOURCE GPIO_PinSource8
162 #define WS2811_TIMER TIM1
163 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM1
164 #define WS2811_DMA_CHANNEL DMA1_Channel2
165 #define WS2811_IRQ DMA1_Channel2_IRQn
167 #define GPS
168 #define GPS_PROTO_NMEA
169 #define GPS_PROTO_UBLOX
170 #define GPS_PROTO_I2C_NAV
171 //#define GPS_PROTO_NAZA
173 #define NAV
174 //#define NAV_AUTO_MAG_DECLINATION
175 #define NAV_GPS_GLITCH_DETECTION
177 #define BLACKBOX
178 #define TELEMETRY
179 #define TELEMETRY_FRSKY
180 //#define TELEMETRY_HOTT
181 //#define TELEMETRY_SMARTPORT
182 #define TELEMETRY_LTM
184 #define SERIAL_RX
186 #define USE_SERVOS
187 #define USE_CLI
189 #define SPEKTRUM_BIND
190 // USART3,
191 #define BIND_PORT GPIOB
192 #define BIND_PIN Pin_11
194 #define USE_SERIAL_4WAY_BLHELI_INTERFACE