2
2
MADFLIGHT CONFIG
3
3
==========================================================================================================================
4
4
5
- madflight_config is a multi-line raw string in with a key-value list. Anything after '#' or '/' is ignored as comment.
5
+ The configuration is loaded from two strings: first from madflight_board in <madflight_board.h>, and then from
6
+ madflight_config in this file. If the same setting occurs more than once, the last one is applied.
6
7
7
- You have 4 options to setup the pins (gpio numbers) and serial/spi/i2c busses for the flight controller:
8
+ The strings are multi-line raw strings in with a key-value list. Anything after '#' or '/' is ignored as comment.
8
9
9
- 1) Default - #include <madflight_board.h> and see https://madflight.com for default pinout diagrams for the supported
10
- processor families. Default pinouts are defined in the board header files library/madflight/src/madflight_board_XXX.h
11
- Leave lines with "pin_..." and "..._bus" commented in madflight_config.
12
-
13
- 2) BetaFlight - #include the BetaFlight flight controller you want to use. See library/madflight/src for all available
14
- boards. For example: #include <madflight_zzz_MTKS-MATEKH743.h>
10
+ You have 3 options to setup the flight controller:
15
11
16
- 3) Override - Keep #include <madflight_board.h>, and uncomment lines in madflight_config to override the board settings.
12
+ 1) Default - Keep "#include <madflight_board.h>", this defines the default pinout as shown on https://madflight.com
13
+ for the supported processor families. Now edit madflight_config below, and uncomment and configure imu_gizmo,
14
+ imu_bus_type, rcl_gizmo, and other lines as needed. (Do not change the pin_xxx_yyy and xxx_yyy_bus settings.)
15
+
16
+ 2) BetaFlight - Change "#include <madflight_board.h>" to the BetaFlight flight controller you want to use, for example:
17
+ "#include <madflight_zzz_MTKS-MATEKH743.h>". See library/madflight/src for all available boards. Edit madflight_config
18
+ to fine-tune the configuration.
17
19
18
- 4) Bare Metal - Remove #include <madflight_board.h>, and set the full configuration in madflight_config below.
20
+ 4) Bare Metal - Remove " #include <madflight_board.h>" , and set the full configuration in madflight_config below.
19
21
20
- Pins and busses use zero-based numbering, i.e. imu_spi_bus 0 is the first spi bus. Use -1 to disable a pin or bus.
22
+ Pins and spi/i2c/serial busses use zero-based numbering, i.e. "gps_ser_bus 0" connects the GPS to the first serial bus
23
+ with pins pin_ser0_tx and pin_ser0_rx. Pins use GPIO numbers, not physical pin numbers. Use -1 to disable a pin or bus.
21
24
22
25
You can also modify the configuration from the CLI, for example "set imu_gizmo MPU6500" or "set imu_spi_bus 1", then
23
26
use "cwrite" to save the config to eeprom and reboot to use the new config.
@@ -28,71 +31,71 @@ If things do not work as expected, have a good look at the startup messages!
28
31
29
32
#include <madflight_board.h>
30
33
31
- const char * madflight_config = R "" (
34
+ const char madflight_config [] = R "" (
32
35
33
36
//--- IMU --- Inertial Measurement Unit (use spi -OR- i2c bus)
34
- imu_gizmo MPU6500 // options: NONE, BMI270, MPU6000, MPU6050, MPU6500, MPU9150, MPU9250
35
- imu_bus_type SPI // options: SPI, I2C (not all combinations of gizmo and bus_type are supported)
36
- imu_align CW90 // options: CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP
37
+ // imu_gizmo NONE // options: NONE, BMI270, MPU6000, MPU6050, MPU6500, MPU9150, MPU9250, ICM45686, ICM42688
38
+ // imu_bus_type SPI // options: SPI, I2C (not all combinations of gizmo and bus_type are supported)
39
+ // imu_align CW0 // options: CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP
37
40
//imu_spi_bus -1 //spi
38
41
//pin_imu_cs -1 //spi
39
- //pin_imu_int -1 //spi
42
+ //pin_imu_int -1 //spi and i2c
40
43
//imu_i2c_bus -1 //i2c
41
44
//imu_i2c_adr 0 //i2c: enter decimal i2c address, not hex (use 0 for default i2c address)
42
45
43
46
// IMPORTANT: the IMU sensor should be the ONLY sensor on the selected bus
44
47
45
48
46
49
//--- RCL --- Remote Controller Link (use serial bus -OR- ppm pin)
47
- rcl_gizmo CRSF // options: NONE, MAVLINK, CRSF, SBUS, DSM, PPM
48
- rcl_num_ch 8 // number of channels
49
- rcl_deadband 0 // center stick deadband
50
+ // rcl_gizmo NONE // options: NONE, MAVLINK, CRSF, SBUS, DSM, PPM
51
+ // rcl_num_ch 8 // number of channels
52
+ // rcl_deadband 0 // center stick deadband
50
53
//rcl_ser_bus -1
51
54
//pin_rcl_ppm -1
52
55
53
56
//--- BAR --- Barometer
54
- bar_gizmo NONE // options: NONE, BMP390, BMP388, BMP280, MS5611, HP203B
57
+ // bar_gizmo NONE // options: NONE, BMP390, BMP388, BMP280, MS5611, HP203B
55
58
//bar_i2c_adr 0
56
59
//bar_i2c_bus -1
57
60
58
61
//--- MAG --- Magnetometer
59
- mag_gizmo NONE // options: NONE, QMC5883, QMC6309, RM3100
62
+ // mag_gizmo NONE // options: NONE, QMC5883, QMC6309, RM3100
60
63
//mag_i2c_adr 0
61
64
//mag_i2c_bus -1
62
65
63
66
//--- BAT --- Battery Monitor (use i2c bus -OR- adc pins)
64
- bat_gizmo NONE // options: NONE, ADC, INA226, INA228
67
+ // bat_gizmo NONE // options: NONE, ADC, INA226, INA228
65
68
//bat_i2c_adr 0
66
69
//bat_i2c_bus -1
67
70
//pin_bat_i -1
68
71
//pin_bat_v -1
69
72
70
73
//--- GPS ---
71
- gps_gizmo NONE // options: NONE, UBLOX
74
+ // gps_gizmo NONE // options: NONE, UBLOX
72
75
//gps_baud 0 // use 0 for auto baud
73
76
//gps_ser_bus -1
74
77
75
78
//--- BBX --- Black Box Data Logger (use spi -OR- mmc)
76
- bbx_gizmo NONE // options: NONE, SDSPI, SDMMC
79
+ // bbx_gizmo NONE // options: NONE, SDSPI, SDMMC
77
80
//pin_bbx_cs -1 // spi
78
81
//bbx_spi_bus -1 // spi
79
82
//pin_mmc_dat -1 // mmc
80
83
//pin_mmc_clk -1 // mmc
81
84
//pin_mmc_cmd -1 // mmc
82
85
83
86
//--- RDR --- Radar (use serial bus -OR- trig+echo pins)
84
- rdr_gizmo NONE // options: NONE, LD2411S, LD2413, USD1, SR04
87
+ // rdr_gizmo NONE // options: NONE, LD2411S, LD2413, USD1, SR04
85
88
//rdr_baud 0
86
89
//rdr_ser_bus -1
87
90
//pin_rdr_trig -1
88
91
//pin_rdr_echo -1
89
92
90
93
//--- LED ---
91
- //led_on LOW_IS_ON // options: LOW_IS_ON,HIGH_IS_ON
94
+ //led_on LOW_IS_ON // options: LOW_IS_ON, HIGH_IS_ON
92
95
//pin_led -1
93
96
94
97
//--- AHR --- AHRS (keep MAHONY, unless you want to experiment)
95
- ahr_gizmo MAHONY // options: MAHONY, MAHONY_BF, MADGWICK, VQF
98
+ // ahr_gizmo MAHONY // options: MAHONY, MAHONY_BF, MADGWICK, VQF
96
99
97
100
//--- Serial bus 0 ---
98
101
//pin_ser0_rx -1
0 commit comments