2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 // XL chips has 0x800 page size
24 #define FLASH_PAGE_SIZE 0x800
26 // Limit some options that are not generally available for F1 targets to avoid non-F1 compatible code to get in
29 #undef USE_TRANSPONDER
30 #undef USE_CAMERA_CONTROL
32 #define TARGET_BOARD_IDENTIFIER "N1RG"
34 #define USE_TELEMETRY_IBUS
36 #define USE_TARGET_CONFIG
37 #define TARGET_VALIDATECONFIG
38 #define USE_HARDWARE_REVISION_DETECTION
39 #define TARGET_BUS_INIT
41 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
43 //#define LED0_PIN PB3
45 //#define LED1_PIN PB4
48 #define BEEPER_PIN PA12
50 //#define BARO_XCLR_PIN PC13
51 //#define BARO_EOC_PIN PC14
53 #define INVERTER_PIN_UART2 PB2 // PB2 (BOOT1) abused as inverter select GPIO
58 #define MAG_INT_EXTI PC14
60 #define GYRO_1_EXTI_PIN PC13
61 //#define MMA8451_INT_PIN PA5
63 #define USE_MPU_DATA_READY_SIGNAL
64 #define USE_MAG_DATA_READY_SIGNAL
67 #define USE_SPI_DEVICE_2
69 #define NAZE_SPI_INSTANCE SPI2
70 #define NAZE_SPI_CS_PIN PB12
72 // We either have this 16mbit flash chip on SPI or the MPU6500 acc/gyro depending on board revision:
73 #define FLASH_CS_PIN NAZE_SPI_CS_PIN
74 #define FLASH_SPI_INSTANCE NAZE_SPI_INSTANCE
76 #define GYRO_1_CS_PIN NAZE_SPI_CS_PIN
77 #define GYRO_1_SPI_INSTANCE NAZE_SPI_INSTANCE
80 #define USE_FLASH_M25P16
84 #define USE_GYRO_MPU3050
85 #define USE_GYRO_MPU6050
86 #define USE_GYRO_MPU6500
87 #define USE_GYRO_SPI_MPU6500
89 #define GYRO_1_ALIGN CW0_DEG
93 //#define USE_ACC_ADXL345
94 //#define USE_ACC_BMA280
95 //#define USE_ACC_MMA8452
96 #define USE_ACC_MPU6050
97 #define USE_ACC_MPU6500
98 #define USE_ACC_SPI_MPU6500
100 //#define ACC_ADXL345_ALIGN CW270_DEG
101 //#define ACC_MMA8452_ALIGN CW90_DEG
102 //#define ACC_BMA280_ALIGN CW0_DEG
105 #define USE_BARO_MS5611 // needed for Flip32 board
106 #define USE_BARO_BMP280
110 #define USE_MAG_HMC5883
111 #define MAG_HMC5883_ALIGN CW180_DEG
114 //#define USE_RANGEFINDER
115 //#define USE_RANGEFINDER_HCSR04
116 //#define RANGEFINDER_HCSR04_TRIGGER_PIN PB0
117 //#define RANGEFINDER_HCSR04_ECHO_PIN PB1
118 //#define RANGEFINDER_HCSR04_TRIGGER_PIN_PWM PB8
119 //#define RANGEFINDER_HCSR04_ECHO_PIN_PWM PB9
123 /* only 2 uarts available on the NAZE, add ifdef here if present on other boards */
125 #define USE_SOFTSERIAL1
126 #define USE_SOFTSERIAL2
127 #define SERIAL_PORT_COUNT 4
129 #define SOFTSERIAL1_RX_PIN PA6 // PWM 5
130 #define SOFTSERIAL1_TX_PIN PA7 // PWM 6
132 #define SOFTSERIAL2_RX_PIN PB0 // PWM 7
133 #define SOFTSERIAL2_TX_PIN PB1 // PWM 8
135 #define UART3_RX_PIN PB11
136 #define UART3_TX_PIN PB10
139 #define USE_I2C_DEVICE_2
140 #define I2C_DEVICE (I2CDEV_2)
142 // #define SOFT_I2C // enable to test software i2c
143 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
144 // #define SOFT_I2C_PB67
147 #define CURRENT_METER_ADC_PIN PB1
148 #define VBAT_ADC_PIN PA4
149 #define RSSI_ADC_PIN PA1
150 //#define EXTERNAL1_ADC_PIN PA5
152 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
154 // IO - assuming all IOs on 48pin package
155 #define TARGET_IO_PORTA 0xffff
156 #define TARGET_IO_PORTB 0xffff
157 #define TARGET_IO_PORTC ( BIT(13) | BIT(14) | BIT(15) )
159 #define USABLE_TIMER_CHANNEL_COUNT 14
160 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )