Ensure that we don't initialise more motors than are defined in target.h. Make MAX_PW...
[betaflight.git] / src / main / target / REVONANO / target.h
blobb562350f6bda902d91ed7f4ab0a5a742cb239ec8
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
19 #define TARGET_BOARD_IDENTIFIER "REVN"
21 #define CONFIG_START_FLASH_ADDRESS (0x08060000) //0x08060000 to 0x08080000 (FLASH_Sector_7)
23 #define USBD_PRODUCT_STRING "Revo Nano"
24 #ifdef OPBL
25 #define USBD_SERIALNUMBER_STRING "0x8010000"
26 #endif
28 #define LED0 PC14
29 #define LED1 PC13
31 #define BEEPER PC13
33 #define INVERTER PC15
34 #define INVERTER_USART USART2 //Sbus on USART 2 of nano.
36 // MPU9250 interrupts
37 #define USE_EXTI
38 #define MPU_INT_EXTI PA15
39 #define USE_MPU_DATA_READY_SIGNAL
40 //#define ENSURE_MPU_DATA_READY_IS_LOW
41 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready (mag disabled)
43 #define MPU9250_CS_PIN PB12
44 #define MPU9250_SPI_INSTANCE SPI2
46 #define GYRO
47 #define USE_GYRO_MPU9250
48 #define USE_GYRO_SPI_MPU9250
49 #define GYRO_MPU9250_ALIGN CW270_DEG
51 #define ACC
52 #define USE_ACC_MPU9250
53 #define USE_ACC_SPI_MPU9250
54 #define ACC_MPU9250_ALIGN CW270_DEG
56 //#define MAG
57 //#define USE_MAG_HMC5883
59 #define BARO
60 #define USE_BARO_MS5611
62 #define USE_VCP
63 #define VBUS_SENSING_PIN PA9
65 #define USE_UART1
66 #define UART1_RX_PIN PB7
67 #define UART1_TX_PIN PB6
69 #define USE_UART2
70 #define UART2_RX_PIN PA3
71 #define UART2_TX_PIN PA2
73 #define SERIAL_PORT_COUNT 3 //VCP, USART1, USART2
75 #define USE_SPI
76 //#define USE_SPI_DEVICE_1
77 #define USE_SPI_DEVICE_2
78 //#define USE_SPI_DEVICE_3
80 #define USE_I2C
81 #define I2C_DEVICE (I2CDEV_3)
83 #define USE_ADC
84 #define CURRENT_METER_ADC_PIN PA7
85 #define VBAT_ADC_PIN PA6
86 #define RSSI_ADC_PIN PA5
88 #define SPEKTRUM_BIND
89 // USART2, PA3
90 #define BIND_PIN PA3
92 // Number of available PWM outputs
93 #define MAX_PWM_OUTPUT_PORTS 11
95 #define TARGET_IO_PORTA 0xffff
96 #define TARGET_IO_PORTB 0xffff
97 #define TARGET_IO_PORTC 0xffff
99 #define USABLE_TIMER_CHANNEL_COUNT 12
100 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) )