Disable certain features on some targets to fit in FLASH
[betaflight.git] / src / main / target / NAZE / target.h
blobffc6f73742d0a5ac759777d4392d6c96eebea99a
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 "AFNA" // AFroNAze - NAZE might be considered misleading on Naze clones like the flip32.
21 #define USE_HARDWARE_REVISION_DETECTION
23 #define BOARD_HAS_VOLTAGE_DIVIDER
25 #define LED0_GPIO GPIOB
26 #define LED0_PIN Pin_3 // PB3 (LED)
27 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOB
28 #define LED1_GPIO GPIOB
29 #define LED1_PIN Pin_4 // PB4 (LED)
30 #define LED1_PERIPHERAL RCC_APB2Periph_GPIOB
32 #define BEEP_GPIO GPIOA
33 #define BEEP_PIN Pin_12 // PA12 (Beeper)
34 #define BEEP_PERIPHERAL RCC_APB2Periph_GPIOA
36 #define BARO_XCLR_GPIO GPIOC
37 #define BARO_XCLR_PIN Pin_13
38 #define BARO_EOC_GPIO GPIOC
39 #define BARO_EOC_PIN Pin_14
40 #define BARO_APB2_PERIPHERALS RCC_APB2Periph_GPIOC
42 #define INVERTER_PIN Pin_2 // PB2 (BOOT1) abused as inverter select GPIO
43 #define INVERTER_GPIO GPIOB
44 #define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
45 #define INVERTER_USART USART2
47 // SPI2
48 // PB15 28 SPI2_MOSI
49 // PB14 27 SPI2_MISO
50 // PB13 26 SPI2_SCK
51 // PB12 25 SPI2_NSS
53 #define USE_SPI
54 #define USE_SPI_DEVICE_2
56 #define NAZE_SPI_INSTANCE SPI2
57 #define NAZE_SPI_CS_GPIO GPIOB
58 #define NAZE_SPI_CS_PIN GPIO_Pin_12
59 #define NAZE_CS_GPIO_CLK_PERIPHERAL RCC_APB2Periph_GPIOB
61 // We either have this 16mbit flash chip on SPI or the MPU6500 acc/gyro depending on board revision:
62 #define M25P16_CS_GPIO NAZE_SPI_CS_GPIO
63 #define M25P16_CS_PIN NAZE_SPI_CS_PIN
64 #define M25P16_SPI_INSTANCE NAZE_SPI_INSTANCE
66 #define MPU6500_CS_GPIO_CLK_PERIPHERAL NAZE_CS_GPIO_CLK_PERIPHERAL
67 #define MPU6500_CS_GPIO NAZE_SPI_CS_GPIO
68 #define MPU6500_CS_PIN NAZE_SPI_CS_PIN
69 #define MPU6500_SPI_INSTANCE NAZE_SPI_INSTANCE
72 #define USE_FLASHFS
74 #define USE_FLASH_M25P16
76 #define EXTI_CALLBACK_HANDLER_COUNT 3 // MPU data ready, MAG data ready, BMP085 EOC
78 //#define DEBUG_MPU_DATA_READY_INTERRUPT
79 #define USE_MPU_DATA_READY_SIGNAL
81 //#define DEBUG_MAG_DATA_READY_INTERRUPT
82 #define USE_MAG_DATA_READY_SIGNAL
84 #define GYRO
85 #define USE_GYRO_MPU3050
86 #define USE_GYRO_MPU6050
87 #define USE_GYRO_MPU6500
88 #define USE_GYRO_SPI_MPU6500
91 #define GYRO_MPU3050_ALIGN CW0_DEG
92 #define GYRO_MPU6050_ALIGN CW0_DEG
93 #define GYRO_MPU6500_ALIGN CW0_DEG
95 #define ACC
96 #define USE_ACC_ADXL345
97 //#define USE_ACC_BMA280
98 //#define USE_ACC_MMA8452
99 #define USE_ACC_MPU6050
100 #define USE_ACC_MPU6500
101 #define USE_ACC_SPI_MPU6500
103 #define ACC_ADXL345_ALIGN CW270_DEG
104 #define ACC_MPU6050_ALIGN CW0_DEG
105 #define ACC_MMA8452_ALIGN CW90_DEG
106 #define ACC_BMA280_ALIGN CW0_DEG
107 #define ACC_MPU6500_ALIGN CW0_DEG
109 #define BARO
110 #define USE_BARO_MS5611
111 #define USE_BARO_BMP085
112 #define USE_BARO_BMP280
114 #define MAG
115 #define USE_MAG_HMC5883
116 #define USE_MAG_AK8975
117 #define USE_MAG_MAG3110
119 #define MAG_HMC5883_ALIGN CW180_DEG
121 #define SONAR
122 #define BEEPER
123 #define LED0
124 #define LED1
125 #define INVERTER
126 #define DISPLAY
127 #define DISPLAY_ARMED_BITMAP
129 #define USE_USART1
130 #define USE_USART2
131 #define USE_USART3
132 #define USE_SOFTSERIAL1
133 #define USE_SOFTSERIAL2
134 #define SERIAL_PORT_COUNT 5
136 #define SOFTSERIAL_1_TIMER TIM3
137 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
138 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
139 #define SOFTSERIAL_2_TIMER TIM3
140 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
141 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
143 // USART3 only on NAZE32_SP - Flex Port
144 #define USART3_RX_PIN Pin_11
145 #define USART3_TX_PIN Pin_10
146 #define USART3_GPIO GPIOB
147 #define USART3_APB1_PERIPHERALS RCC_APB1Periph_USART3
148 #define USART3_APB2_PERIPHERALS RCC_APB2Periph_GPIOB
150 #define USE_I2C
151 #define I2C_DEVICE (I2CDEV_2)
153 // #define SOFT_I2C // enable to test software i2c
154 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
155 // #define SOFT_I2C_PB67
157 #define USE_ADC
159 #define CURRENT_METER_ADC_GPIO GPIOB
160 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
161 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
163 #define VBAT_ADC_GPIO GPIOA
164 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
165 #define VBAT_ADC_CHANNEL ADC_Channel_4
167 #define RSSI_ADC_GPIO GPIOA
168 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
169 #define RSSI_ADC_CHANNEL ADC_Channel_1
171 #define EXTERNAL1_ADC_GPIO GPIOA
172 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
173 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
175 #define GPS
176 #define GPS_PROTO_NMEA
177 #define GPS_PROTO_UBLOX
178 #define GPS_PROTO_I2C_NAV
179 #define GPS_PROTO_NAZA
181 #define NAV
183 #define LED_STRIP
184 #define LED_STRIP_TIMER TIM3
186 #define BLACKBOX
187 #define TELEMETRY
188 //#define TELEMETRY_FRSKY
189 //#define TELEMETRY_HOTT
190 //#define TELEMETRY_SMARTPORT
191 #define TELEMETRY_LTM
193 #define SERIAL_RX
194 #define USE_SERVOS
195 #define USE_CLI
197 #define SKIP_CLI_COMMAND_HELP
199 #define SPEKTRUM_BIND
200 // USART2, PA3
201 #define BIND_PORT GPIOA
202 #define BIND_PIN Pin_3
204 //#define USE_SERIAL_4WAY_BLHELI_INTERFACE
206 // alternative defaults for AlienWii32 F1 target
207 #ifdef ALIENWII32
208 #undef TARGET_BOARD_IDENTIFIER
209 #define TARGET_BOARD_IDENTIFIER "AWF1" // AlienWii32 F1.
210 #undef BOARD_HAS_VOLTAGE_DIVIDER
211 #define HARDWARE_BIND_PLUG
213 // Hardware bind plug at PB5 (Pin 41)
214 #define BINDPLUG_PORT GPIOB
215 #define BINDPLUG_PIN Pin_5
216 #endif
218 #define DISABLE_UNCOMMON_MIXERS