Skip to content

Commit

Permalink
Update pinouts
Browse files Browse the repository at this point in the history
  • Loading branch information
qqqlab committed Oct 23, 2024
1 parent c7fce12 commit 3b8ca8d
Show file tree
Hide file tree
Showing 499 changed files with 19,208 additions and 30,478 deletions.
81 changes: 57 additions & 24 deletions examples/01.Quadcopter/01.Quadcopter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,80 @@ Copyright (c) 2023-2024 https://github.com/qqqlab/madflight
Copyright (c) 2022 Nicholas Rehm - dRehmFlight
##########################################################################################################################*/


//========================================================================================================================//
// PINS //
//========================================================================================================================//
// PINS are defined in the board header file library/src/madflight_board_default_XXX.h, but you can use these defines to
// override the pins.
//
// You have 3 options to setup the pins (gpio numbers) for the flight controller:
//
// 1) Default - Leave this section as is and see https://madflight.com for default pinout diagrams for the supported
// processor families. Default pinouts are defined in the board header files library/src/madflight_board_default_XXX.h
//
// 2) Header - #include the BetaFlight flight controller you want to use. See library/madflight/src for all available
// boards. For example: #include <madflight_board_betaflight_MTKS-MATEKH743.h>
//
// 3) Custom - Remove /* below to enable the CUSTOM PINS section, and define own pinout.
//
//========================================================================================================================//

/*
//The pin numbers below are an example for an easy soldering ESP32 WeMos LOLIN32-Lite with GY-6500/GY-271/GY-BPM280 sensor modules
//========================================================================================================================//
// CUSTOM PINS //
//========================================================================================================================//
#define HW_BOARD_NAME "My Custom Board" //REQUIRED: Give your board a name - without a name the default pinout is loaded!!!
//NOTE: Don't use the same gpio number twice. All pins here get configured, even if they are not used. Set pin to -1 to disable.
//NOTE: Not all pins can be freely configured. Read the processor datasheet, or use the default pinout.
//LED:
#define HW_PIN_LED 22
#define HW_LED_ON 0 //0:low is on, 1:high is on
#define HW_PIN_LED -1
#define HW_LED_ON 0 //0:low is on, 1:high is on
//IMU SPI:
#define HW_PIN_SPI_MISO 25
#define HW_PIN_SPI_MOSI 14
#define HW_PIN_SPI_SCLK 12
#define HW_PIN_IMU_CS 32
#define HW_PIN_IMU_EXTI 33 //external interrupt pin
#define HW_PIN_SPI_MISO -1
#define HW_PIN_SPI_MOSI -1
#define HW_PIN_SPI_SCLK -1
#define HW_PIN_IMU_CS -1
#define HW_PIN_IMU_EXTI -1 //REQUIRED: IMU external interrupt pin (required for SPI and I2C sensors)
//I2C for IMU if not using SPI
#define HW_PIN_I2C_SDA 23
#define HW_PIN_I2C_SCL 19
//I2C for BARO, MAG, BAT sensors (and for IMU if not using SPI IMU)
#define HW_PIN_I2C_SDA -1
#define HW_PIN_I2C_SCL -1
//Motor/Servo Outputs:
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {13,15,2,0} //list of output pins
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {-1,-1,-1,-1} //list of output pins, enter exactly HW_OUT_COUNT pins.
//Serial debug on USB Serial port (no GPIO pins)
//RC Receiver:
#define HW_PIN_RCIN_RX 16
#define HW_PIN_RCIN_TX 4
#define HW_PIN_RCIN_RX -1
#define HW_PIN_RCIN_TX -1
#define HW_PIN_RCIN_INVERTER -1 //only used for STM32 targets
//*/
//========================================================================================================================//
// BOARD //
//========================================================================================================================//
// Uncomment/change the following #include to the flight controller you want to use, or leave commented out to use the
// default board pinout (madflight_board_default_*.h). See library/madflight/src for all available boards
//GPS:
#define HW_PIN_GPS_RX -1
#define HW_PIN_GPS_TX -1
#define HW_PIN_GPS_INVERTER -1 //only used for STM32 targets
//Battery ADC
#define HW_PIN_BAT_V -1
#define HW_PIN_BAT_I -1
//Black Box SPI (for sdcard or external flash chip):
#define HW_PIN_SPI2_MISO -1
#define HW_PIN_SPI2_MOSI -1
#define HW_PIN_SPI2_SCLK -1
#define HW_PIN_BB_CS -1
//Black Box SDCARD via MMC interface:
#define HW_PIN_SDMMC_DATA -1
#define HW_PIN_SDMMC_CLK -1
#define HW_PIN_SDMMC_CMD -1
//*/

//#include <madflight_board_betaflight_MTKS-MATEKH743.h>

