Create release.yml
[betaflight.git] / src / main / target / REVONANO / target.h
blobec4270da4189d31e335f9fef2883c8a672309320
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #define USE_LATE_TASK_STATISTICS
25 #define TARGET_BOARD_IDENTIFIER "REVN"
27 #define USBD_PRODUCT_STRING "Revo Nano"
28 #ifdef OPBL
29 #define USBD_SERIALNUMBER_STRING "0x8010000"
30 #endif
32 #define LED0_PIN PC14
33 #define LED1_PIN PC13
35 #define USE_BEEPER
36 #define BEEPER_PIN PC13
38 #define GYRO_1_CS_PIN PB12
39 #define GYRO_1_SPI_INSTANCE SPI2
41 #define USE_ACC
42 #define USE_ACC_SPI_MPU9250
44 #define USE_GYRO
45 #define USE_GYRO_SPI_MPU9250
46 #define GYRO_1_ALIGN CW270_DEG
48 #define USE_BARO
49 #define USE_BARO_MS5611
51 #define USE_MAG
52 #define USE_MAG_AK8963
53 #define USE_MAG_MPU925X_AK8963
55 // MPU6500 interrupts
56 #define USE_EXTI
57 #define USE_GYRO_EXTI
58 #define GYRO_1_EXTI_PIN PA15
59 #define USE_MPU_DATA_READY_SIGNAL
61 #define USE_VCP
62 #define USE_USB_DETECT
63 //#define USB_DETECT_PIN PA9
65 // The Flexi Port can be used for either UART1 or I2CDEV_1, see I2C section below
66 #define USE_UART1 // Flexi Port
67 #define UART1_RX_PIN PB7
68 #define UART1_TX_PIN PB6
69 #define PINIO1_PIN PB10 // DTR pin
71 #define USE_UART2 // Main Port
72 #define UART2_RX_PIN PA3
73 #define UART2_TX_PIN PA2
74 #define INVERTER_PIN_UART2 PC15 //Sbus on USART 2 of nano.
76 #define USE_SOFTSERIAL1
77 #define USE_SOFTSERIAL2
79 #define SERIAL_PORT_COUNT 5
81 #define USE_ESCSERIAL
82 #define ESCSERIAL_TIMER_TX_PIN PB10 // (HARDARE=0,PPM)
84 #define USE_SPI
85 #define USE_SPI_DEVICE_2
87 #define USE_I2C
88 /* The Flexi Port can be used for either UART1 or I2CDEV_1
89 * I2C resources undefined by default
90 * To use I2C use the following CLI commands:
91 * resource SERIAL_RX 1 NONE
92 * resource SERIAL_TX 1 NONE
93 * resource I2C1_SCL 1 PB6
94 * resource I2C1_SDA 1 PB7
96 #define USE_I2C_DEVICE_1 // UART1/FlexiPort (PB6,PB7)
97 #define I2C_DEVICE I2CDEV_1
98 #define I2C1_SCL NONE // Define as PB6 if required
99 #define I2C1_SDA NONE // Define as PB7 if required
100 #define USE_I2C_DEVICE_3
101 #define I2C3_SCL PA8
102 #define I2C3_SDA PB4
103 #define BARO_I2C_INSTANCE I2CDEV_3
105 #undef USE_LED_STRIP
107 #define USE_ADC
108 #define CURRENT_METER_ADC_PIN PA7
109 #define VBAT_ADC_PIN PA6
110 #define RSSI_ADC_PIN PA5
112 #define TARGET_IO_PORTA 0xffff
113 #define TARGET_IO_PORTB 0xffff
114 #define TARGET_IO_PORTC (BIT(13) | BIT(14) | BIT(15))
116 #define USABLE_TIMER_CHANNEL_COUNT 12
117 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) )