|
| 1 | +//========================================================================================================================// |
| 2 | +// PINS CONFIG // |
| 3 | +//========================================================================================================================// |
| 4 | +// |
| 5 | +// You have 3 options to setup the pins (gpio numbers) and busses for the flight controller: |
| 6 | +// |
| 7 | +// 1) Default - #include <madflight_board.h> and see https://madflight.com for default pinout diagrams for the supported |
| 8 | +// processor families. Default pinouts are defined in the board header files library/src/madflight_board_default_XXX.h |
| 9 | +// |
| 10 | +// 2) Header - #include the BetaFlight flight controller you want to use. See library/madflight/src for all available |
| 11 | +// boards. For example: #include <madflight_board_betaflight_MTKS-MATEKH743.h> |
| 12 | +// |
| 13 | +// 3) Custom - Do not include a board file here, and set your own board definition in the CUSTOM PINS section below. |
| 14 | +// |
| 15 | +//========================================================================================================================// |
| 16 | + |
| 17 | +#include <madflight_board.h> |
| 18 | + |
| 19 | + |
| 20 | +//========================================================================================================================// |
| 21 | +// HARDWARE CONFIG // |
| 22 | +//========================================================================================================================// |
| 23 | +// |
| 24 | +// Hardware configuration is a simple key-value list. Anything after '#' or '/' is ignored as comment |
| 25 | +// |
| 26 | +//========================================================================================================================// |
| 27 | + |
| 28 | +#define MADFLIGHT_CONFIG R""( |
| 29 | + |
| 30 | +// IMU - Inertial Measurement Unit (acc/gyro) |
| 31 | + |
| 32 | +// Uncomment ONE bus: SPI or I2C |
| 33 | +imu_spi_bus 0 // connect IMU to SPI bus 0 |
| 34 | +//imu_i2c_bus 1 // connect IMU to I2C bus 1 |
| 35 | + |
| 36 | +// IMPORTANT: the IMU sensor should be the ONLY sensor on the selected bus |
| 37 | + |
| 38 | +imu_gizmo NONE // options: NONE, BMI270, MPU6000, MPU6050, MPU6500, MPU9150, MPU9250 |
| 39 | +imu_align CW90 // options: CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP |
| 40 | +imu_i2c_adr 0 // use 0 for default i2c address |
| 41 | + |
| 42 | +// RCL - Remote Controller Link |
| 43 | +rcl_gizmo NONE // options: NONE, MAVLINK, CRSF, SBUS, DSM, PPM, PWM |
| 44 | +rcl_num_ch 8 // number of channels |
| 45 | +rcl_deadband 0 // center stick deadband |
| 46 | + |
| 47 | +// BAR - Barometer |
| 48 | +bar_gizmo NONE // options: NONE, BMP390, BMP388, BMP280, MS5611 |
| 49 | +bar_i2c_adr 0 |
| 50 | + |
| 51 | +// MAG - Magnetometer |
| 52 | +mag_gizmo NONE // options: NONE, QMC5883 |
| 53 | +mag_i2c_adr 0 |
| 54 | + |
| 55 | +// BAT - Battery Monitor |
| 56 | +bat_gizmo NONE // options: NONE, ADC, INA226, INA228 |
| 57 | +bat_i2c_adr 0 |
| 58 | + |
| 59 | +// GPS |
| 60 | +gps_gizmo NONE // options: NONE, UBLOX |
| 61 | +gps_baud 0 // use 0 for auto baud |
| 62 | + |
| 63 | +// BBX - Black Box Data Logger |
| 64 | +bbx_gizmo NONE // options: NONE, SDSPI, SDMMC |
| 65 | + |
| 66 | +)"" // End of MADFLIGHT_CONFIG |
| 67 | + |
| 68 | + |
| 69 | +//========================================================================================================================// |
| 70 | +// CUSTOM PINS CONFIG // |
| 71 | +//========================================================================================================================// |
| 72 | + |
| 73 | +/* <-- Add a / here to setup your custom pins below - Check datasheet that what you're doing is actually possible!!! |
| 74 | +
|
| 75 | +#define MADFLIGHT_BOARD R""( |
| 76 | +
|
| 77 | +// PINOUT |
| 78 | +
|
| 79 | +// Serial Pins |
| 80 | +pin_ser0_rx -1 |
| 81 | +pin_ser0_tx -1 |
| 82 | +pin_ser0_inv -1 |
| 83 | +pin_ser1_rx -1 |
| 84 | +pin_ser1_tx -1 |
| 85 | +pin_ser1_inv -1 |
| 86 | +pin_ser2_rx -1 |
| 87 | +pin_ser2_tx -1 |
| 88 | +pin_ser2_inv -1 |
| 89 | +pin_ser3_rx -1 |
| 90 | +pin_ser3_tx -1 |
| 91 | +pin_ser3_inv -1 |
| 92 | +pin_ser4_rx -1 |
| 93 | +pin_ser4_tx -1 |
| 94 | +pin_ser4_inv -1 |
| 95 | +pin_ser5_rx -1 |
| 96 | +pin_ser5_tx -1 |
| 97 | +pin_ser5_inv -1 |
| 98 | +pin_ser6_rx -1 |
| 99 | +pin_ser6_tx -1 |
| 100 | +pin_ser6_inv -1 |
| 101 | +pin_ser7_rx -1 |
| 102 | +pin_ser7_tx -1 |
| 103 | +pin_ser7_inv -1 |
| 104 | +
|
| 105 | +// SPI Pins |
| 106 | +pin_spi0_miso -1 |
| 107 | +pin_spi0_mosi -1 |
| 108 | +pin_spi0_sclk -1 |
| 109 | +pin_spi1_miso -1 |
| 110 | +pin_spi1_mosi -1 |
| 111 | +pin_spi1_sclk -1 |
| 112 | +pin_spi2_miso -1 |
| 113 | +pin_spi2_mosi -1 |
| 114 | +pin_spi2_sclk -1 |
| 115 | +pin_spi3_miso -1 |
| 116 | +pin_spi3_mosi -1 |
| 117 | +pin_spi3_sclk -1 |
| 118 | +
|
| 119 | +// I2C Pins |
| 120 | +pin_i2c0_sda -1 |
| 121 | +pin_i2c0_scl -1 |
| 122 | +pin_i2c1_sda -1 |
| 123 | +pin_i2c1_scl -1 |
| 124 | +pin_i2c2_sda -1 |
| 125 | +pin_i2c2_scl -1 |
| 126 | +pin_i2c3_sda -1 |
| 127 | +pin_i2c3_scl -1 |
| 128 | +
|
| 129 | +// OUT Pins |
| 130 | +pin_out0 -1 |
| 131 | +pin_out1 -1 |
| 132 | +pin_out2 -1 |
| 133 | +pin_out3 -1 |
| 134 | +pin_out4 -1 |
| 135 | +pin_out5 -1 |
| 136 | +pin_out6 -1 |
| 137 | +pin_out7 -1 |
| 138 | +pin_out8 -1 |
| 139 | +pin_out9 -1 |
| 140 | +pin_out10 -1 |
| 141 | +pin_out11 -1 |
| 142 | +pin_out12 -1 |
| 143 | +pin_out13 -1 |
| 144 | +pin_out14 -1 |
| 145 | +pin_out15 -1 |
| 146 | +
|
| 147 | +// Other Pins |
| 148 | +pin_bat_i -1 |
| 149 | +pin_bat_v -1 |
| 150 | +pin_bbx_cs -1 |
| 151 | +pin_imu_cs -1 |
| 152 | +pin_imu_int -1 |
| 153 | +pin_led -1 |
| 154 | +led_on LOW_IS_ON |
| 155 | +pin_mmc_dat -1 |
| 156 | +pin_mmc_clk -1 |
| 157 | +pin_mmc_cmd -1 |
| 158 | +pin_rcl_ppm -1 |
| 159 | +
|
| 160 | +// BUSSES |
| 161 | +
|
| 162 | +// Serial Busses |
| 163 | +rcl_ser_bus -1 |
| 164 | +gps_ser_bus -1 |
| 165 | +rdr_ser_bus -1 |
| 166 | +
|
| 167 | +// SPI Busses |
| 168 | +imu_spi_bus -1 |
| 169 | +bbx_spi_bus -1 |
| 170 | +
|
| 171 | +// I2C Busses |
| 172 | +bar_i2c_bus -1 |
| 173 | +mag_i2c_bus -1 |
| 174 | +bat_i2c_bus -1 |
| 175 | +imu_i2c_bus -1 |
| 176 | +
|
| 177 | +)"" // end of MADFLIGHT_BOARD */ |
| 178 | + |
| 179 | +//========================================================================================================================// |
| 180 | +// COMPILER OPTIONS // |
| 181 | +//========================================================================================================================// |
| 182 | + |
| 183 | +//-- AHRS sensor fusion |
| 184 | +#define AHR_USE AHR_USE_MAHONY // Select one: AHRS_USE_MAHONY, AHRS_USE_MAHONY_BF, AHRS_USE_MADGWICK, AHRS_USE_VQF |
| 185 | + |
| 186 | +// Reset config eeprom to defaults (uncomment this, upload, then comment out again) |
| 187 | +//#define MF_CONFIG_CLEAR |
| 188 | + |
| 189 | +// Uncomment to print additional debug information and reduce startup delay |
| 190 | +//#define MF_DEBUG |
0 commit comments