//========================================================================================================================//
// USER-SPECIFIED DEFINES //
Expand Down
68 changes: 42 additions & 26 deletions examples/02.QuadcopterAdvanced/02.QuadcopterAdvanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,53 @@ Copyright (c) 2022 Nicholas Rehm - dRehmFlight
//========================================================================================================================//
// PINS //
//========================================================================================================================//
// Default pinouts are defined in the board header files library/src/madflight_board_default_XXX.h
// Uncomment the defines below to create your own pinout, leave commented if you want to use the default pinout.

//
// You have 3 options to setup the pins (gpio numbers) for the flight controller:
//
// 1) Default - Leave this section as is and see https://madflight.com for default pinout diagrams for the supported
// processor families. Default pinouts are defined in the board header files library/src/madflight_board_default_XXX.h
//
// 2) Header - #include the BetaFlight flight controller you want to use. See library/madflight/src for all available
// boards. For example: #include <madflight_board_betaflight_MTKS-MATEKH743.h>
//
// 3) Custom - Remove /* below to enable the CUSTOM PINS section, and define own pinout.
//
//========================================================================================================================//
#include <madflight_board_betaflight_MTKS-MATEKH743.h>
/*
//========================================================================================================================//
// CUSTOM PINS //
//========================================================================================================================//
#define HW_BOARD_NAME "My Custom Board" //REQUIRED: Give your board a name - without a name the default pinout is loaded!!!
//NOTE: Don't use the same gpio number twice. All pins here get configured, even if they are not used. Set pin to -1 to disable.
//NOTE: Not all pins can be freely configured. Read the processor datasheet, or use the default pinout.
//LED:
#define HW_PIN_LED -1
#define HW_LED_ON 0 //0:low is on, 1:high is on
#define HW_PIN_LED -1
#define HW_LED_ON 0 //0:low is on, 1:high is on
//IMU SPI:
#define HW_PIN_SPI_MISO 15
#define HW_PIN_SPI_MOSI 5
#define HW_PIN_SPI_SCLK 4
#define HW_PIN_IMU_CS 17
#define HW_PIN_IMU_EXTI 16 //external interrupt pin
#define HW_PIN_SPI_MISO -1
#define HW_PIN_SPI_MOSI -1
#define HW_PIN_SPI_SCLK -1
#define HW_PIN_IMU_CS -1
#define HW_PIN_IMU_EXTI -1 //REQUIRED: IMU external interrupt pin (required for SPI and I2C sensors)
//I2C for BARO, MAG, BAT sensors and for IMU if not using SPI
#define HW_PIN_I2C_SDA 13
#define HW_PIN_I2C_SCL 14
//I2C for BARO, MAG, BAT sensors (and for IMU if not using SPI IMU)
#define HW_PIN_I2C_SDA -1
#define HW_PIN_I2C_SCL -1
//Motor/Servo Outputs:
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {13,14,21,47} //list of output pins
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {-1,-1,-1,-1} //list of output pins, enter exactly HW_OUT_COUNT pins.
//Serial debug on USB Serial port (no GPIO pins)
//RC Receiver:
#define HW_PIN_RCIN_RX 12
#define HW_PIN_RCIN_TX 11
#define HW_PIN_RCIN_RX -1
#define HW_PIN_RCIN_TX -1
#define HW_PIN_RCIN_INVERTER -1 //only used for STM32 targets
//GPS:
Expand All @@ -78,27 +96,25 @@ Copyright (c) 2022 Nicholas Rehm - dRehmFlight
#define HW_PIN_BAT_V -1
#define HW_PIN_BAT_I -1
//BlackBox SPI:
//Black Box SPI (for sdcard or external flash chip):
#define HW_PIN_SPI2_MISO -1
#define HW_PIN_SPI2_MOSI -1
#define HW_PIN_SPI2_SCLK -1
#define HW_PIN_BB_CS -1
//Black Box SDCARD via MMC interface:
#define HW_PIN_SDMMC_DATA -1
#define HW_PIN_SDMMC_CLK -1
#define HW_PIN_SDMMC_CMD -1
//*/

//RP2040 specific options
//#define HW_RP2040_SYS_CLK_KHZ 200000 //overclocking
//#define HW_RP2040_USE_FREERTOS //enable use of FreeRTOS - experimental

//ESP32 specific options
//#define USE_ESP32_SOFTWIRE //use bitbang I2C (not hardware I2C) See https://github.com/espressif/esp-idf/issues/4999

//========================================================================================================================//
// BOARD //
//========================================================================================================================//
// Uncomment/change the following #include to the flight controller you want to use, or leave commented out to use the
// default board pinout (madflight_board_default_*.h). See library/madflight/src for all available boards
//#define USE_ESP32_SOFTWIRE //use bitbang I2C (not hardware I2C) See https://github.com/espressif/esp-idf/issues/499

//#include <madflight_board_betaflight_MTKS-MATEKH743.h>

