add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / NOX / target.h
blob764e889bb474a57339c0361917d6e1744b898830
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
21 #define TARGET_BOARD_IDENTIFIER "NOX1"
22 #define USBD_PRODUCT_STRING "NoxF4V1"
24 #define LED0 PA4
26 #define BEEPER PC13
27 #define BEEPER_INVERTED
29 #define I2C2_SCL NONE
30 #define I2C2_SDA NONE
32 // *************** SPI **********************
33 #define USE_SPI
34 #define USE_SPI_DEVICE_1
35 #define SPI1_SCK_PIN PB3
36 #define SPI1_MISO_PIN PB4
37 #define SPI1_MOSI_PIN PB5
39 #define USE_SPI_DEVICE_2
40 #define SPI2_SCK_PIN PB13
41 #define SPI2_MISO_PIN PB14
42 #define SPI2_MOSI_PIN PB15
45 // *************** SPI Gyro & ACC **********************
46 #define USE_IMU_MPU6000
47 #define IMU_MPU6000_ALIGN CW0_DEG
48 #define MPU6000_CS_PIN PB12
49 #define MPU6000_SPI_BUS BUS_SPI2
51 #define USE_EXTI
52 #define GYRO_INT_EXTI PA8
53 #define USE_MPU_DATA_READY_SIGNAL
56 // *************** SPI BARO *****************************
57 #define USE_BARO
58 #define USE_BARO_BMP280
59 #define USE_BARO_SPI_BMP280
60 #define BMP280_SPI_BUS BUS_SPI2
61 #define BMP280_CS_PIN PA9
63 // *************** SPI OSD *****************************
64 #define USE_MAX7456
65 #define MAX7456_SPI_BUS BUS_SPI2
66 #define MAX7456_CS_PIN PA10
67 //#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD*2)
68 //#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
70 // *************** SPI FLASH **************************
71 #define USE_FLASHFS
72 #define USE_FLASH_M25P16
73 #define M25P16_CS_PIN PA15
74 #define M25P16_SPI_BUS BUS_SPI1
75 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
77 // *************** UART *****************************
78 #define USE_UART_INVERTER
80 #define USE_VCP
82 #define USE_UART1
83 #define UART1_TX_PIN PB6
84 #define UART1_RX_PIN PB7
86 #define USE_UART2
87 #define UART2_TX_PIN PA2
88 #define UART2_RX_PIN PA3
90 // #define INVERTER_PIN_UART2 PC14
91 #define INVERTER_PIN_UART2_RX PC14 // PC14 used as inverter select GPIO
93 #define USE_SOFTSERIAL1
94 #define SOFTSERIAL_1_TX_PIN PA2 // Workaround for softserial not initializing with only RX
95 #define SOFTSERIAL_1_RX_PIN PA2 // Backdoor timer on UART2_TX, used for ESC telemetry
97 #define SERIAL_PORT_COUNT 4 //VCP, USART1, USART2, SOFTSERIAL1
99 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
100 #define SERIALRX_PROVIDER SERIALRX_SBUS
101 #define SERIALRX_UART SERIAL_PORT_USART2
103 // *************** ADC *****************************
104 #define USE_ADC
105 #define ADC_INSTANCE ADC1
106 #define ADC_CHANNEL_1_PIN NONE
107 #define ADC_CHANNEL_2_PIN PA5
108 #define ADC_CHANNEL_3_PIN NONE
110 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
111 #define VBAT_ADC_CHANNEL ADC_CHN_2
112 #define RSSI_ADC_CHANNEL ADC_CHN_3
114 #define ADC_INSTANCE ADC1
115 #define ADC1_DMA_STREAM DMA2_Stream0
116 #define ADC_CHANNEL_1_PIN PA5
117 #define ADC_CHANNEL_2_PIN NONE
118 //#define ADC_CHANNEL_3_PIN PA0
119 #define VBAT_ADC_CHANNEL ADC_CHN_1
120 //#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
121 //#define RSSI_ADC_CHANNEL ADC_CHN_3
123 // *************** LED2812 ************************
124 #define USE_LED_STRIP
125 #define WS2811_PIN PA0
126 #define WS2811_DMA_HANDLER_IDENTIFER DMA2_ST1_HANDLER
127 #define WS2811_DMA_STREAM DMA2_Stream1
128 #define WS2811_DMA_CHANNEL DMA_Channel_6
130 // *************** OTHERS *************************
131 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_SOFTSERIAL | FEATURE_VBAT)
134 // #define USE_SPEKTRUM_BIND
135 // #define BIND_PIN PA10 // RX1
137 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
139 #define TARGET_IO_PORTA (0xffff & ~(BIT(14)|BIT(13)))
140 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)|BIT(11)))
141 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
143 #define MAX_PWM_OUTPUT_PORTS 4