[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / ASGARD32F7 / target.h
blobf26650eeeb95ba44a5eb18b58bee3ff1b900ee89
1 /*
2 * This file is part of INAV.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
25 #pragma once
27 #define TARGET_BOARD_IDENTIFIER "ASF4"
29 #define USBD_PRODUCT_STRING "Asgard32"
31 // Status LED
32 // #define LED0 PC13
34 // Beeper
35 #define BEEPER PC13
36 #define BEEPER_INVERTED
38 // #define USE_EXTI
39 // #define GYRO_INT_EXTI PC8
40 // #define USE_MPU_DATA_READY_SIGNAL // Not connected on FireworksV2
42 #define USE_IMU_MPU6000
43 #define IMU_MPU6000_ALIGN CW90_DEG
44 #define MPU6000_CS_PIN PA4
45 #define MPU6000_SPI_BUS BUS_SPI1
47 #define USE_MAG
48 #define MAG_I2C_BUS BUS_I2C2
49 #define USE_MAG_HMC5883
50 #define USE_MAG_QMC5883
51 #define USE_MAG_IST8310
52 #define USE_MAG_MAG3110
53 #define USE_MAG_LIS3MDL
55 #define TEMPERATURE_I2C_BUS BUS_I2C2
57 #define USE_BARO
59 #define USE_BARO_BMP280
60 #define BMP280_SPI_BUS BUS_SPI2
61 #define BMP280_CS_PIN PB9
63 #define USE_VCP
65 #define USE_UART1
66 #define UART1_RX_PIN PA10
67 #define UART1_TX_PIN PA9
69 #define USE_UART2
70 #define UART2_RX_PIN NONE
71 #define UART2_TX_PIN PA2
73 #define USE_UART3
74 #define UART3_RX_PIN PC11
75 #define UART3_TX_PIN PC10
77 #define USE_UART4
78 #define UART4_RX_PIN PA1
79 #define UART4_TX_PIN NONE
81 #define USE_UART5
82 #define UART5_RX_PIN PD2
83 #define UART5_TX_PIN PC12
85 #define USE_UART6
86 #define UART6_RX_PIN PC7
87 #define UART6_TX_PIN PC6
89 // #define USE_SOFTSERIAL1
90 // #define SOFTSERIAL_1_RX_PIN NONE
91 // #define SOFTSERIAL_1_TX_PIN PA9 // Clash with UART1_TX, needed for S.Port
93 #define SERIAL_PORT_COUNT 7 // VCP, USART1, USART2, USART3, USART4, USART5, USART6, SOFTSERIAL1
95 // I2C
96 #define USE_I2C
98 #define USE_I2C_DEVICE_2
99 #define I2C2_SCL PB10
100 #define I2C2_SDA PB11
102 #define USE_SPI
104 #define USE_SPI_DEVICE_1
105 #define SPI1_NSS_PIN PA4
106 #define SPI1_SCK_PIN PA5
107 #define SPI1_MISO_PIN PA6
108 #define SPI1_MOSI_PIN PA7
110 #define USE_SPI_DEVICE_2
111 #define SPI2_NSS_PIN PB12
112 #define SPI2_SCK_PIN PB13
113 #define SPI2_MISO_PIN PC2
114 #define SPI2_MOSI_PIN PC3
116 #define USE_SPI_DEVICE_3
117 #define SPI3_NSS_PIN PA15
118 #define SPI3_SCK_PIN PB3
119 #define SPI3_MISO_PIN PB4
120 #define SPI3_MOSI_PIN PB5
122 #define USE_OSD
123 #define USE_MAX7456
124 #define MAX7456_SPI_BUS BUS_SPI3
125 #define MAX7456_CS_PIN PA15
127 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
128 #define M25P16_CS_PIN PB12
129 #define M25P16_SPI_BUS BUS_SPI2
130 #define USE_FLASHFS
131 #define USE_FLASH_M25P16
133 #define USE_ADC
134 #define ADC_CHANNEL_1_PIN PC0
135 #define ADC_CHANNEL_2_PIN PC1
136 #define ADC_CHANNEL_3_PIN PC4
138 #define VBAT_ADC_CHANNEL ADC_CHN_1
139 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
140 #define RSSI_ADC_CHANNEL ADC_CHN_3
142 #define USE_LED_STRIP
143 #define WS2811_PIN PA2
145 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO)
147 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_VBAT | FEATURE_OSD | FEATURE_SOFTSERIAL | FEATURE_TELEMETRY)
148 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
149 #define SERIALRX_PROVIDER SERIALRX_SBUS
151 // Disable PWM & PPM inputs
152 #undef USE_RX_PWM
153 #undef USE_RX_PPM
155 // Set default UARTs
156 #define TELEMETRY_UART SERIAL_PORT_SOFTSERIAL1
157 #define SERIALRX_UART SERIAL_PORT_USART1
158 #define SMARTAUDIO_UART SERIAL_PORT_USART2
160 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
162 // Number of available PWM outputs
163 #define USE_DSHOT
164 #define USE_ESC_SENSOR
165 #define MAX_PWM_OUTPUT_PORTS 4
166 #define TARGET_MOTOR_COUNT 4
168 #define TARGET_IO_PORTA 0xffff
169 #define TARGET_IO_PORTB 0xffff
170 #define TARGET_IO_PORTC 0xffff
171 #define TARGET_IO_PORTD 0xffff
173 #define PCA9685_I2C_BUS BUS_I2C2
174 #define PITOT_I2C_BUS BUS_I2C2