//========================================================================================================================//
// HARDWARE //
Expand Down
67 changes: 41 additions & 26 deletions examples/03.PID-Tune/03.PID-Tune.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,53 @@ Copyright (c) 2022 Nicholas Rehm - dRehmFlight
//========================================================================================================================//
// PINS //
//========================================================================================================================//
// PINS are defined in the board header file library/src/madflight_board_default_XXX.h, but you can use these defines to
// override the pins.
//
// You have 3 options to setup the pins (gpio numbers) for the flight controller:
//
// 1) Default - Leave this section as is and see https://madflight.com for default pinout diagrams for the supported
// processor families. Default pinouts are defined in the board header files library/src/madflight_board_default_XXX.h
//
// 2) Header - #include the BetaFlight flight controller you want to use. See library/madflight/src for all available
// boards. For example: #include <madflight_board_betaflight_MTKS-MATEKH743.h>
//
// 3) Custom - Remove /* below to enable the CUSTOM PINS section, and define own pinout.
//
//========================================================================================================================//

/*
//The pin numbers below are an example for an easy soldering ESP32 WeMos LOLIN32-Lite with GY-6500/GY-271/GY-BPM280 sensor modules
//========================================================================================================================//
// CUSTOM PINS //
//========================================================================================================================//
#define HW_BOARD_NAME "My Custom Board" //REQUIRED: Give your board a name - without a name the default pinout is loaded!!!
//NOTE: Don't use the same gpio number twice. All pins here get configured, even if they are not used. Set pin to -1 to disable.
//NOTE: Not all pins can be freely configured. Read the processor datasheet, or use the default pinout.
//LED:
#define HW_PIN_LED 22
#define HW_LED_ON 0 //0:low is on, 1:high is on
#define HW_PIN_LED -1
#define HW_LED_ON 0 //0:low is on, 1:high is on
//IMU SPI:
#define HW_PIN_SPI_MISO 25
#define HW_PIN_SPI_MOSI 14
#define HW_PIN_SPI_SCLK 12
#define HW_PIN_IMU_CS 32
#define HW_PIN_IMU_EXTI 33 //external interrupt pin
#define HW_PIN_SPI_MISO -1
#define HW_PIN_SPI_MOSI -1
#define HW_PIN_SPI_SCLK -1
#define HW_PIN_IMU_CS -1
#define HW_PIN_IMU_EXTI -1 //REQUIRED: IMU external interrupt pin (required for SPI and I2C sensors)
//I2C for BARO, MAG, BAT sensors and for IMU if not using SPI
#define HW_PIN_I2C_SDA 23
#define HW_PIN_I2C_SCL 19
//I2C for BARO, MAG, BAT sensors (and for IMU if not using SPI IMU)
#define HW_PIN_I2C_SDA -1
#define HW_PIN_I2C_SCL -1
//Motor/Servo Outputs:
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {13,15,2,0} //list of output pins
#define HW_OUT_COUNT 4 //number of outputs
#define HW_PIN_OUT_LIST {-1,-1,-1,-1} //list of output pins, enter exactly HW_OUT_COUNT pins.
//Serial debug on USB Serial port (no GPIO pins)
//RC Receiver:
#define HW_PIN_RCIN_RX 16
#define HW_PIN_RCIN_TX 4
#define HW_PIN_RCIN_RX -1
#define HW_PIN_RCIN_TX -1
#define HW_PIN_RCIN_INVERTER -1 //only used for STM32 targets
//GPS:
Expand All @@ -82,27 +99,25 @@ Copyright (c) 2022 Nicholas Rehm - dRehmFlight
#define HW_PIN_BAT_V -1
#define HW_PIN_BAT_I -1
//BlackBox SPI:
//Black Box SPI (for sdcard or external flash chip):
#define HW_PIN_SPI2_MISO -1
#define HW_PIN_SPI2_MOSI -1
#define HW_PIN_SPI2_SCLK -1
#define HW_PIN_BB_CS -1
//Black Box SDCARD via MMC interface:
#define HW_PIN_SDMMC_DATA -1
#define HW_PIN_SDMMC_CLK -1
#define HW_PIN_SDMMC_CMD -1
//*/

//RP2040 specific options
//#define HW_RP2040_SYS_CLK_KHZ 200000 //overclocking
//#define HW_RP2040_USE_FREERTOS //enable use of FreeRTOS - experimental

//ESP32 specific options
//#define USE_ESP32_SOFTWIRE //use bitbang I2C (not hardware I2C) See https://github.com/espressif/esp-idf/issues/4999

//========================================================================================================================//
// BOARD //
//========================================================================================================================//
// Uncomment/change the following #include to the flight controller you want to use, or leave commented out to use the
// default board pinout (madflight_board_default_*.h). See library/madflight/src for all available boards
//#define USE_ESP32_SOFTWIRE //use bitbang I2C (not hardware I2C) See https://github.com/espressif/esp-idf/issues/499

//#include <madflight_board_betaflight_MTKS-MATEKH743.h>

//========================================================================================================================//
// USER-SPECIFIED DEFINES //
Expand Down
Loading

0 comments on commit 3b8ca8d

Please sign in to comment.