Added common target header file.
[betaflight.git] / src / main / target / ALIENWIIF3 / target.h
blob9e7c28923c6811111b3634c3078aef25cc747bd4
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 "AWF3" // AlienWii32 F3.
22 #define LED0_GPIO GPIOB
23 #define LED0_PIN Pin_4 // Blue LEDs - PB4
24 #define LED0_PERIPHERAL RCC_AHBPeriph_GPIOB
25 #define LED1_GPIO GPIOB
26 #define LED1_PIN Pin_5 // Green LEDs - PB5
27 #define LED1_PERIPHERAL RCC_AHBPeriph_GPIOB
28 #define BEEP_GPIO GPIOA
29 #define BEEP_PIN Pin_5 // White LEDs - PA5
30 #define BEEP_PERIPHERAL RCC_AHBPeriph_GPIOA
32 #define USABLE_TIMER_CHANNEL_COUNT 11
34 // Using MPU6050 for the moment.
35 #define GYRO
36 #define USE_GYRO_MPU6050
38 #define GYRO_MPU6050_ALIGN CW270_DEG
40 #define ACC
41 #define USE_ACC_MPU6050
43 #define ACC_MPU6050_ALIGN CW270_DEG
45 // No baro support.
46 //#define BARO
47 //#define USE_BARO_MS5611
49 // No mag support for now (option to use MPU9150 in the future).
50 //#define MAG
51 //#define USE_MAG_AK8975
53 #define MAG_AK8975_ALIGN CW0_DEG_FLIP
55 #define BEEPER
56 #define LED0
57 #define LED1
59 #define USE_VCP
60 #define USE_USART1 // Not connected - TX (PB6) RX PB7 (AF7)
61 #define USE_USART2 // Receiver - RX (PA3)
62 #define USE_USART3 // Not connected - 10/RX (PB11) 11/TX (PB10)
63 #define SERIAL_PORT_COUNT 4
65 #define UART1_TX_PIN GPIO_Pin_6 // PB6
66 #define UART1_RX_PIN GPIO_Pin_7 // PB7
67 #define UART1_GPIO GPIOB
68 #define UART1_GPIO_AF GPIO_AF_7
69 #define UART1_TX_PINSOURCE GPIO_PinSource6
70 #define UART1_RX_PINSOURCE GPIO_PinSource7
72 #define UART2_TX_PIN GPIO_Pin_2 // PA2
73 #define UART2_RX_PIN GPIO_Pin_3 // PA3
74 #define UART2_GPIO GPIOA
75 #define UART2_GPIO_AF GPIO_AF_7
76 #define UART2_TX_PINSOURCE GPIO_PinSource2
77 #define UART2_RX_PINSOURCE GPIO_PinSource3
79 #define UART3_TX_PIN GPIO_Pin_10 // PB10 (AF7)
80 #define UART3_RX_PIN GPIO_Pin_11 // PB11 (AF7)
81 #define UART3_GPIO_AF GPIO_AF_7
82 #define UART3_GPIO GPIOB
83 #define UART3_TX_PINSOURCE GPIO_PinSource10
84 #define UART3_RX_PINSOURCE GPIO_PinSource11
87 #define USE_I2C
88 #define I2C_DEVICE (I2CDEV_2) // SDA (PA10/AF4), SCL (PA9/AF4)
90 #define I2C2_SCL_GPIO GPIOA
91 #define I2C2_SCL_GPIO_AF GPIO_AF_4
92 #define I2C2_SCL_PIN GPIO_Pin_9
93 #define I2C2_SCL_PIN_SOURCE GPIO_PinSource9
94 #define I2C2_SCL_CLK_SOURCE RCC_AHBPeriph_GPIOA
95 #define I2C2_SDA_GPIO GPIOA
96 #define I2C2_SDA_GPIO_AF GPIO_AF_4
97 #define I2C2_SDA_PIN GPIO_Pin_10
98 #define I2C2_SDA_PIN_SOURCE GPIO_PinSource10
99 #define I2C2_SDA_CLK_SOURCE RCC_AHBPeriph_GPIOA
101 #define USE_ADC
103 #define ADC_INSTANCE ADC2
104 #define ADC_DMA_CHANNEL DMA2_Channel1
105 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA2
107 //#define BOARD_HAS_VOLTAGE_DIVIDER
109 #define VBAT_ADC_GPIO GPIOA
110 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
111 #define VBAT_ADC_CHANNEL ADC_Channel_1
113 //#define BLACKBOX
114 #define SERIAL_RX
115 //#define GPS
116 //#define GPS_PROTO_NMEA
117 //#define GPS_PROTO_UBLOX
118 //#define GPS_PROTO_I2C_NAV
119 //#define GPS_PROTO_NAZA
121 #define USE_SERVOS
122 #define USE_CLI
124 #define SPEKTRUM_BIND
125 // USART2, PA3
126 #define BIND_PORT GPIOA
127 #define BIND_PIN Pin_3
129 // alternative defaults for AlienWii32 F3 target
130 #define ALIENWII32
131 #define HARDWARE_BIND_PLUG
133 // Hardware bind plug at PB12 (Pin 25)
134 #define BINDPLUG_PORT GPIOB
135 #define BINDPLUG_PIN Pin_12