diff --git a/examples/01.Quadcopter/01.Quadcopter.ino b/examples/01.Quadcopter/01.Quadcopter.ino index 4dbc8c7..5a7c763 100644 --- a/examples/01.Quadcopter/01.Quadcopter.ino +++ b/examples/01.Quadcopter/01.Quadcopter.ino @@ -33,6 +33,62 @@ blink interval longer than 1 second - loop() is taking too much time fast blinking - something is wrong, connect USB serial for info ##########################################################################################################################*/ + +//========================================================================================================================// +// PINS // +//========================================================================================================================// +// PINS are setup in the board header file library/src/madflight_board_default_*.h, but you can use these defines to +// override the pins. The pin numbers below are the default for Raspberry Pi Pico + +//LED: +//#define HW_PIN_LED 25 +//#define HW_LED_ON 1 //0:low is on, 1:high is on + +//IMU SPI: +//#define HW_PIN_SPI_MISO 16 +//#define HW_PIN_SPI_MOSI 19 +//#define HW_PIN_SPI_SCLK 18 +//#define HW_PIN_IMU_CS 17 +//#define HW_PIN_IMU_EXTI 22 //external interrupt pin + +//I2C for BARO, MAG, BAT sensors and for IMU if not using SPI +//#define HW_PIN_I2C_SDA 20 +//#define HW_PIN_I2C_SCL 21 + +//Outputs: +//#define HW_OUT_COUNT 12 //number of outputs +//#define HW_PIN_OUT_LIST {2,3,4,5,6,7,10,11,12,13,14,15} //list of output pins + +//Serial debug on USB Serial port (no GPIO pins) + +//RC Receiver: +//#define HW_PIN_RCIN_RX 1 +//#define HW_PIN_RCIN_TX 0 +//#define HW_PIN_RCIN_INVERTER -1 //only used for STM32 targets + +//GPS: +//#define HW_PIN_GPS_RX 9 +//#define HW_PIN_GPS_TX 8 +//#define HW_PIN_GPS_INVERTER -1 //only used for STM32 targets + +//Battery ADC +//#define HW_PIN_BAT_V 28 +//#define HW_PIN_BAT_I -1 + +//BlackBox SPI: +//#define HW_PIN_SPI2_MISO -1 +//#define HW_PIN_SPI2_MOSI -1 +//#define HW_PIN_SPI2_SCLK -1 +//#define HW_PIN_BB_CS -1 + +//========================================================================================================================// +// 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 + +//#include + //========================================================================================================================// // USER-SPECIFIED DEFINES // //========================================================================================================================// @@ -68,18 +124,6 @@ fast blinking - something is wrong, connect USB serial for info //--- BLACKBOX LOGGER #define BB_USE BB_USE_NONE //BB_USE_INTFLASH internal flash, BB_USE_FLASH external flash, BB_USE_RAM ram or psram, BB_USE_NONE -//========================================================================================================================// -// 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_XXX.h). See library/madflight/src for all available boards - -//#include -//#include - -//Note: after the board include, you can override the sensors if needed. For example: -//#define IMU_USE IMU_USE_SPI_BMI270 //force use of BMI270 sensor, even if other sensor defined in the board header - //========================================================================================================================// // RC RECEIVER CONFIG // //========================================================================================================================// @@ -364,7 +408,7 @@ void imu_loop() { out_SetCommands(); //Sends command pulses to motors (only if out_armed=true) and servos #ifdef USE_IMU_BUS_I2C - //if IMU uses i2c bus, then get i2c sensor readings in the imu_loop to prevent i2c bus. Or, put the imu on a separate i2c bus. + //if IMU uses i2c bus, then get i2c sensor readings in imu_loop() to prevent i2c bus collisions. Alternatively, put the IMU on a separate i2c bus. i2c_sensors_update(); #endif diff --git a/src/boards/betaflight_target_converter.py b/src/boards/betaflight_target_converter.py index a490ba3..7594693 100644 --- a/src/boards/betaflight_target_converter.py +++ b/src/boards/betaflight_target_converter.py @@ -167,53 +167,94 @@ def fprint(txt) : fprint( "" ) fprint( "//LED:" ) - fprint( "const int HW_PIN_LED = " + resources.get("LED:1","-1") + ";" ) - fprint( "const int HW_LED_ON = 1; //0:low is on, 1:high is on" ) - + fprint( "#ifndef HW_PIN_LED" ) + fprint( " #define HW_PIN_LED " + resources.get("LED:1","-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_LED_ON" ) + fprint( " #define HW_LED_ON 1 //0:low is on, 1:high is on" ) + fprint( "#endif" ) + spi = sets.get("gyro_1_spibus","1") fprint( "" ) fprint( "//IMU SPI: (SPI"+spi+")" ) - fprint( "const int HW_PIN_SPI_MISO = " + resources.get("SPI_MISO:" + spi,"-1") + ";" ) - fprint( "const int HW_PIN_SPI_MOSI = " + resources.get("SPI_MOSI:" + spi,"-1") + ";" ) - fprint( "const int HW_PIN_SPI_SCLK = " + resources.get("SPI_SCK:" + spi,"-1") + ";" ) - fprint( "const int HW_PIN_IMU_CS = " + resources.get("GYRO_CS:1","-1") + ";" ) - fprint( "const int HW_PIN_IMU_EXTI = " + resources.get("GYRO_EXTI:1","-1") + ";" ) + fprint( "#ifndef HW_PIN_SPI_MISO" ) + fprint( " #define HW_PIN_SPI_MISO " + resources.get("SPI_MISO:" + spi,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_SPI_MOSI" ) + fprint( " #define HW_PIN_SPI_MOSI " + resources.get("SPI_MOSI:" + spi,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_SPI_SCLK" ) + fprint( " #define HW_PIN_SPI_SCLK " + resources.get("SPI_SCK:" + spi,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_IMU_CS" ) + fprint( " #define HW_PIN_IMU_CS " + resources.get("GYRO_CS:1","-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_IMU_EXTI" ) + fprint( " #define HW_PIN_IMU_EXTI " + resources.get("GYRO_EXTI:1","-1") ) + fprint( "#endif" ) i2c = sets.get("mag_i2c_device") i2c = sets.get("baro_i2c_device",i2c) if i2c is None: i2c = "1" fprint( "" ) fprint( "//BARO/MAG I2C: (I2C"+i2c+")" ) - fprint( "const int HW_PIN_I2C_SDA = " + resources.get("I2C_SCL:" + i2c,"-1") + ";" ) - fprint( "const int HW_PIN_I2C_SCL = " + resources.get("I2C_SDA:" + i2c,"-1") + ";" ) + fprint( "#ifndef HW_PIN_I2C_SDA" ) + fprint( " #define HW_PIN_I2C_SDA " + resources.get("I2C_SCL:" + i2c,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_I2C_SCL" ) + fprint( " #define HW_PIN_I2C_SCL " + resources.get("I2C_SDA:" + i2c,"-1") ) + fprint( "#endif" ) fprint( "" ) fprint( "//Outputs:" ) - fprint( "const int HW_OUT_COUNT = " + str(len(motors)) + ";" ) - fprint( "const int HW_PIN_OUT[] = {" + ",".join(motors) + "};" ) + fprint( "#ifndef HW_OUT_COUNT" ) + fprint( " #define HW_OUT_COUNT " + str(len(motors)) ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_OUT_LIST" ) + fprint( " #define HW_PIN_OUT_LIST {" + ",".join(motors) + "}" ) + fprint( "#endif" ) fprint( "" ) fprint( "//RC Receiver: (SERIAL"+rcin_serial+")" ) - fprint( "const int HW_PIN_RCIN_RX = " + resources.get("SERIAL_RX:"+rcin_serial,"-1") + ";" ) - fprint( "const int HW_PIN_RCIN_TX = " + resources.get("SERIAL_TX:"+rcin_serial,"-1") + ";" ) - fprint( "const int HW_PIN_RCIN_INVERTER = " + resources.get("INVERTER:"+rcin_serial,"-1") + ";" ) + fprint( "#ifndef HW_PIN_RCIN_RX" ) + fprint( " #define HW_PIN_RCIN_RX " + resources.get("SERIAL_RX:"+rcin_serial,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_RCIN_TX" ) + fprint( " #define HW_PIN_RCIN_TX " + resources.get("SERIAL_TX:"+rcin_serial,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_RCIN_INVERTER" ) + fprint( " #define HW_PIN_RCIN_INVERTER " + resources.get("INVERTER:"+rcin_serial,"-1") ) + fprint( "#endif" ) fprint( "" ) fprint( "//GPS: (SERIAL"+gps_serial+")" ) - fprint( "const int HW_PIN_GPS_RX = " + resources.get("SERIAL_RX:"+gps_serial,"-1") + ";" ) - fprint( "const int HW_PIN_GPS_TX = " + resources.get("SERIAL_TX:"+gps_serial,"-1") + ";" ) - fprint( "const int HW_PIN_GPS_INVERTER = " + resources.get("INVERTER:"+gps_serial,"-1") + ";" ) + fprint( "#ifndef HW_PIN_GPS_RX" ) + fprint( " #define HW_PIN_GPS_RX " + resources.get("SERIAL_RX:"+gps_serial,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_GPS_TX" ) + fprint( " #define HW_PIN_GPS_TX " + resources.get("SERIAL_TX:"+gps_serial,"-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_GPS_INVERTER" ) + fprint( " #define HW_PIN_GPS_INVERTER " + resources.get("INVERTER:"+gps_serial,"-1") ) + fprint( "#endif" ) fprint( "" ) fprint( "//Battery ADC voltage and current inputs:" ) - fprint( "const int HW_PIN_BAT_V = " + resources.get("ADC_BATT:1","-1") + ";" ) - fprint( "const int HW_PIN_BAT_I = " + resources.get("ADC_CURR:1","-1") + ";" ) + fprint( "#ifndef HW_PIN_BAT_V" ) + fprint( " #define HW_PIN_BAT_V " + resources.get("ADC_BATT:1","-1") ) + fprint( "#endif" ) + fprint( "#ifndef HW_PIN_BAT_I" ) + fprint( " #define HW_PIN_BAT_I " + resources.get("ADC_CURR:1","-1") ) + fprint( "#endif" ) + + fprint( "" ) + fprint( "const int HW_PIN_OUT[] = HW_PIN_OUT_LIST;" ) fprint( "" ) fprint( "//Include Libraries" ) - fprint( "#include //I2C communication" ) - fprint( "#include //SPI communication" ) - fprint( "#include \"madflight/hw_STM32/STM32_PWM.h\" //Servo and oneshot" ) + fprint( "#include //I2C communication" ) + fprint( "#include //SPI communication" ) + fprint( "#include \"madflight/hw_STM32/STM32_PWM.h\" //Servo and oneshot" ) fprint( "" ) fprint( "//Bus Setup" ) @@ -254,10 +295,10 @@ def fprint(txt) : fprint( "#define HW_PIN_I2C { " + ", ".join(p) + " } // {INDEX,SCL,SDA}" ) - fprint( "" ) - fprint( "//Motors:" ) - fprint( "#define HW_MOTOR_COUNT " + str(len(motors)) ) - fprint( "#define HW_MOTOR_OUT {" + ",".join(motors) + "}" ) +# fprint( "" ) +# fprint( "//Motors:" ) +# fprint( "#define HW_MOTOR_COUNT " + str(len(motors)) ) +# fprint( "#define HW_MOTOR_OUT {" + ",".join(motors) + "}" ) fprint( "" ) fprint( "//other pins" ) diff --git a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTF4.h b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTF4.h index 1e88986..412f068 100644 --- a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTF4.h +++ b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.870150 +Generated on: 2024-05-14 03:27:31.771662 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENFLIGHTF4 @@ -25,42 +25,82 @@ Manufacturer ID: AFNG #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB8,PB9,PA0,PA1,PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PB9,PA0,PA1,PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB8,PB9,PA0,PA1,PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7.h b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7.h index a0cf567..c430bca 100644 --- a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7.h +++ b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.870150 +Generated on: 2024-05-14 03:27:31.773242 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENFLIGHTNGF7 @@ -30,42 +30,82 @@ Manufacturer ID: AFNG #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -86,10 +126,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_DUAL.h b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_DUAL.h index 7089c84..3d65ab5 100644 --- a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_DUAL.h +++ b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.885787 +Generated on: 2024-05-14 03:27:31.774273 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENFLIGHTNGF7_DUAL @@ -24,42 +24,82 @@ Manufacturer ID: AFNG #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_ELRS.h b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_ELRS.h index 0e93611..bb56507 100644 --- a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_ELRS.h +++ b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_ELRS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.885787 +Generated on: 2024-05-14 03:27:31.775839 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENFLIGHTNGF7_ELRS @@ -39,42 +39,82 @@ Manufacturer ID: AFNG #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -95,10 +135,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_RX.h b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_RX.h index bc2ee18..1a53f5a 100644 --- a/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_RX.h +++ b/src/madflight_board_betaflight_AFNG-ALIENFLIGHTNGF7_RX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.885787 +Generated on: 2024-05-14 03:27:31.776971 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENFLIGHTNGF7_RX @@ -27,42 +27,82 @@ Manufacturer ID: AFNG #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB14,PB0,PA0,PC8,PA1,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_AIKO-AIKONF4.h b/src/madflight_board_betaflight_AIKO-AIKONF4.h index 5751390..4088580 100644 --- a/src/madflight_board_betaflight_AIKO-AIKONF4.h +++ b/src/madflight_board_betaflight_AIKO-AIKONF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.901412 +Generated on: 2024-05-14 03:27:31.778144 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIKONF4 @@ -27,42 +27,82 @@ Manufacturer ID: AIKO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB5 #define HW_PIN_PPM PB6 diff --git a/src/madflight_board_betaflight_AIKO-AIKONF7.h b/src/madflight_board_betaflight_AIKO-AIKONF7.h index 73e9c72..4740936 100644 --- a/src/madflight_board_betaflight_AIKO-AIKONF7.h +++ b/src/madflight_board_betaflight_AIKO-AIKONF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.901412 +Generated on: 2024-05-14 03:27:31.779166 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIKONF7 @@ -27,42 +27,82 @@ Manufacturer ID: AIKO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PB6,PB8,PB7,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PB6,PB8,PB7,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PB6,PB8,PB7,PB1} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_AIRB-AG3XF4.h b/src/madflight_board_betaflight_AIRB-AG3XF4.h index 6d8eeb4..c5f09ff 100644 --- a/src/madflight_board_betaflight_AIRB-AG3XF4.h +++ b/src/madflight_board_betaflight_AIRB-AG3XF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.901412 +Generated on: 2024-05-14 03:27:31.780235 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AG3XF4 @@ -24,42 +24,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15} - //other pins #define HW_PIN_PPM PA8 #define HW_PIN_LED_STRIP PA2 diff --git a/src/madflight_board_betaflight_AIRB-AG3XF7.h b/src/madflight_board_betaflight_AIRB-AG3XF7.h index 610cd1a..2d0b59f 100644 --- a/src/madflight_board_betaflight_AIRB-AG3XF7.h +++ b/src/madflight_board_betaflight_AIRB-AG3XF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.917037 +Generated on: 2024-05-14 03:27:31.781293 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AG3XF7 @@ -24,42 +24,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PB0,PB1,PB7,PB8,PC9,PB14,PB15} - //other pins #define HW_PIN_PPM PA8 #define HW_PIN_LED_STRIP PA2 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTF4.h b/src/madflight_board_betaflight_AIRB-AIRBOTF4.h index 290240e..a3c2d0d 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTF4.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.917037 +Generated on: 2024-05-14 03:27:31.782398 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTF4 @@ -30,42 +30,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -86,10 +126,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTF4SD.h b/src/madflight_board_betaflight_AIRB-AIRBOTF4SD.h index 2cbd855..03ff0ab 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTF4SD.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTF4SD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.917037 +Generated on: 2024-05-14 03:27:31.783421 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTF4SD @@ -29,42 +29,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB13; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB13 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -85,10 +125,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTF4V2.h b/src/madflight_board_betaflight_AIRB-AIRBOTF4V2.h index 66430a7..6577c7a 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTF4V2.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTF4V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.932662 +Generated on: 2024-05-14 03:27:31.784457 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTF4V2 @@ -23,42 +23,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTF7.h b/src/madflight_board_betaflight_AIRB-AIRBOTF7.h index 3287a99..7abbde9 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTF7.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.932662 +Generated on: 2024-05-14 03:27:31.785612 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTF7 @@ -25,42 +25,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTF7HDV.h b/src/madflight_board_betaflight_AIRB-AIRBOTF7HDV.h index da504c5..4563006 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTF7HDV.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTF7HDV.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.948288 +Generated on: 2024-05-14 03:27:31.786530 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTF7HDV @@ -23,42 +23,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL3) -const int HW_PIN_RCIN_RX = PC11; -const int HW_PIN_RCIN_TX = PC10; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PC11 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PC10 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL4) -const int HW_PIN_GPS_RX = PA1; -const int HW_PIN_GPS_TX = PA0; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA0 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-AIRBOTG4AIO.h b/src/madflight_board_betaflight_AIRB-AIRBOTG4AIO.h index 1550b6b..3d7509d 100644 --- a/src/madflight_board_betaflight_AIRB-AIRBOTG4AIO.h +++ b/src/madflight_board_betaflight_AIRB-AIRBOTG4AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.948288 +Generated on: 2024-05-14 03:27:31.787564 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRBOTG4AIO @@ -25,42 +25,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = -1; -const int HW_PIN_SPI_MOSI = -1; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB0; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO -1 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI -1 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB0 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA13; -const int HW_PIN_I2C_SCL = PA14; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA13 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PA14 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PB4; -const int HW_PIN_GPS_TX = PB3; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB4 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB3 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB2; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA13,PA14} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3} - //other pins #define HW_PIN_BEEPER PB7 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_AIRB-HELSEL_STRIKERF7.h b/src/madflight_board_betaflight_AIRB-HELSEL_STRIKERF7.h index f0c40c7..617a371 100644 --- a/src/madflight_board_betaflight_AIRB-HELSEL_STRIKERF7.h +++ b/src/madflight_board_betaflight_AIRB-HELSEL_STRIKERF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.948288 +Generated on: 2024-05-14 03:27:31.788190 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HELSEL_STRIKERF7 @@ -22,42 +22,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-NOX.h b/src/madflight_board_betaflight_AIRB-NOX.h index 2cb9f9a..6e8e746 100644 --- a/src/madflight_board_betaflight_AIRB-NOX.h +++ b/src/madflight_board_betaflight_AIRB-NOX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.965920 +Generated on: 2024-05-14 03:27:31.789306 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NOX @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA1,PA7,PB8,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA1,PA7,PB8,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC14; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC14 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA5; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA1,PA7,PB8,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB10 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF4.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF4.h index 0d8d7da..4821fed 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF4.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.965920 +Generated on: 2024-05-14 03:27:31.790342 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF4 @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF4FW.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF4FW.h index d983e60..739ba7b 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF4FW.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF4FW.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.965920 +Generated on: 2024-05-14 03:27:31.791377 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF4FW @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PB5} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF4NANOV7.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF4NANOV7.h index 7a4f64a..5c09d69 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF4NANOV7.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF4NANOV7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.979939 +Generated on: 2024-05-14 03:27:31.792444 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF4NANOV7 @@ -23,42 +23,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF4SD.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF4SD.h index 658490d..39aa88d 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF4SD.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF4SD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.979939 +Generated on: 2024-05-14 03:27:31.793203 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF4SD @@ -25,42 +25,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC9; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC9 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF4V6.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF4V6.h index 3e01a9b..a9be9de 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF4V6.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF4V6.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.979939 +Generated on: 2024-05-14 03:27:31.794229 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF4V6 @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PB5,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PB5,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PB5,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF7.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF7.h index 0d08c0e..f210d0a 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF7.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.995589 +Generated on: 2024-05-14 03:27:31.795341 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF7 @@ -25,42 +25,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PE8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF7NANOV7.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF7NANOV7.h index ecccbeb..791f6b5 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF7NANOV7.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF7NANOV7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.995589 +Generated on: 2024-05-14 03:27:31.796375 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF7NANOV7 @@ -22,42 +22,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AIRB-OMNIBUSF7V2.h b/src/madflight_board_betaflight_AIRB-OMNIBUSF7V2.h index 813c48e..0cbbc54 100644 --- a/src/madflight_board_betaflight_AIRB-OMNIBUSF7V2.h +++ b/src/madflight_board_betaflight_AIRB-OMNIBUSF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:42.995589 +Generated on: 2024-05-14 03:27:31.796891 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNIBUSF7V2 @@ -25,42 +25,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_AIRB-OMNINXT4.h b/src/madflight_board_betaflight_AIRB-OMNINXT4.h index f416b99..e8044f2 100644 --- a/src/madflight_board_betaflight_AIRB-OMNINXT4.h +++ b/src/madflight_board_betaflight_AIRB-OMNINXT4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.011207 +Generated on: 2024-05-14 03:27:31.798311 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNINXT4 @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB5,PB4,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB5,PB4,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC5; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC5 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB5,PB4,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_AIRB-OMNINXT7.h b/src/madflight_board_betaflight_AIRB-OMNINXT7.h index 89a2ceb..109d485 100644 --- a/src/madflight_board_betaflight_AIRB-OMNINXT7.h +++ b/src/madflight_board_betaflight_AIRB-OMNINXT7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.011207 +Generated on: 2024-05-14 03:27:31.799470 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: OMNINXT7 @@ -26,42 +26,82 @@ Manufacturer ID: AIRB #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB5,PB4,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB5,PB4,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB5,PB4,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_ALWH-ALIENWHOOPF4.h b/src/madflight_board_betaflight_ALWH-ALIENWHOOPF4.h index f9c241a..2186147 100644 --- a/src/madflight_board_betaflight_ALWH-ALIENWHOOPF4.h +++ b/src/madflight_board_betaflight_ALWH-ALIENWHOOPF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.011207 +Generated on: 2024-05-14 03:27:31.799990 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ALIENWHOOPF4 @@ -22,42 +22,82 @@ Manufacturer ID: ALWH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = -1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V -1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_BEEPER PA2 #define HW_PIN_LED_STRIP PA0 diff --git a/src/madflight_board_betaflight_ANYL-MERCURYG4.h b/src/madflight_board_betaflight_ANYL-MERCURYG4.h index a3577e5..ca3c31d 100644 --- a/src/madflight_board_betaflight_ANYL-MERCURYG4.h +++ b/src/madflight_board_betaflight_ANYL-MERCURYG4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.026827 +Generated on: 2024-05-14 03:27:31.801033 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MERCURYG4 @@ -25,42 +25,82 @@ Manufacturer ID: ANYL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = -1; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED -1 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PA9; -const int HW_PIN_I2C_SCL = PA8; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA9 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PA8 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PA4,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PA4,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PB4; -const int HW_PIN_GPS_TX = PB3; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB4 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB3 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PA15,PB9}, {2,PA9,PA8} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PA4,PB0,PB1} - //other pins #define HW_PIN_GYRO_EXTI PC13 #define HW_PIN_GYRO_CS PB12 diff --git a/src/madflight_board_betaflight_APEX-APEXF7.h b/src/madflight_board_betaflight_APEX-APEXF7.h index 2ba5108..1b9287e 100644 --- a/src/madflight_board_betaflight_APEX-APEXF7.h +++ b/src/madflight_board_betaflight_APEX-APEXF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.026827 +Generated on: 2024-05-14 03:27:31.801975 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: APEXF7 @@ -25,42 +25,82 @@ Manufacturer ID: APEX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PD2; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PD2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AXFL-ARGUSF7AIO.h b/src/madflight_board_betaflight_AXFL-ARGUSF7AIO.h index 0332f70..b75ec5e 100644 --- a/src/madflight_board_betaflight_AXFL-ARGUSF7AIO.h +++ b/src/madflight_board_betaflight_AXFL-ARGUSF7AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.026827 +Generated on: 2024-05-14 03:27:31.803009 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ARGUSF7AIO @@ -25,42 +25,82 @@ Manufacturer ID: AXFL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_AXFL-AXISFLYINGF7.h b/src/madflight_board_betaflight_AXFL-AXISFLYINGF7.h index 06e121c..0f5dfc7 100644 --- a/src/madflight_board_betaflight_AXFL-AXISFLYINGF7.h +++ b/src/madflight_board_betaflight_AXFL-AXISFLYINGF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.042448 +Generated on: 2024-05-14 03:27:31.804048 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AXISFLYINGF7 @@ -26,42 +26,82 @@ Manufacturer ID: AXFL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB10; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB10 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC9,PB0,PC8,PB1,PB6,PB7,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PB0,PC8,PB1,PB6,PB7,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC9,PB0,PC8,PB1,PB6,PB7,PC7,PC6} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_AXFL-AXISFLYINGF7PRO.h b/src/madflight_board_betaflight_AXFL-AXISFLYINGF7PRO.h index e250889..95485a6 100644 --- a/src/madflight_board_betaflight_AXFL-AXISFLYINGF7PRO.h +++ b/src/madflight_board_betaflight_AXFL-AXISFLYINGF7PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.042448 +Generated on: 2024-05-14 03:27:31.804586 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AXISFLYINGF7PRO @@ -26,42 +26,82 @@ Manufacturer ID: AXFL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVF405.h b/src/madflight_board_betaflight_BEFH-BETAFPVF405.h index 3f0ec29..e73adf8 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVF405.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.055541 +Generated on: 2024-05-14 03:27:31.805680 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVF405 @@ -26,42 +26,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PC8,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PC8,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC9; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC9 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PC8,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVF411.h b/src/madflight_board_betaflight_BEFH-BETAFPVF411.h index 6ddaad5..62c4d52 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVF411.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.061375 +Generated on: 2024-05-14 03:27:31.806738 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVF411 @@ -24,42 +24,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVF411RX.h b/src/madflight_board_betaflight_BEFH-BETAFPVF411RX.h index b8c301f..354bd2b 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVF411RX.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVF411RX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.066918 +Generated on: 2024-05-14 03:27:31.807773 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVF411RX @@ -26,42 +26,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVF4SX1280.h b/src/madflight_board_betaflight_BEFH-BETAFPVF4SX1280.h index 9ddd273..9e73386 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVF4SX1280.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVF4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.071918 +Generated on: 2024-05-14 03:27:31.808877 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVF4SX1280 @@ -36,42 +36,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7,PA8,PA10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7,PA8,PA10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -92,10 +132,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7,PA8,PA10} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVF722.h b/src/madflight_board_betaflight_BEFH-BETAFPVF722.h index ed97a2f..70769c8 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVF722.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.076918 +Generated on: 2024-05-14 03:27:31.810443 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVF722 @@ -25,42 +25,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA1,PA0,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA1,PA0,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA1,PA0,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_BEFH-BETAFPVH743.h b/src/madflight_board_betaflight_BEFH-BETAFPVH743.h index d18bd0f..59bd3eb 100644 --- a/src/madflight_board_betaflight_BEFH-BETAFPVH743.h +++ b/src/madflight_board_betaflight_BEFH-BETAFPVH743.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.082145 +Generated on: 2024-05-14 03:27:31.811484 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFPVH743 @@ -25,42 +25,82 @@ Manufacturer ID: BEFH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5} - //other pins #define HW_PIN_BEEPER PB3 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_BKMN-BLUEJAYF4.h b/src/madflight_board_betaflight_BKMN-BLUEJAYF4.h index 75f0f93..4aa90fb 100644 --- a/src/madflight_board_betaflight_BKMN-BLUEJAYF4.h +++ b/src/madflight_board_betaflight_BKMN-BLUEJAYF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.089144 +Generated on: 2024-05-14 03:27:31.813053 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BLUEJAYF4 @@ -23,42 +23,82 @@ Manufacturer ID: BKMN #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB6; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB6 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC1 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_BKMN-NERO.h b/src/madflight_board_betaflight_BKMN-NERO.h index 25162e5..d2c8dc8 100644 --- a/src/madflight_board_betaflight_BKMN-NERO.h +++ b/src/madflight_board_betaflight_BKMN-NERO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.094441 +Generated on: 2024-05-14 03:27:31.814703 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NERO @@ -21,42 +21,82 @@ Manufacturer ID: BKMN #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB6; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB6 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = -1; -const int HW_PIN_IMU_EXTI = PB15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS -1 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3} - //other pins //#define HW_PIN_LED PB6 #define HW_PIN_LED_2 PB5 diff --git a/src/madflight_board_betaflight_CLNE-FREEAXISF4.h b/src/madflight_board_betaflight_CLNE-FREEAXISF4.h index 65387fe..aabeb4c 100644 --- a/src/madflight_board_betaflight_CLNE-FREEAXISF4.h +++ b/src/madflight_board_betaflight_CLNE-FREEAXISF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.099581 +Generated on: 2024-05-14 03:27:31.815745 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FREEAXISF4 @@ -24,42 +24,82 @@ Manufacturer ID: CLNE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_CLNE-MATEKF405STD_CLONE.h b/src/madflight_board_betaflight_CLNE-MATEKF405STD_CLONE.h index 7313502..e32e21b 100644 --- a/src/madflight_board_betaflight_CLNE-MATEKF405STD_CLONE.h +++ b/src/madflight_board_betaflight_CLNE-MATEKF405STD_CLONE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.104581 +Generated on: 2024-05-14 03:27:31.817316 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405STD_CLONE @@ -26,42 +26,82 @@ Manufacturer ID: CLNE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_CLRA-CLRACINGF4.h b/src/madflight_board_betaflight_CLRA-CLRACINGF4.h index 6c9e4f9..2a03562 100644 --- a/src/madflight_board_betaflight_CLRA-CLRACINGF4.h +++ b/src/madflight_board_betaflight_CLRA-CLRACINGF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.109567 +Generated on: 2024-05-14 03:27:31.818357 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CLRACINGF4 @@ -24,42 +24,82 @@ Manufacturer ID: CLRA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_CLRA-CLRACINGF4V2.h b/src/madflight_board_betaflight_CLRA-CLRACINGF4V2.h index 5faf1fc..8eae673 100644 --- a/src/madflight_board_betaflight_CLRA-CLRACINGF4V2.h +++ b/src/madflight_board_betaflight_CLRA-CLRACINGF4V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.115544 +Generated on: 2024-05-14 03:27:31.819404 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CLRACINGF4V2 @@ -25,42 +25,82 @@ Manufacturer ID: CLRA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_CLRA-CLRACINGF7.h b/src/madflight_board_betaflight_CLRA-CLRACINGF7.h index 0d00ef9..72a9d48 100644 --- a/src/madflight_board_betaflight_CLRA-CLRACINGF7.h +++ b/src/madflight_board_betaflight_CLRA-CLRACINGF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.119508 +Generated on: 2024-05-14 03:27:31.820442 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CLRACINGF7 @@ -27,42 +27,82 @@ Manufacturer ID: CLRA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_CUST-RPMENERGYF722HD.h b/src/madflight_board_betaflight_CUST-RPMENERGYF722HD.h index 70879c8..82b92b5 100644 --- a/src/madflight_board_betaflight_CUST-RPMENERGYF722HD.h +++ b/src/madflight_board_betaflight_CUST-RPMENERGYF722HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.125543 +Generated on: 2024-05-14 03:27:31.821503 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: RPMENERGYF722HD @@ -23,42 +23,82 @@ Manufacturer ID: CUST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB1; -const int HW_PIN_IMU_EXTI = PB0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB1 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_CUST-RUSRACE_F4.h b/src/madflight_board_betaflight_CUST-RUSRACE_F4.h index 02c5700..d02382e 100644 --- a/src/madflight_board_betaflight_CUST-RUSRACE_F4.h +++ b/src/madflight_board_betaflight_CUST-RUSRACE_F4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.131636 +Generated on: 2024-05-14 03:27:31.822337 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: RUSRACE_F4 @@ -24,42 +24,82 @@ Manufacturer ID: CUST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_LED_STRIP PB6 //#define HW_PIN_LED PB9 diff --git a/src/madflight_board_betaflight_CUST-RUSRACE_F7.h b/src/madflight_board_betaflight_CUST-RUSRACE_F7.h index daaa5cb..2f76e88 100644 --- a/src/madflight_board_betaflight_CUST-RUSRACE_F7.h +++ b/src/madflight_board_betaflight_CUST-RUSRACE_F7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.137633 +Generated on: 2024-05-14 03:27:31.823387 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: RUSRACE_F7 @@ -24,42 +24,82 @@ Manufacturer ID: CUST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_LED_STRIP PB6 //#define HW_PIN_LED PB9 diff --git a/src/madflight_board_betaflight_CUST-SIRMIXALOT.h b/src/madflight_board_betaflight_CUST-SIRMIXALOT.h index eb3b391..b049fb2 100644 --- a/src/madflight_board_betaflight_CUST-SIRMIXALOT.h +++ b/src/madflight_board_betaflight_CUST-SIRMIXALOT.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.142632 +Generated on: 2024-05-14 03:27:31.824465 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SIRMIXALOT @@ -20,42 +20,82 @@ Manufacturer ID: CUST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA8; -const int HW_PIN_I2C_SCL = PC9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PC9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PA15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PA15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PA15} - //other pins #define HW_PIN_BEEPER PC11 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_CYCL-CYCLONEF405_PRO.h b/src/madflight_board_betaflight_CYCL-CYCLONEF405_PRO.h index 0a155da..25842cd 100644 --- a/src/madflight_board_betaflight_CYCL-CYCLONEF405_PRO.h +++ b/src/madflight_board_betaflight_CYCL-CYCLONEF405_PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.148949 +Generated on: 2024-05-14 03:27:31.825540 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CYCLONEF405_PRO @@ -20,42 +20,82 @@ Manufacturer ID: CYCL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_CYCL-CYCLONEF722_PRO.h b/src/madflight_board_betaflight_CYCL-CYCLONEF722_PRO.h index fc7052c..7b32821 100644 --- a/src/madflight_board_betaflight_CYCL-CYCLONEF722_PRO.h +++ b/src/madflight_board_betaflight_CYCL-CYCLONEF722_PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.153954 +Generated on: 2024-05-14 03:27:31.826702 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CYCLONEF722_PRO @@ -27,42 +27,82 @@ Manufacturer ID: CYCL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DAFP-DARWINF411.h b/src/madflight_board_betaflight_DAFP-DARWINF411.h index 4a5a81b..1cc3502 100644 --- a/src/madflight_board_betaflight_DAFP-DARWINF411.h +++ b/src/madflight_board_betaflight_DAFP-DARWINF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.157919 +Generated on: 2024-05-14 03:27:31.827252 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DARWINF411 @@ -25,42 +25,82 @@ Manufacturer ID: DAFP #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_DAFP-DARWINF4SX1280HD.h b/src/madflight_board_betaflight_DAFP-DARWINF4SX1280HD.h index 530466c..bc4e330 100644 --- a/src/madflight_board_betaflight_DAFP-DARWINF4SX1280HD.h +++ b/src/madflight_board_betaflight_DAFP-DARWINF4SX1280HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.163331 +Generated on: 2024-05-14 03:27:31.828321 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DARWINF4SX1280HD @@ -39,42 +39,82 @@ Manufacturer ID: DAFP #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7,PA8,PA10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7,PA8,PA10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -95,10 +135,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7,PA8,PA10} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_DAFP-DARWINF722HD.h b/src/madflight_board_betaflight_DAFP-DARWINF722HD.h index d50cf41..3987603 100644 --- a/src/madflight_board_betaflight_DAFP-DARWINF722HD.h +++ b/src/madflight_board_betaflight_DAFP-DARWINF722HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.168856 +Generated on: 2024-05-14 03:27:31.829389 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DARWINF722HD @@ -25,42 +25,82 @@ Manufacturer ID: DAFP #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_DAFP-DARWINF722HDV2.h b/src/madflight_board_betaflight_DAFP-DARWINF722HDV2.h index 02192b5..445c97d 100644 --- a/src/madflight_board_betaflight_DAFP-DARWINF722HDV2.h +++ b/src/madflight_board_betaflight_DAFP-DARWINF722HDV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.172856 +Generated on: 2024-05-14 03:27:31.830430 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DARWINF722HDV2 @@ -25,42 +25,82 @@ Manufacturer ID: DAFP #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_DAKE-DAKEFPVF405.h b/src/madflight_board_betaflight_DAKE-DAKEFPVF405.h index 7ea1c89..f7bcff9 100644 --- a/src/madflight_board_betaflight_DAKE-DAKEFPVF405.h +++ b/src/madflight_board_betaflight_DAKE-DAKEFPVF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.179244 +Generated on: 2024-05-14 03:27:31.831715 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DAKEFPVF405 @@ -28,42 +28,82 @@ Manufacturer ID: DAKE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC8,PC9,PB6,PB7,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB6,PB7,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC8,PC9,PB6,PB7,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC3 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DAKE-DAKEFPVF411.h b/src/madflight_board_betaflight_DAKE-DAKEFPVF411.h index 7b8a2a4..aa40534 100644 --- a/src/madflight_board_betaflight_DAKE-DAKEFPVF411.h +++ b/src/madflight_board_betaflight_DAKE-DAKEFPVF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.184217 +Generated on: 2024-05-14 03:27:31.832442 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DAKEFPVF411 @@ -25,42 +25,82 @@ Manufacturer ID: DAKE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_LED_STRIP PA1 diff --git a/src/madflight_board_betaflight_DAKE-DAKEFPVF722.h b/src/madflight_board_betaflight_DAKE-DAKEFPVF722.h index 7287173..ca8dd70 100644 --- a/src/madflight_board_betaflight_DAKE-DAKEFPVF722.h +++ b/src/madflight_board_betaflight_DAKE-DAKEFPVF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.189206 +Generated on: 2024-05-14 03:27:31.833400 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DAKEFPVF722 @@ -28,42 +28,82 @@ Manufacturer ID: DAKE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC8,PC9,PB6,PB7,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB6,PB7,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC8,PC9,PB6,PB7,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC3 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DALR-DALRCF405.h b/src/madflight_board_betaflight_DALR-DALRCF405.h index b1215ec..da062ed 100644 --- a/src/madflight_board_betaflight_DALR-DALRCF405.h +++ b/src/madflight_board_betaflight_DALR-DALRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.195583 +Generated on: 2024-05-14 03:27:31.834474 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DALRCF405 @@ -25,42 +25,82 @@ Manufacturer ID: DALR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PC6,PA10,PA8,PC8,PB1,PC7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PC6,PA10,PA8,PC8,PB1,PC7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PC6,PA10,PA8,PC8,PB1,PC7,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_DALR-DALRCF722DUAL.h b/src/madflight_board_betaflight_DALR-DALRCF722DUAL.h index bced6cf..f6b9cdf 100644 --- a/src/madflight_board_betaflight_DALR-DALRCF722DUAL.h +++ b/src/madflight_board_betaflight_DALR-DALRCF722DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.200581 +Generated on: 2024-05-14 03:27:31.835195 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DALRCF722DUAL @@ -26,42 +26,82 @@ Manufacturer ID: DALR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB0; -const int HW_PIN_IMU_EXTI = PB10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB0 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA8,PA9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA8,PA9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA8,PA9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_DERC-SOULF4.h b/src/madflight_board_betaflight_DERC-SOULF4.h index f646759..aba178b 100644 --- a/src/madflight_board_betaflight_DERC-SOULF4.h +++ b/src/madflight_board_betaflight_DERC-SOULF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.206580 +Generated on: 2024-05-14 03:27:31.836245 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SOULF4 @@ -26,42 +26,82 @@ Manufacturer ID: DERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA0} - //other pins #define HW_PIN_BEEPER PB6 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_DFRA-DFR_F722_DUAL_HD.h b/src/madflight_board_betaflight_DFRA-DFR_F722_DUAL_HD.h index ddf71df..892ffb7 100644 --- a/src/madflight_board_betaflight_DFRA-DFR_F722_DUAL_HD.h +++ b/src/madflight_board_betaflight_DFRA-DFR_F722_DUAL_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.212348 +Generated on: 2024-05-14 03:27:31.837286 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DFR_F722_DUAL_HD @@ -25,42 +25,82 @@ Manufacturer ID: DFRA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_DFRC-DREAMFLYF411.h b/src/madflight_board_betaflight_DFRC-DREAMFLYF411.h index 83921f1..7b2b711 100644 --- a/src/madflight_board_betaflight_DFRC-DREAMFLYF411.h +++ b/src/madflight_board_betaflight_DFRC-DREAMFLYF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.217336 +Generated on: 2024-05-14 03:27:31.838348 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DREAMFLYF411 @@ -25,42 +25,82 @@ Manufacturer ID: DFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_DIAT-FURYF4.h b/src/madflight_board_betaflight_DIAT-FURYF4.h index 2d5b4b6..23acbd8 100644 --- a/src/madflight_board_betaflight_DIAT-FURYF4.h +++ b/src/madflight_board_betaflight_DIAT-FURYF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.222335 +Generated on: 2024-05-14 03:27:31.838868 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FURYF4 @@ -24,42 +24,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PB1,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PB1,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PB1,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_PPM PC9 diff --git a/src/madflight_board_betaflight_DIAT-FURYF4OSD.h b/src/madflight_board_betaflight_DIAT-FURYF4OSD.h index f32f1ea..5ae6f02 100644 --- a/src/madflight_board_betaflight_DIAT-FURYF4OSD.h +++ b/src/madflight_board_betaflight_DIAT-FURYF4OSD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.227695 +Generated on: 2024-05-14 03:27:31.839906 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FURYF4OSD @@ -28,42 +28,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 1 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PB1,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PB1,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PB1,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_PPM PC9 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF405US.h b/src/madflight_board_betaflight_DIAT-MAMBAF405US.h index 819aa26..2d3d3af 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF405US.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF405US.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.232731 +Generated on: 2024-05-14 03:27:31.841206 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF405US @@ -24,42 +24,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins //#define HW_PIN_LED PC15 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF405US_I2C.h b/src/madflight_board_betaflight_DIAT-MAMBAF405US_I2C.h index 5bc5e9b..e596599 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF405US_I2C.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF405US_I2C.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.236748 +Generated on: 2024-05-14 03:27:31.842267 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF405US_I2C @@ -25,42 +25,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins //#define HW_PIN_LED PC15 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF405_2022A.h b/src/madflight_board_betaflight_DIAT-MAMBAF405_2022A.h index cbe3bfe..1c07da7 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF405_2022A.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF405_2022A.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.241732 +Generated on: 2024-05-14 03:27:31.843343 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF405_2022A @@ -25,42 +25,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF405_2022B.h b/src/madflight_board_betaflight_DIAT-MAMBAF405_2022B.h index 7190979..f927ad5 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF405_2022B.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF405_2022B.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.244286 +Generated on: 2024-05-14 03:27:31.844405 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF405_2022B @@ -27,42 +27,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF411.h b/src/madflight_board_betaflight_DIAT-MAMBAF411.h index 2920be5..86ef8b4 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF411.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.244286 +Generated on: 2024-05-14 03:27:31.844972 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF411 @@ -22,42 +22,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB3,PB4,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB3,PB4,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB10; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB10 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB3,PB4,PB6,PB7} - //other pins //#define HW_PIN_LED PC13 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF722.h b/src/madflight_board_betaflight_DIAT-MAMBAF722.h index 774e4bb..f777de9 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF722.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.244286 +Generated on: 2024-05-14 03:27:31.846023 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF722 @@ -24,42 +24,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9} - //other pins //#define HW_PIN_LED PC15 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF722_2022A.h b/src/madflight_board_betaflight_DIAT-MAMBAF722_2022A.h index 8af8265..20a6e85 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF722_2022A.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF722_2022A.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.259794 +Generated on: 2024-05-14 03:27:31.846582 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF722_2022A @@ -25,42 +25,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF722_2022B.h b/src/madflight_board_betaflight_DIAT-MAMBAF722_2022B.h index 08ef275..83e76e4 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF722_2022B.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF722_2022B.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.265801 +Generated on: 2024-05-14 03:27:31.847883 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF722_2022B @@ -27,42 +27,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF722_I2C.h b/src/madflight_board_betaflight_DIAT-MAMBAF722_I2C.h index 512a65a..f786640 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF722_I2C.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF722_I2C.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.265801 +Generated on: 2024-05-14 03:27:31.848966 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF722_I2C @@ -27,42 +27,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9} - //other pins //#define HW_PIN_LED PC15 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAF722_X8.h b/src/madflight_board_betaflight_DIAT-MAMBAF722_X8.h index 9899aa9..7890859 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAF722_X8.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAF722_X8.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.275807 +Generated on: 2024-05-14 03:27:31.849535 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAF722_X8 @@ -25,42 +25,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAG4.h b/src/madflight_board_betaflight_DIAT-MAMBAG4.h index f2dc820..186942c 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAG4.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAG4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.275807 +Generated on: 2024-05-14 03:27:31.850334 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAG4 @@ -25,42 +25,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA13; -const int HW_PIN_I2C_SCL = PA14; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA13 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PA14 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PB4; -const int HW_PIN_GPS_TX = PB3; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB4 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB3 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB2; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA13,PA14} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3} - //other pins #define HW_PIN_BEEPER PA15 //#define HW_PIN_LED PC15 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAH743.h b/src/madflight_board_betaflight_DIAT-MAMBAH743.h index cc10670..6069fa8 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAH743.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAH743.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.275807 +Generated on: 2024-05-14 03:27:31.851356 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAH743 @@ -28,42 +28,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} - //other pins #define HW_PIN_BEEPER PE3 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_DIAT-MAMBAH743_2022B.h b/src/madflight_board_betaflight_DIAT-MAMBAH743_2022B.h index 1ec377f..0c222e4 100644 --- a/src/madflight_board_betaflight_DIAT-MAMBAH743_2022B.h +++ b/src/madflight_board_betaflight_DIAT-MAMBAH743_2022B.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.291440 +Generated on: 2024-05-14 03:27:31.852396 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MAMBAH743_2022B @@ -26,42 +26,82 @@ Manufacturer ID: DIAT #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} - //other pins #define HW_PIN_BEEPER PE3 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_DRCL-ELINF405.h b/src/madflight_board_betaflight_DRCL-ELINF405.h index 043bb91..5942e65 100644 --- a/src/madflight_board_betaflight_DRCL-ELINF405.h +++ b/src/madflight_board_betaflight_DRCL-ELINF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.291440 +Generated on: 2024-05-14 03:27:31.853453 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ELINF405 @@ -23,42 +23,82 @@ Manufacturer ID: DRCL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB6 diff --git a/src/madflight_board_betaflight_DRCL-ELINF722.h b/src/madflight_board_betaflight_DRCL-ELINF722.h index 82d9db0..c8be8ce 100644 --- a/src/madflight_board_betaflight_DRCL-ELINF722.h +++ b/src/madflight_board_betaflight_DRCL-ELINF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.291440 +Generated on: 2024-05-14 03:27:31.854557 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ELINF722 @@ -22,42 +22,82 @@ Manufacturer ID: DRCL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB6 diff --git a/src/madflight_board_betaflight_DREA-DREAMWORKSF722.h b/src/madflight_board_betaflight_DREA-DREAMWORKSF722.h index 0d1515d..3143269 100644 --- a/src/madflight_board_betaflight_DREA-DREAMWORKSF722.h +++ b/src/madflight_board_betaflight_DREA-DREAMWORKSF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.307065 +Generated on: 2024-05-14 03:27:31.855866 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DREAMWORKSF722 @@ -28,42 +28,82 @@ Manufacturer ID: DREA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB3,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB3,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB3,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_DYST-DYSF44530D.h b/src/madflight_board_betaflight_DYST-DYSF44530D.h index 55764a9..3e34564 100644 --- a/src/madflight_board_betaflight_DYST-DYSF44530D.h +++ b/src/madflight_board_betaflight_DYST-DYSF44530D.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.307065 +Generated on: 2024-05-14 03:27:31.856930 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DYSF44530D @@ -22,42 +22,82 @@ Manufacturer ID: DYST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_DYST-DYSF4PRO.h b/src/madflight_board_betaflight_DYST-DYSF4PRO.h index 8c02091..a64b45f 100644 --- a/src/madflight_board_betaflight_DYST-DYSF4PRO.h +++ b/src/madflight_board_betaflight_DYST-DYSF4PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.307065 +Generated on: 2024-05-14 03:27:31.858232 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DYSF4PRO @@ -25,42 +25,82 @@ Manufacturer ID: DYST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_EACH-EACHINEF411_AIO.h b/src/madflight_board_betaflight_EACH-EACHINEF411_AIO.h index acf1499..989fab0 100644 --- a/src/madflight_board_betaflight_EACH-EACHINEF411_AIO.h +++ b/src/madflight_board_betaflight_EACH-EACHINEF411_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.322699 +Generated on: 2024-05-14 03:27:31.859281 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EACHINEF411_AIO @@ -22,42 +22,82 @@ Manufacturer ID: EACH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB5,PB7,PB4,PB6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB5,PB7,PB4,PB6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB5,PB7,PB4,PB6} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EACH-EACHINEF722.h b/src/madflight_board_betaflight_EACH-EACHINEF722.h index 852bcc2..c0fe792 100644 --- a/src/madflight_board_betaflight_EACH-EACHINEF722.h +++ b/src/madflight_board_betaflight_EACH-EACHINEF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.322699 +Generated on: 2024-05-14 03:27:31.859866 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EACHINEF722 @@ -25,42 +25,82 @@ Manufacturer ID: EACH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EACH-EACHINEF722_AIO.h b/src/madflight_board_betaflight_EACH-EACHINEF722_AIO.h index 49662dc..4b5fe54 100644 --- a/src/madflight_board_betaflight_EACH-EACHINEF722_AIO.h +++ b/src/madflight_board_betaflight_EACH-EACHINEF722_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.322699 +Generated on: 2024-05-14 03:27:31.860906 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EACHINEF722_AIO @@ -23,42 +23,82 @@ Manufacturer ID: EACH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EMAX-EMAX_BABYHAWK_II_HD.h b/src/madflight_board_betaflight_EMAX-EMAX_BABYHAWK_II_HD.h index 6999d19..5cc9bbd 100644 --- a/src/madflight_board_betaflight_EMAX-EMAX_BABYHAWK_II_HD.h +++ b/src/madflight_board_betaflight_EMAX-EMAX_BABYHAWK_II_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.338323 +Generated on: 2024-05-14 03:27:31.862264 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EMAX_BABYHAWK_II_HD @@ -28,42 +28,82 @@ Manufacturer ID: EMAX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PB0,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PB0,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PB0,PB4} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWKF4SX1280.h b/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWKF4SX1280.h index 195b1ad..4c824c6 100644 --- a/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWKF4SX1280.h +++ b/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWKF4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.338323 +Generated on: 2024-05-14 03:27:31.862775 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EMAX_TINYHAWKF4SX1280 @@ -37,42 +37,82 @@ Manufacturer ID: EMAX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -93,10 +133,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWK_F411RX.h b/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWK_F411RX.h index eb36096..3ae09db 100644 --- a/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWK_F411RX.h +++ b/src/madflight_board_betaflight_EMAX-EMAX_TINYHAWK_F411RX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.338323 +Generated on: 2024-05-14 03:27:31.863804 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EMAX_TINYHAWK_F411RX @@ -24,42 +24,82 @@ Manufacturer ID: EMAX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EXUA-EXF722DUAL.h b/src/madflight_board_betaflight_EXUA-EXF722DUAL.h index 0a13234..a2a648c 100644 --- a/src/madflight_board_betaflight_EXUA-EXF722DUAL.h +++ b/src/madflight_board_betaflight_EXUA-EXF722DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.353950 +Generated on: 2024-05-14 03:27:31.864880 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EXF722DUAL @@ -26,42 +26,82 @@ Manufacturer ID: EXUA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_EXUA-EXUAVF4PRO.h b/src/madflight_board_betaflight_EXUA-EXUAVF4PRO.h index 293d89f..b3dd338 100644 --- a/src/madflight_board_betaflight_EXUA-EXUAVF4PRO.h +++ b/src/madflight_board_betaflight_EXUA-EXUAVF4PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.353950 +Generated on: 2024-05-14 03:27:31.866010 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: EXUAVF4PRO @@ -23,42 +23,82 @@ Manufacturer ID: EXUA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FFPV-FF_FORTINIF4.h b/src/madflight_board_betaflight_FFPV-FF_FORTINIF4.h index 527d2a5..918238c 100644 --- a/src/madflight_board_betaflight_FFPV-FF_FORTINIF4.h +++ b/src/madflight_board_betaflight_FFPV-FF_FORTINIF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.365977 +Generated on: 2024-05-14 03:27:31.867210 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_FORTINIF4 @@ -26,42 +26,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA8; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA8 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_FFPV-FF_FORTINIF4_REV03.h b/src/madflight_board_betaflight_FFPV-FF_FORTINIF4_REV03.h index 83a757b..18e538b 100644 --- a/src/madflight_board_betaflight_FFPV-FF_FORTINIF4_REV03.h +++ b/src/madflight_board_betaflight_FFPV-FF_FORTINIF4_REV03.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.369985 +Generated on: 2024-05-14 03:27:31.868306 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_FORTINIF4_REV03 @@ -24,42 +24,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB11,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB11,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB11,PB10} - //other pins #define HW_PIN_BEEPER PB3 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_FFPV-FF_PIKOF4.h b/src/madflight_board_betaflight_FFPV-FF_PIKOF4.h index 835fe9c..b73ad2b 100644 --- a/src/madflight_board_betaflight_FFPV-FF_PIKOF4.h +++ b/src/madflight_board_betaflight_FFPV-FF_PIKOF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.369985 +Generated on: 2024-05-14 03:27:31.869383 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_PIKOF4 @@ -22,42 +22,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PA2,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PA2,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC8; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC8 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PA2,PB1} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_FFPV-FF_PIKOF4OSD.h b/src/madflight_board_betaflight_FFPV-FF_PIKOF4OSD.h index c093d73..4e6db7d 100644 --- a/src/madflight_board_betaflight_FFPV-FF_PIKOF4OSD.h +++ b/src/madflight_board_betaflight_FFPV-FF_PIKOF4OSD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.385618 +Generated on: 2024-05-14 03:27:31.870413 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_PIKOF4OSD @@ -23,42 +23,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA3,PB0,PA2,PB1,PB14,PB15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PA2,PB1,PB14,PB15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC3; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC3 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA3,PB0,PA2,PB1,PB14,PB15} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_FFPV-FF_RACEPIT.h b/src/madflight_board_betaflight_FFPV-FF_RACEPIT.h index c2110b1..616d54c 100644 --- a/src/madflight_board_betaflight_FFPV-FF_RACEPIT.h +++ b/src/madflight_board_betaflight_FFPV-FF_RACEPIT.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.385618 +Generated on: 2024-05-14 03:27:31.871782 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_RACEPIT @@ -24,42 +24,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB11,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB11,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB11,PB10} - //other pins //#define HW_PIN_LED PB9 #define HW_PIN_LED_2 PB8 diff --git a/src/madflight_board_betaflight_FFPV-FF_RACEPITF7.h b/src/madflight_board_betaflight_FFPV-FF_RACEPITF7.h index 187544c..5b9c6ce 100644 --- a/src/madflight_board_betaflight_FFPV-FF_RACEPITF7.h +++ b/src/madflight_board_betaflight_FFPV-FF_RACEPITF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.385618 +Generated on: 2024-05-14 03:27:31.873375 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_RACEPITF7 @@ -20,42 +20,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB11,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB11,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB11,PB10} - //other pins #define HW_PIN_BEEPER PC3 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_FFPV-FF_RACEPITF7_MINI.h b/src/madflight_board_betaflight_FFPV-FF_RACEPITF7_MINI.h index c7c4297..5be3f69 100644 --- a/src/madflight_board_betaflight_FFPV-FF_RACEPITF7_MINI.h +++ b/src/madflight_board_betaflight_FFPV-FF_RACEPITF7_MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.401278 +Generated on: 2024-05-14 03:27:31.874449 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_RACEPITF7_MINI @@ -24,42 +24,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB11,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB11,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB11,PB10} - //other pins #define HW_PIN_BEEPER PC3 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_FFPV-FF_RACEPIT_MINI.h b/src/madflight_board_betaflight_FFPV-FF_RACEPIT_MINI.h index c5a110c..6f6e8ae 100644 --- a/src/madflight_board_betaflight_FFPV-FF_RACEPIT_MINI.h +++ b/src/madflight_board_betaflight_FFPV-FF_RACEPIT_MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.401278 +Generated on: 2024-05-14 03:27:31.875738 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FF_RACEPIT_MINI @@ -24,42 +24,82 @@ Manufacturer ID: FFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB11,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB11,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB11,PB10} - //other pins //#define HW_PIN_LED PB9 #define HW_PIN_LED_2 PB8 diff --git a/src/madflight_board_betaflight_FHRC-FLASHHOBBYF405.h b/src/madflight_board_betaflight_FHRC-FLASHHOBBYF405.h index f8ca269..1cc2ece 100644 --- a/src/madflight_board_betaflight_FHRC-FLASHHOBBYF405.h +++ b/src/madflight_board_betaflight_FHRC-FLASHHOBBYF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.401278 +Generated on: 2024-05-14 03:27:31.876806 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLASHHOBBYF405 @@ -26,42 +26,82 @@ Manufacturer ID: FHRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_FHRC-FLASHHOBBYF722.h b/src/madflight_board_betaflight_FHRC-FLASHHOBBYF722.h index 25d0f29..85749e5 100644 --- a/src/madflight_board_betaflight_FHRC-FLASHHOBBYF722.h +++ b/src/madflight_board_betaflight_FHRC-FLASHHOBBYF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.416905 +Generated on: 2024-05-14 03:27:31.877922 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLASHHOBBYF722 @@ -26,42 +26,82 @@ Manufacturer ID: FHRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_FLAO-FLAOF405X8.h b/src/madflight_board_betaflight_FLAO-FLAOF405X8.h index 708d53d..1ef0506 100644 --- a/src/madflight_board_betaflight_FLAO-FLAOF405X8.h +++ b/src/madflight_board_betaflight_FLAO-FLAOF405X8.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.416905 +Generated on: 2024-05-14 03:27:31.879170 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLAOF405X8 @@ -27,42 +27,82 @@ Manufacturer ID: FLAO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA15,PA8,PB10,PB11,PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA15,PA8,PB10,PB11,PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA15,PA8,PB10,PB11,PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB8 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_FLCO-FLYCOLORF7.h b/src/madflight_board_betaflight_FLCO-FLYCOLORF7.h index 89326e7..3571e58 100644 --- a/src/madflight_board_betaflight_FLCO-FLYCOLORF7.h +++ b/src/madflight_board_betaflight_FLCO-FLYCOLORF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.432492 +Generated on: 2024-05-14 03:27:31.880199 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYCOLORF7 @@ -24,42 +24,82 @@ Manufacturer ID: FLCO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_FLCO-FLYCOLORF7MINI.h b/src/madflight_board_betaflight_FLCO-FLYCOLORF7MINI.h index f560e59..13db258 100644 --- a/src/madflight_board_betaflight_FLCO-FLYCOLORF7MINI.h +++ b/src/madflight_board_betaflight_FLCO-FLYCOLORF7MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.432492 +Generated on: 2024-05-14 03:27:31.881275 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYCOLORF7MINI @@ -25,42 +25,82 @@ Manufacturer ID: FLCO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO.h b/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO.h index 3ca5b19..e2bcbe3 100644 --- a/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO.h +++ b/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.432492 +Generated on: 2024-05-14 03:27:31.882881 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYCOLORF7_AIO @@ -20,42 +20,82 @@ Manufacturer ID: FLCO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO_HD.h b/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO_HD.h index 55ebc9f..d0e09f9 100644 --- a/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO_HD.h +++ b/src/madflight_board_betaflight_FLCO-FLYCOLORF7_AIO_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.448127 +Generated on: 2024-05-14 03:27:31.883680 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYCOLORF7_AIO_HD @@ -25,42 +25,82 @@ Manufacturer ID: FLCO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA15 diff --git a/src/madflight_board_betaflight_FLLF-KIWIF4.h b/src/madflight_board_betaflight_FLLF-KIWIF4.h index 4accc38..59a46ef 100644 --- a/src/madflight_board_betaflight_FLLF-KIWIF4.h +++ b/src/madflight_board_betaflight_FLLF-KIWIF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.463746 +Generated on: 2024-05-14 03:27:31.884758 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KIWIF4 @@ -22,42 +22,82 @@ Manufacturer ID: FLLF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PB1,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PB1,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PB1,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_FLLF-KIWIF4V2.h b/src/madflight_board_betaflight_FLLF-KIWIF4V2.h index f70e900..0367ca5 100644 --- a/src/madflight_board_betaflight_FLLF-KIWIF4V2.h +++ b/src/madflight_board_betaflight_FLLF-KIWIF4V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.466256 +Generated on: 2024-05-14 03:27:31.886327 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KIWIF4V2 @@ -23,42 +23,82 @@ Manufacturer ID: FLLF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PB1,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PB1,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PB1,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_FLLF-PLUMF4.h b/src/madflight_board_betaflight_FLLF-PLUMF4.h index 647dd8c..5d2a0cd 100644 --- a/src/madflight_board_betaflight_FLLF-PLUMF4.h +++ b/src/madflight_board_betaflight_FLLF-PLUMF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.466256 +Generated on: 2024-05-14 03:27:31.887355 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PLUMF4 @@ -22,42 +22,82 @@ Manufacturer ID: FLLF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA3,PB0,PB1,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA3,PB0,PB1,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA3,PB0,PB1,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_FLMO-GRAVITYF7.h b/src/madflight_board_betaflight_FLMO-GRAVITYF7.h index 03bb393..f742b5f 100644 --- a/src/madflight_board_betaflight_FLMO-GRAVITYF7.h +++ b/src/madflight_board_betaflight_FLMO-GRAVITYF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.479772 +Generated on: 2024-05-14 03:27:31.888394 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GRAVITYF7 @@ -25,42 +25,82 @@ Manufacturer ID: FLMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB0; -const int HW_PIN_IMU_EXTI = PB10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB0 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FLMO-STELLARF4.h b/src/madflight_board_betaflight_FLMO-STELLARF4.h index 1989c80..23a5260 100644 --- a/src/madflight_board_betaflight_FLMO-STELLARF4.h +++ b/src/madflight_board_betaflight_FLMO-STELLARF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.479772 +Generated on: 2024-05-14 03:27:31.889435 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STELLARF4 @@ -24,42 +24,82 @@ Manufacturer ID: FLMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_SERVO PA8 diff --git a/src/madflight_board_betaflight_FLMO-STELLARF7.h b/src/madflight_board_betaflight_FLMO-STELLARF7.h index 680b231..70a96fc 100644 --- a/src/madflight_board_betaflight_FLMO-STELLARF7.h +++ b/src/madflight_board_betaflight_FLMO-STELLARF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.495416 +Generated on: 2024-05-14 03:27:31.890722 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STELLARF7 @@ -26,42 +26,82 @@ Manufacturer ID: FLMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_SERVO PB11 #define HW_PIN_SERVO_2 PB10 diff --git a/src/madflight_board_betaflight_FLMO-STELLARF7V2.h b/src/madflight_board_betaflight_FLMO-STELLARF7V2.h index 8eca192..753b5a9 100644 --- a/src/madflight_board_betaflight_FLMO-STELLARF7V2.h +++ b/src/madflight_board_betaflight_FLMO-STELLARF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.495416 +Generated on: 2024-05-14 03:27:31.891764 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STELLARF7V2 @@ -26,42 +26,82 @@ Manufacturer ID: FLMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_SERVO PB11 #define HW_PIN_SERVO_2 PB10 diff --git a/src/madflight_board_betaflight_FLON-REVOLT.h b/src/madflight_board_betaflight_FLON-REVOLT.h index 69c3645..74ab211 100644 --- a/src/madflight_board_betaflight_FLON-REVOLT.h +++ b/src/madflight_board_betaflight_FLON-REVOLT.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.495416 +Generated on: 2024-05-14 03:27:31.892798 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: REVOLT @@ -21,42 +21,82 @@ Manufacturer ID: FLON #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_FLON-REVOLTOSD.h b/src/madflight_board_betaflight_FLON-REVOLTOSD.h index 5327bee..3f59b89 100644 --- a/src/madflight_board_betaflight_FLON-REVOLTOSD.h +++ b/src/madflight_board_betaflight_FLON-REVOLTOSD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.511039 +Generated on: 2024-05-14 03:27:31.893834 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: REVOLTOSD @@ -24,42 +24,82 @@ Manufacturer ID: FLON #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF405.h b/src/madflight_board_betaflight_FLWO-FLYWOOF405.h index 29197fd..7a85f2f 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF405.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.511039 +Generated on: 2024-05-14 03:27:31.894961 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF405 @@ -23,42 +23,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PB15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF405NANO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF405NANO.h index 15976e0..d00dbb2 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF405NANO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF405NANO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.511039 +Generated on: 2024-05-14 03:27:31.896849 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF405NANO @@ -27,42 +27,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PB13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF405PRO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF405PRO.h index 89c3e4e..0b867a3 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF405PRO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF405PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.526664 +Generated on: 2024-05-14 03:27:31.898433 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF405PRO @@ -26,42 +26,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PB13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB5,PC9,PB4,PC8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF405S_AIO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF405S_AIO.h index 007bdf7..8008d95 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF405S_AIO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF405S_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.526664 +Generated on: 2024-05-14 03:27:31.899473 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF405S_AIO @@ -27,42 +27,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PB13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF411.h b/src/madflight_board_betaflight_FLWO-FLYWOOF411.h index 7abbe2a..ba1a283 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF411.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.526664 +Generated on: 2024-05-14 03:27:31.900709 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF411 @@ -26,42 +26,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PB0,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PB0,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PB0,PB4} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF411EVO_HD.h b/src/madflight_board_betaflight_FLWO-FLYWOOF411EVO_HD.h index 88e1e82..07aeaea 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF411EVO_HD.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF411EVO_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.542280 +Generated on: 2024-05-14 03:27:31.901864 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF411EVO_HD @@ -24,42 +24,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PB10} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF411HEX.h b/src/madflight_board_betaflight_FLWO-FLYWOOF411HEX.h index 175c686..e4ef10e 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF411HEX.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF411HEX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.542280 +Generated on: 2024-05-14 03:27:31.903421 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF411HEX @@ -22,42 +22,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA8,PB3,PB10,PA15,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PB3,PB10,PA15,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA8,PB3,PB10,PA15,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF411V2.h b/src/madflight_board_betaflight_FLWO-FLYWOOF411V2.h index de2cfc9..2f01ca6 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF411V2.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF411V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.553940 +Generated on: 2024-05-14 03:27:31.904467 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF411V2 @@ -25,42 +25,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA8,PB3,PB10,PA15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PB3,PB10,PA15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA8,PB3,PB10,PA15} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF411_5IN1_AIO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF411_5IN1_AIO.h index f665331..de8ec2d 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF411_5IN1_AIO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF411_5IN1_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.557972 +Generated on: 2024-05-14 03:27:31.905537 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF411_5IN1_AIO @@ -24,42 +24,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA8,PB6,PB10,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PB6,PB10,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA8,PB6,PB10,PB7} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF745.h b/src/madflight_board_betaflight_FLWO-FLYWOOF745.h index 7d7ac94..283ca50 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF745.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF745.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.566486 +Generated on: 2024-05-14 03:27:31.906571 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF745 @@ -26,42 +26,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB1,PC9,PB0,PE11,PE9,PA3,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PC9,PB0,PE11,PE9,PA3,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB1,PC9,PB0,PE11,PE9,PA3,PB4,PB5} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF745AIO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF745AIO.h index e060297..7979ee0 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF745AIO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF745AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.566486 +Generated on: 2024-05-14 03:27:31.908135 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF745AIO @@ -26,42 +26,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF745NANO.h b/src/madflight_board_betaflight_FLWO-FLYWOOF745NANO.h index 259cbfb..d202f5b 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF745NANO.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF745NANO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.579813 +Generated on: 2024-05-14 03:27:31.909177 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF745NANO @@ -25,42 +25,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_FLWO-FLYWOOF7DUAL.h b/src/madflight_board_betaflight_FLWO-FLYWOOF7DUAL.h index 45ccf91..70403b2 100644 --- a/src/madflight_board_betaflight_FLWO-FLYWOOF7DUAL.h +++ b/src/madflight_board_betaflight_FLWO-FLYWOOF7DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.584811 +Generated on: 2024-05-14 03:27:31.910220 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLYWOOF7DUAL @@ -28,42 +28,82 @@ Manufacturer ID: FLWO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_FOSS-ANYFCF7.h b/src/madflight_board_betaflight_FOSS-ANYFCF7.h index 5199fa7..cb96f4d 100644 --- a/src/madflight_board_betaflight_FOSS-ANYFCF7.h +++ b/src/madflight_board_betaflight_FOSS-ANYFCF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.589807 +Generated on: 2024-05-14 03:27:31.911254 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ANYFCF7 @@ -24,42 +24,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB7; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB7 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB8,PA2,PA1,PA3,PB5,PA0,PB9,PE6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA2,PA1,PA3,PB5,PA0,PB9,PE6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {2,PB10,PB11}, {4,PD12,PD13} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB8,PA2,PA1,PA3,PB5,PA0,PB9,PE6} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_FOSS-ANYFCM7.h b/src/madflight_board_betaflight_FOSS-ANYFCM7.h index 24179c3..49c7e67 100644 --- a/src/madflight_board_betaflight_FOSS-ANYFCM7.h +++ b/src/madflight_board_betaflight_FOSS-ANYFCM7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.594603 +Generated on: 2024-05-14 03:27:31.912305 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ANYFCM7 @@ -23,42 +23,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB6; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB6 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB8,PA2,PB7,PA3,PA1,PB0,PB5,PA0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA2,PB7,PA3,PA1,PB0,PB5,PA0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL4) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB8,PA2,PB7,PA3,PA1,PB0,PB5,PA0} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_FOSS-DRONIUSF7.h b/src/madflight_board_betaflight_FOSS-DRONIUSF7.h index 6fbe419..cfab9fe 100644 --- a/src/madflight_board_betaflight_FOSS-DRONIUSF7.h +++ b/src/madflight_board_betaflight_FOSS-DRONIUSF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.599624 +Generated on: 2024-05-14 03:27:31.913352 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: DRONIUSF7 @@ -20,42 +20,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB0; -const int HW_PIN_IMU_EXTI = PB10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB0 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FOSS-F4BY.h b/src/madflight_board_betaflight_FOSS-F4BY.h index 37315cd..452f971 100644 --- a/src/madflight_board_betaflight_FOSS-F4BY.h +++ b/src/madflight_board_betaflight_FOSS-F4BY.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.603645 +Generated on: 2024-05-14 03:27:31.914954 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: F4BY @@ -23,42 +23,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB0 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PE9,PE11,PE13,PE14}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PE9,PE11,PE13,PE14} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PE9,PE11,PE13,PE14} - //other pins #define HW_PIN_BEEPER PE5 #define HW_PIN_PWM PC9 diff --git a/src/madflight_board_betaflight_FOSS-FENIX_F405.h b/src/madflight_board_betaflight_FOSS-FENIX_F405.h index 4bd0cc3..a24dea7 100644 --- a/src/madflight_board_betaflight_FOSS-FENIX_F405.h +++ b/src/madflight_board_betaflight_FOSS-FENIX_F405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.607608 +Generated on: 2024-05-14 03:27:31.916113 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FENIX_F405 @@ -24,42 +24,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PB3; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB3 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PA3,PA2} - //other pins #define HW_PIN_LED_STRIP PC8 //#define HW_PIN_LED PA8 diff --git a/src/madflight_board_betaflight_FOSS-SPARKY2.h b/src/madflight_board_betaflight_FOSS-SPARKY2.h index 6de32e2..d0d9d1e 100644 --- a/src/madflight_board_betaflight_FOSS-SPARKY2.h +++ b/src/madflight_board_betaflight_FOSS-SPARKY2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.612309 +Generated on: 2024-05-14 03:27:31.917194 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPARKY2 @@ -22,42 +22,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA0} - //other pins #define HW_PIN_BEEPER PC9 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_FOSS-WORMFC.h b/src/madflight_board_betaflight_FOSS-WORMFC.h index 47b6af0..b72e107 100644 --- a/src/madflight_board_betaflight_FOSS-WORMFC.h +++ b/src/madflight_board_betaflight_FOSS-WORMFC.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.617309 +Generated on: 2024-05-14 03:27:31.917718 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: WORMFC @@ -23,42 +23,82 @@ Manufacturer ID: FOSS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB0,PA2,PA3,PA10,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PA2,PA3,PA10,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PB12; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB12 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB0,PA2,PA3,PA10,PA8} - //other pins #define HW_PIN_BEEPER PB14 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF405.h b/src/madflight_board_betaflight_FOXE-FOXEERF405.h index 00d6d24..8970ee9 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF405.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.622323 +Generated on: 2024-05-14 03:27:31.918765 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF405 @@ -28,42 +28,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB4,PC8,PC9,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB4,PC8,PC9,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB4,PC8,PC9,PC6,PC7} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF722DUAL.h b/src/madflight_board_betaflight_FOXE-FOXEERF722DUAL.h index 67967a3..1160abc 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF722DUAL.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF722DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.627961 +Generated on: 2024-05-14 03:27:31.919813 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF722DUAL @@ -26,42 +26,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8,PC6,PC7} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF722V2.h b/src/madflight_board_betaflight_FOXE-FOXEERF722V2.h index fd8fda6..9f0b5fe 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF722V2.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF722V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.633056 +Generated on: 2024-05-14 03:27:31.920866 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF722V2 @@ -25,42 +25,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8,PC6,PC7} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF722V3.h b/src/madflight_board_betaflight_FOXE-FOXEERF722V3.h index f7488f6..e608b04 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF722V3.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF722V3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.640580 +Generated on: 2024-05-14 03:27:31.921907 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF722V3 @@ -25,42 +25,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF722V4.h b/src/madflight_board_betaflight_FOXE-FOXEERF722V4.h index ddefe98..6926d26 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF722V4.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF722V4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.648113 +Generated on: 2024-05-14 03:27:31.922942 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF722V4 @@ -27,42 +27,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PA4 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF745V2_AIO.h b/src/madflight_board_betaflight_FOXE-FOXEERF745V2_AIO.h index 6e8600e..b446946 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF745V2_AIO.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF745V2_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.656131 +Generated on: 2024-05-14 03:27:31.923461 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF745V2_AIO @@ -24,42 +24,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB1,PB0} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF745V3_AIO.h b/src/madflight_board_betaflight_FOXE-FOXEERF745V3_AIO.h index 8b91435..9737930 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF745V3_AIO.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF745V3_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.666721 +Generated on: 2024-05-14 03:27:31.924498 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF745V3_AIO @@ -25,42 +25,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB1,PB0} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF745V4_AIO.h b/src/madflight_board_betaflight_FOXE-FOXEERF745V4_AIO.h index 9b77084..a1a4bd3 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF745V4_AIO.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF745V4_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.673731 +Generated on: 2024-05-14 03:27:31.925332 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF745V4_AIO @@ -26,42 +26,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB1,PB0} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERF745_AIO.h b/src/madflight_board_betaflight_FOXE-FOXEERF745_AIO.h index f260565..802b1a0 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERF745_AIO.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERF745_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.681077 +Generated on: 2024-05-14 03:27:31.926352 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERF745_AIO @@ -25,42 +25,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB1,PB0} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_FOXE-FOXEERH743.h b/src/madflight_board_betaflight_FOXE-FOXEERH743.h index 25915fc..d0967db 100644 --- a/src/madflight_board_betaflight_FOXE-FOXEERH743.h +++ b/src/madflight_board_betaflight_FOXE-FOXEERH743.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.687076 +Generated on: 2024-05-14 03:27:31.927390 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FOXEERH743 @@ -26,42 +26,82 @@ Manufacturer ID: FOXE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PD12,PD13,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PD12,PD13,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PD12,PD13,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_SERVO PE5 diff --git a/src/madflight_board_betaflight_FPVM-BETAFLIGHTF4.h b/src/madflight_board_betaflight_FPVM-BETAFLIGHTF4.h index 66afc52..748fc9b 100644 --- a/src/madflight_board_betaflight_FPVM-BETAFLIGHTF4.h +++ b/src/madflight_board_betaflight_FPVM-BETAFLIGHTF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.693082 +Generated on: 2024-05-14 03:27:31.927901 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BETAFLIGHTF4 @@ -25,42 +25,82 @@ Manufacturer ID: FPVM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8,PB6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8,PB6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8,PB6} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_FPVM-FPVM_BETAFLIGHTF7.h b/src/madflight_board_betaflight_FPVM-FPVM_BETAFLIGHTF7.h index 29a8bb1..058df54 100644 --- a/src/madflight_board_betaflight_FPVM-FPVM_BETAFLIGHTF7.h +++ b/src/madflight_board_betaflight_FPVM-FPVM_BETAFLIGHTF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.698513 +Generated on: 2024-05-14 03:27:31.928931 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FPVM_BETAFLIGHTF7 @@ -23,42 +23,82 @@ Manufacturer ID: FPVM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_FPVM-XRACERF4.h b/src/madflight_board_betaflight_FPVM-XRACERF4.h index 1ac1491..2e63e2b 100644 --- a/src/madflight_board_betaflight_FPVM-XRACERF4.h +++ b/src/madflight_board_betaflight_FPVM-XRACERF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.705514 +Generated on: 2024-05-14 03:27:31.929965 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: XRACERF4 @@ -23,42 +23,82 @@ Manufacturer ID: FPVM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_FRSK-FRSKYF4.h b/src/madflight_board_betaflight_FRSK-FRSKYF4.h index 09d5a0c..424f954 100644 --- a/src/madflight_board_betaflight_FRSK-FRSKYF4.h +++ b/src/madflight_board_betaflight_FRSK-FRSKYF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.711358 +Generated on: 2024-05-14 03:27:31.930999 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FRSKYF4 @@ -24,42 +24,82 @@ Manufacturer ID: FRSK #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_GEEL-GEELANGF411.h b/src/madflight_board_betaflight_GEEL-GEELANGF411.h index 98d6aaf..3c1c660 100644 --- a/src/madflight_board_betaflight_GEEL-GEELANGF411.h +++ b/src/madflight_board_betaflight_GEEL-GEELANGF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.717363 +Generated on: 2024-05-14 03:27:31.931527 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEELANGF411 @@ -22,42 +22,82 @@ Manufacturer ID: GEEL #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PA0,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PA0,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PA0,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_GEFP-XILOF4.h b/src/madflight_board_betaflight_GEFP-XILOF4.h index 1fbd7a6..b74fe37 100644 --- a/src/madflight_board_betaflight_GEFP-XILOF4.h +++ b/src/madflight_board_betaflight_GEFP-XILOF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.723359 +Generated on: 2024-05-14 03:27:31.932325 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: XILOF4 @@ -25,42 +25,82 @@ Manufacturer ID: GEFP #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PB6,PC9,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PB6,PC9,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PB6,PC9,PB7} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF405.h b/src/madflight_board_betaflight_GEPR-GEPRCF405.h index 138c0fb..a426b8f 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF405.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.729021 +Generated on: 2024-05-14 03:27:31.933348 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF405 @@ -26,42 +26,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF411.h b/src/madflight_board_betaflight_GEPR-GEPRCF411.h index 333f888..8f26be5 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF411.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.734019 +Generated on: 2024-05-14 03:27:31.934381 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF411 @@ -25,42 +25,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF411SX1280.h b/src/madflight_board_betaflight_GEPR-GEPRCF411SX1280.h index ff6c058..f2d4f3d 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF411SX1280.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF411SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.739017 +Generated on: 2024-05-14 03:27:31.935623 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF411SX1280 @@ -41,42 +41,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -97,10 +137,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF411_AIO.h b/src/madflight_board_betaflight_GEPR-GEPRCF411_AIO.h index f421e90..5fa98b6 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF411_AIO.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF411_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.745239 +Generated on: 2024-05-14 03:27:31.936702 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF411_AIO @@ -25,42 +25,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PA0,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PA0,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PA0,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF411_PRO.h b/src/madflight_board_betaflight_GEPR-GEPRCF411_PRO.h index 444dcb0..26d5721 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF411_PRO.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF411_PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.750234 +Generated on: 2024-05-14 03:27:31.937750 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF411_PRO @@ -21,42 +21,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PB10,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PB10,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PB10,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF722.h b/src/madflight_board_betaflight_GEPR-GEPRCF722.h index 0688f9d..0df811e 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF722.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.756237 +Generated on: 2024-05-14 03:27:31.938782 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF722 @@ -26,42 +26,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF722BT.h b/src/madflight_board_betaflight_GEPR-GEPRCF722BT.h index 9b898c8..30fa4cc 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF722BT.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF722BT.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.760929 +Generated on: 2024-05-14 03:27:31.939856 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF722BT @@ -25,42 +25,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF722_BT_HD.h b/src/madflight_board_betaflight_GEPR-GEPRCF722_BT_HD.h index 2bbc2a2..6716c0d 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF722_BT_HD.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF722_BT_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.766935 +Generated on: 2024-05-14 03:27:31.940895 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF722_BT_HD @@ -24,42 +24,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEPRCF745_BT_HD.h b/src/madflight_board_betaflight_GEPR-GEPRCF745_BT_HD.h index 83cbec0..326ecab 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRCF745_BT_HD.h +++ b/src/madflight_board_betaflight_GEPR-GEPRCF745_BT_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.766935 +Generated on: 2024-05-14 03:27:31.941935 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRCF745_BT_HD @@ -21,42 +21,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB5,PB4,PD12,PD13,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB5,PB4,PD12,PD13,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB5,PB4,PD12,PD13,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_GEPR-GEPRC_F722_AIO.h b/src/madflight_board_betaflight_GEPR-GEPRC_F722_AIO.h index af677bc..5b53853 100644 --- a/src/madflight_board_betaflight_GEPR-GEPRC_F722_AIO.h +++ b/src/madflight_board_betaflight_GEPR-GEPRC_F722_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.775942 +Generated on: 2024-05-14 03:27:31.942706 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEPRC_F722_AIO @@ -26,42 +26,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-GEP_F405_VTX_V3.h b/src/madflight_board_betaflight_GEPR-GEP_F405_VTX_V3.h index 7c69eaa..1dadb64 100644 --- a/src/madflight_board_betaflight_GEPR-GEP_F405_VTX_V3.h +++ b/src/madflight_board_betaflight_GEPR-GEP_F405_VTX_V3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.775942 +Generated on: 2024-05-14 03:27:31.943794 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEP_F405_VTX_V3 @@ -20,42 +20,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_GEPR-TAKERF411.h b/src/madflight_board_betaflight_GEPR-TAKERF411.h index fd15dde..3337b4c 100644 --- a/src/madflight_board_betaflight_GEPR-TAKERF411.h +++ b/src/madflight_board_betaflight_GEPR-TAKERF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.775942 +Generated on: 2024-05-14 03:27:31.944842 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TAKERF411 @@ -26,42 +26,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-TAKERF722SE.h b/src/madflight_board_betaflight_GEPR-TAKERF722SE.h index 0b76320..3a1b4e6 100644 --- a/src/madflight_board_betaflight_GEPR-TAKERF722SE.h +++ b/src/madflight_board_betaflight_GEPR-TAKERF722SE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.791614 +Generated on: 2024-05-14 03:27:31.945884 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TAKERF722SE @@ -29,42 +29,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -85,10 +125,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_GEPR-TAKERG4AIO.h b/src/madflight_board_betaflight_GEPR-TAKERG4AIO.h index fcccfca..81a07d4 100644 --- a/src/madflight_board_betaflight_GEPR-TAKERG4AIO.h +++ b/src/madflight_board_betaflight_GEPR-TAKERG4AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.791614 +Generated on: 2024-05-14 03:27:31.946952 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TAKERG4AIO @@ -25,42 +25,82 @@ Manufacturer ID: GEPR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB7; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB7 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB0; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB0 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA13; -const int HW_PIN_I2C_SCL = PA14; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA13 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PA14 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PB4; -const int HW_PIN_GPS_TX = PB3; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB4 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB3 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB2; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA13,PA14} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_GFPV-GEMEF411.h b/src/madflight_board_betaflight_GFPV-GEMEF411.h index ad170a9..d6c6bc6 100644 --- a/src/madflight_board_betaflight_GFPV-GEMEF411.h +++ b/src/madflight_board_betaflight_GFPV-GEMEF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.791614 +Generated on: 2024-05-14 03:27:31.947471 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEMEF411 @@ -24,42 +24,82 @@ Manufacturer ID: GFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA8,PB4,PB0,PB5,PA9,PA10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PB4,PB0,PB5,PA9,PA10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB3; -const int HW_PIN_RCIN_TX = PA15; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA15 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA8,PB4,PB0,PB5,PA9,PA10} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_GFPV-GEMEF722.h b/src/madflight_board_betaflight_GFPV-GEMEF722.h index a91ee80..13aec51 100644 --- a/src/madflight_board_betaflight_GFPV-GEMEF722.h +++ b/src/madflight_board_betaflight_GFPV-GEMEF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.807201 +Generated on: 2024-05-14 03:27:31.948512 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: GEMEF722 @@ -20,42 +20,82 @@ Manufacturer ID: GFPV #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF405.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF405.h index a1914ef..2dc464c 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF405.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.807201 +Generated on: 2024-05-14 03:27:31.949355 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF405 @@ -25,42 +25,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DX.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DX.h index d212c8d..ef7dc1e 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DX.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.807201 +Generated on: 2024-05-14 03:27:31.950391 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF4DX @@ -26,42 +26,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DXS.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DXS.h index b413565..29e0189 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DXS.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4DXS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.807201 +Generated on: 2024-05-14 03:27:31.951453 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF4DXS @@ -22,42 +22,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FR.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FR.h index ddf8110..9b0476d 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FR.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FR.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.822833 +Generated on: 2024-05-14 03:27:31.951967 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF4FR @@ -25,42 +25,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FS.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FS.h index 58d7a15..bda3f01 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FS.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4FS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.822833 +Generated on: 2024-05-14 03:27:31.953020 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF4FS @@ -24,42 +24,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4SX1280.h b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4SX1280.h index 25f93f2..8097b8f 100644 --- a/src/madflight_board_betaflight_HAMO-CRAZYBEEF4SX1280.h +++ b/src/madflight_board_betaflight_HAMO-CRAZYBEEF4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.822833 +Generated on: 2024-05-14 03:27:31.954063 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: CRAZYBEEF4SX1280 @@ -39,42 +39,82 @@ Manufacturer ID: HAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -95,10 +135,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF405.h b/src/madflight_board_betaflight_HARC-HAKRCF405.h index d5df8d9..75eb5ad 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF405.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.838451 +Generated on: 2024-05-14 03:27:31.955358 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF405 @@ -25,42 +25,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PC6,PA10,PA8,PC7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PC6,PA10,PA8,PC7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB4; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB4 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PC6,PA10,PA8,PC7,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF405D.h b/src/madflight_board_betaflight_HARC-HAKRCF405D.h index 5f2e9c7..bf41676 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF405D.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF405D.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.838451 +Generated on: 2024-05-14 03:27:31.955862 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF405D @@ -28,42 +28,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF405V2.h b/src/madflight_board_betaflight_HARC-HAKRCF405V2.h index 3e97d40..56714f1 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF405V2.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF405V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.838451 +Generated on: 2024-05-14 03:27:31.957424 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF405V2 @@ -27,42 +27,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PA10,PB4,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PA10,PB4,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC0; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC0 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PA10,PB4,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF411.h b/src/madflight_board_betaflight_HARC-HAKRCF411.h index d8ef867..bbf876b 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF411.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.854086 +Generated on: 2024-05-14 03:27:31.958146 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF411 @@ -23,42 +23,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA8,PB10,PB1,PB0,PA15,PB3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PB10,PB1,PB0,PA15,PB3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB4; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB4 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA8,PB10,PB1,PB0,PA15,PB3} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF411D.h b/src/madflight_board_betaflight_HARC-HAKRCF411D.h index d0b0137..7e29ee1 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF411D.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF411D.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.854086 +Generated on: 2024-05-14 03:27:31.959724 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF411D @@ -27,42 +27,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF722.h b/src/madflight_board_betaflight_HARC-HAKRCF722.h index 463bd60..77e6853 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF722.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.867127 +Generated on: 2024-05-14 03:27:31.960761 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF722 @@ -22,42 +22,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PC6,PA10,PA8,PC7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PC6,PA10,PA8,PC7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PC6,PA10,PA8,PC7,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF722D.h b/src/madflight_board_betaflight_HARC-HAKRCF722D.h index e0bec47..71e8b46 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF722D.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF722D.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.870132 +Generated on: 2024-05-14 03:27:31.961822 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF722D @@ -28,42 +28,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF722MINI.h b/src/madflight_board_betaflight_HARC-HAKRCF722MINI.h index 74e09b6..3332756 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF722MINI.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF722MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.870132 +Generated on: 2024-05-14 03:27:31.962871 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF722MINI @@ -25,42 +25,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF722V2.h b/src/madflight_board_betaflight_HARC-HAKRCF722V2.h index f9f8eba..197b51d 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF722V2.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF722V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.870132 +Generated on: 2024-05-14 03:27:31.963909 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF722V2 @@ -27,42 +27,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_HARC-HAKRCF7230D.h b/src/madflight_board_betaflight_HARC-HAKRCF7230D.h index bb955a0..86acf29 100644 --- a/src/madflight_board_betaflight_HARC-HAKRCF7230D.h +++ b/src/madflight_board_betaflight_HARC-HAKRCF7230D.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.885774 +Generated on: 2024-05-14 03:27:31.964951 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HAKRCF7230D @@ -25,42 +25,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HARC-KD722.h b/src/madflight_board_betaflight_HARC-KD722.h index 2e1a312..dda0047 100644 --- a/src/madflight_board_betaflight_HARC-KD722.h +++ b/src/madflight_board_betaflight_HARC-KD722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.885774 +Generated on: 2024-05-14 03:27:31.965731 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KD722 @@ -20,42 +20,82 @@ Manufacturer ID: HARC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF4.h b/src/madflight_board_betaflight_HBRO-KAKUTEF4.h index 06d12b0..e38369a 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF4.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.885774 +Generated on: 2024-05-14 03:27:31.966757 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF4 @@ -26,42 +26,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA0,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA0,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PB15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA0,PC8} - //other pins #define HW_PIN_BEEPER PC9 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF4V2.h b/src/madflight_board_betaflight_HBRO-KAKUTEF4V2.h index 02b9c08..d81ab5c 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF4V2.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF4V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.901390 +Generated on: 2024-05-14 03:27:31.967810 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF4V2 @@ -26,42 +26,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PB15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PC9 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF7.h b/src/madflight_board_betaflight_HBRO-KAKUTEF7.h index c5025b8..9cc9134 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF7.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.901390 +Generated on: 2024-05-14 03:27:31.968859 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF7 @@ -25,42 +25,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF7HDV.h b/src/madflight_board_betaflight_HBRO-KAKUTEF7HDV.h index 634ad55..75724e8 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF7HDV.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF7HDV.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.901390 +Generated on: 2024-05-14 03:27:31.969891 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF7HDV @@ -23,42 +23,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF7MINI.h b/src/madflight_board_betaflight_HBRO-KAKUTEF7MINI.h index 72b47b9..8f89f29 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF7MINI.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF7MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.917015 +Generated on: 2024-05-14 03:27:31.970930 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF7MINI @@ -26,42 +26,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF7MINIV3.h b/src/madflight_board_betaflight_HBRO-KAKUTEF7MINIV3.h index b23c615..a78a087 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF7MINIV3.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF7MINIV3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.917015 +Generated on: 2024-05-14 03:27:31.971993 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF7MINIV3 @@ -26,42 +26,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PD2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PD2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC8 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEF7V2.h b/src/madflight_board_betaflight_HBRO-KAKUTEF7V2.h index cf04e29..eaf664e 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEF7V2.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.917015 +Generated on: 2024-05-14 03:27:31.972570 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEF7V2 @@ -25,42 +25,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEH7.h b/src/madflight_board_betaflight_HBRO-KAKUTEH7.h index 1ec1d4f..66f451d 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEH7.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEH7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.932639 +Generated on: 2024-05-14 03:27:31.973871 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEH7 @@ -24,42 +24,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PD12 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEH7MINI.h b/src/madflight_board_betaflight_HBRO-KAKUTEH7MINI.h index d8fa1e9..a287d4c 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEH7MINI.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEH7MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.932639 +Generated on: 2024-05-14 03:27:31.975020 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEH7MINI @@ -27,42 +27,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PD12 diff --git a/src/madflight_board_betaflight_HBRO-KAKUTEH7V2.h b/src/madflight_board_betaflight_HBRO-KAKUTEH7V2.h index d73d65c..fd5dccf 100644 --- a/src/madflight_board_betaflight_HBRO-KAKUTEH7V2.h +++ b/src/madflight_board_betaflight_HBRO-KAKUTEH7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.932639 +Generated on: 2024-05-14 03:27:31.976582 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KAKUTEH7V2 @@ -24,42 +24,82 @@ Manufacturer ID: HBRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PD12 diff --git a/src/madflight_board_betaflight_HENA-TALONF4V2.h b/src/madflight_board_betaflight_HENA-TALONF4V2.h index 8353fc5..96d5f26 100644 --- a/src/madflight_board_betaflight_HENA-TALONF4V2.h +++ b/src/madflight_board_betaflight_HENA-TALONF4V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.948265 +Generated on: 2024-05-14 03:27:31.977671 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TALONF4V2 @@ -24,42 +24,82 @@ Manufacturer ID: HENA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_HENA-TALONF7DJIHD.h b/src/madflight_board_betaflight_HENA-TALONF7DJIHD.h index 8881772..9d8428d 100644 --- a/src/madflight_board_betaflight_HENA-TALONF7DJIHD.h +++ b/src/madflight_board_betaflight_HENA-TALONF7DJIHD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.948265 +Generated on: 2024-05-14 03:27:31.979232 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TALONF7DJIHD @@ -24,42 +24,82 @@ Manufacturer ID: HENA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PA1,PC8,PC9,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_HENA-TALONF7FUSION.h b/src/madflight_board_betaflight_HENA-TALONF7FUSION.h index c2810e5..f79bba4 100644 --- a/src/madflight_board_betaflight_HENA-TALONF7FUSION.h +++ b/src/madflight_board_betaflight_HENA-TALONF7FUSION.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.948265 +Generated on: 2024-05-14 03:27:31.980269 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TALONF7FUSION @@ -24,42 +24,82 @@ Manufacturer ID: HENA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_HENA-TALONF7V2.h b/src/madflight_board_betaflight_HENA-TALONF7V2.h index 2002386..3fe93c1 100644 --- a/src/madflight_board_betaflight_HENA-TALONF7V2.h +++ b/src/madflight_board_betaflight_HENA-TALONF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.967449 +Generated on: 2024-05-14 03:27:31.981831 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TALONF7V2 @@ -24,42 +24,82 @@ Manufacturer ID: HENA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_HFOR-HIFIONRCF7.h b/src/madflight_board_betaflight_HFOR-HIFIONRCF7.h index c74990a..44cd75c 100644 --- a/src/madflight_board_betaflight_HFOR-HIFIONRCF7.h +++ b/src/madflight_board_betaflight_HFOR-HIFIONRCF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.967449 +Generated on: 2024-05-14 03:27:31.982869 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HIFIONRCF7 @@ -25,42 +25,82 @@ Manufacturer ID: HFOR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB3,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB3,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB3,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF405.h b/src/madflight_board_betaflight_HGLR-HGLRCF405.h index 7877faa..9fe5597 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF405.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.979987 +Generated on: 2024-05-14 03:27:31.984437 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF405 @@ -25,42 +25,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C0) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PB5} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF405AS.h b/src/madflight_board_betaflight_HGLR-HGLRCF405AS.h index f878fae..9c2376f 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF405AS.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF405AS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.979987 +Generated on: 2024-05-14 03:27:31.985493 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF405AS @@ -25,42 +25,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF405V2.h b/src/madflight_board_betaflight_HGLR-HGLRCF405V2.h index ee8fde9..61abbbf 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF405V2.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF405V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.979987 +Generated on: 2024-05-14 03:27:31.986535 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF405V2 @@ -26,42 +26,82 @@ Manufacturer ID: HGLRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} - //other pins #define HW_PIN_BEEPER PB8 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF411.h b/src/madflight_board_betaflight_HGLR-HGLRCF411.h index 2dfbb18..3f66f21 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF411.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.995621 +Generated on: 2024-05-14 03:27:31.987575 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF411 @@ -25,42 +25,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF411ELRS.h b/src/madflight_board_betaflight_HGLR-HGLRCF411ELRS.h index c6a920a..55e054b 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF411ELRS.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF411ELRS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.995621 +Generated on: 2024-05-14 03:27:31.988627 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF411ELRS @@ -24,42 +24,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280.h b/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280.h index e1d45fb..2b3265f 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:43.995621 +Generated on: 2024-05-14 03:27:31.990203 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF411SX1280 @@ -37,42 +37,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -93,10 +133,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280V2.h b/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280V2.h index 7088bb2..98fa31b 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280V2.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF411SX1280V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.011245 +Generated on: 2024-05-14 03:27:31.991246 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF411SX1280V2 @@ -39,42 +39,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -95,10 +135,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722.h b/src/madflight_board_betaflight_HGLR-HGLRCF722.h index 80a05e0..74dbd2d 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.011245 +Generated on: 2024-05-14 03:27:31.992287 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722 @@ -26,42 +26,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722AIO.h b/src/madflight_board_betaflight_HGLR-HGLRCF722AIO.h index 5bd3818..63faa1b 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722AIO.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.011245 +Generated on: 2024-05-14 03:27:31.993864 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722AIO @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722AIOV2.h b/src/madflight_board_betaflight_HGLR-HGLRCF722AIOV2.h index 713d1dd..dccfdbd 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722AIOV2.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722AIOV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.026870 +Generated on: 2024-05-14 03:27:31.994911 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722AIOV2 @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722E.h b/src/madflight_board_betaflight_HGLR-HGLRCF722E.h index 6afab11..e0bef7f 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722E.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722E.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.026870 +Generated on: 2024-05-14 03:27:31.996719 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722E @@ -25,42 +25,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722MINI.h b/src/madflight_board_betaflight_HGLR-HGLRCF722MINI.h index 74337b1..93f706a 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722MINI.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.026870 +Generated on: 2024-05-14 03:27:31.997777 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722MINI @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF722MINIV2.h b/src/madflight_board_betaflight_HGLR-HGLRCF722MINIV2.h index f505dd8..d176efe 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF722MINIV2.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF722MINIV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.042494 +Generated on: 2024-05-14 03:27:31.998829 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF722MINIV2 @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_HGLR-HGLRCF745.h b/src/madflight_board_betaflight_HGLR-HGLRCF745.h index beeccd4..393a373 100644 --- a/src/madflight_board_betaflight_HGLR-HGLRCF745.h +++ b/src/madflight_board_betaflight_HGLR-HGLRCF745.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.042494 +Generated on: 2024-05-14 03:27:31.999867 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HGLRCF745 @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C0) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-ZEUSF4EVO.h b/src/madflight_board_betaflight_HGLR-ZEUSF4EVO.h index 0ff0fe3..3e7563b 100644 --- a/src/madflight_board_betaflight_HGLR-ZEUSF4EVO.h +++ b/src/madflight_board_betaflight_HGLR-ZEUSF4EVO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.055836 +Generated on: 2024-05-14 03:27:32.001267 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEUSF4EVO @@ -25,42 +25,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-ZEUSF4FR.h b/src/madflight_board_betaflight_HGLR-ZEUSF4FR.h index ec656e4..3adcdd5 100644 --- a/src/madflight_board_betaflight_HGLR-ZEUSF4FR.h +++ b/src/madflight_board_betaflight_HGLR-ZEUSF4FR.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.062275 +Generated on: 2024-05-14 03:27:32.001772 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEUSF4FR @@ -27,42 +27,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HGLR-ZEUSF722_AIO.h b/src/madflight_board_betaflight_HGLR-ZEUSF722_AIO.h index b9f2a95..f893a2a 100644 --- a/src/madflight_board_betaflight_HGLR-ZEUSF722_AIO.h +++ b/src/madflight_board_betaflight_HGLR-ZEUSF722_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.067778 +Generated on: 2024-05-14 03:27:32.002819 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEUSF722_AIO @@ -26,42 +26,82 @@ Manufacturer ID: HGLR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HNEC-NIDICI_F4.h b/src/madflight_board_betaflight_HNEC-NIDICI_F4.h index 2560d83..151349b 100644 --- a/src/madflight_board_betaflight_HNEC-NIDICI_F4.h +++ b/src/madflight_board_betaflight_HNEC-NIDICI_F4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.072782 +Generated on: 2024-05-14 03:27:32.003873 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NIDICI_F4 @@ -25,42 +25,82 @@ Manufacturer ID: HNEC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF4G3.h b/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF4G3.h index 31d76c8..09484fd 100644 --- a/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF4G3.h +++ b/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF4G3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.079073 +Generated on: 2024-05-14 03:27:32.004918 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HOBBYWING_XROTORF4G3 @@ -23,42 +23,82 @@ Manufacturer ID: HOWI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = PC9; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC9 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF7CONV.h b/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF7CONV.h index 06c5e7e..cd9f9be 100644 --- a/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF7CONV.h +++ b/src/madflight_board_betaflight_HOWI-HOBBYWING_XROTORF7CONV.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.085063 +Generated on: 2024-05-14 03:27:32.005957 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HOBBYWING_XROTORF7CONV @@ -25,42 +25,82 @@ Manufacturer ID: HOWI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F405.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F405.h index a7ef936..a8b8a1d 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F405.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.090061 +Generated on: 2024-05-14 03:27:32.007001 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F405 @@ -24,42 +24,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F411RX.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F411RX.h index 12acac3..997e8dd 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F411RX.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F411RX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.095651 +Generated on: 2024-05-14 03:27:32.008070 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F411RX @@ -21,42 +21,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB6,PB7} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL) -const int HW_PIN_GPS_RX = -1; -const int HW_PIN_GPS_TX = -1; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX -1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX -1 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PB6,PB7} - //other pins #define HW_PIN_PPM PA3 #define HW_PIN_LED_STRIP PA10 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722.h index 7d2a463..689ca55 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.100639 +Generated on: 2024-05-14 03:27:32.009116 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F722 @@ -28,42 +28,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722_X1.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722_X1.h index 343f9c5..6e13a8f 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722_X1.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F722_X1.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.105640 +Generated on: 2024-05-14 03:27:32.010189 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F722_X1 @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB0,PC8,PC9,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC8,PC9,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB0,PC8,PC9,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_AIO.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_AIO.h index 7f8f070..8be5b02 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_AIO.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.111107 +Generated on: 2024-05-14 03:27:32.011243 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F7_AIO @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PD15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PD15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C4) -const int HW_PIN_I2C_SDA = PD12; -const int HW_PIN_I2C_SCL = PD13; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PD12 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PD13 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB0,PB5,PB1,PE9,PE11,PE13,PE14}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB0,PB5,PB1,PE9,PE11,PE13,PE14} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {4,PD12,PD13} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB0,PB5,PB1,PE9,PE11,PE13,PE14} - //other pins #define HW_PIN_BEEPER PD3 #define HW_PIN_SERVO PB6 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_PRO.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_PRO.h index 5035ac3..e5899b5 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_PRO.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_BLITZ_F7_PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.116279 +Generated on: 2024-05-14 03:27:32.012331 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_BLITZ_F7_PRO @@ -27,42 +27,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_LED_STRIP PA1 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_DEFENDER_F411.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_DEFENDER_F411.h index 6a5952c..42233d4 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_DEFENDER_F411.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_DEFENDER_F411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.121279 +Generated on: 2024-05-14 03:27:32.013375 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_DEFENDER_F411 @@ -26,42 +26,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PB10,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PB10,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PB10,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_AIO.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_AIO.h index 0cc25cc..4b00a52 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_AIO.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.128206 +Generated on: 2024-05-14 03:27:32.014415 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F405_AIO @@ -24,42 +24,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_TWING.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_TWING.h index 840edea..5c81b29 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_TWING.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F405_TWING.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.135257 +Generated on: 2024-05-14 03:27:32.015463 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F405_TWING @@ -27,42 +27,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8,PA1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8,PA1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8,PA1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_AIO32.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_AIO32.h index 17e598b..1c8f33c 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_AIO32.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_AIO32.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.140256 +Generated on: 2024-05-14 03:27:32.016501 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F411_AIO32 @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_PRO.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_PRO.h index 9c9ea86..d370d56 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_PRO.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F411_PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.146680 +Generated on: 2024-05-14 03:27:32.017029 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F411_PRO @@ -28,42 +28,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PB10,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PB10,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PB10,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F4SX1280.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F4SX1280.h index cb6106c..398d926 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F4SX1280.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.152671 +Generated on: 2024-05-14 03:27:32.018065 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F4SX1280 @@ -34,42 +34,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB6,PB7} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL) -const int HW_PIN_GPS_RX = -1; -const int HW_PIN_GPS_TX = -1; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX -1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX -1 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -90,10 +130,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PB6,PB7} - //other pins #define HW_PIN_PPM PA3 #define HW_PIN_LED_STRIP PA10 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F722_TWING.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F722_TWING.h index f9eea81..edca3d7 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F722_TWING.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F722_TWING.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.158690 +Generated on: 2024-05-14 03:27:32.019627 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F722_TWING @@ -30,42 +30,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -86,10 +126,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO.h index ba6c5e5..f05cc66 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.166299 +Generated on: 2024-05-14 03:27:32.020671 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F745_AIO @@ -27,42 +27,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PB4,PB5} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_LED_STRIP PD12 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO_V2.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO_V2.h index a6c9d7a..c926045 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO_V2.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_F745_AIO_V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.171823 +Generated on: 2024-05-14 03:27:32.022404 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_F745_AIO_V2 @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_H743_AIO_V2.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_H743_AIO_V2.h index c869052..52da7b3 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_H743_AIO_V2.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_H743_AIO_V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.177704 +Generated on: 2024-05-14 03:27:32.023977 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_H743_AIO_V2 @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_H7_TWING.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_H7_TWING.h index f4856f4..d94e650 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_H7_TWING.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_H7_TWING.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.183142 +Generated on: 2024-05-14 03:27:32.026075 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_H7_TWING @@ -27,42 +27,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PB0,PB1,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB0,PB1,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PB0,PB1,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F4.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F4.h index ca51dd0..3957cd5 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F4.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.189142 +Generated on: 2024-05-14 03:27:32.027214 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_SUCCEX_E_F4 @@ -25,42 +25,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F7.h b/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F7.h index b8c111e..057ff3f 100644 --- a/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F7.h +++ b/src/madflight_board_betaflight_IFRC-IFLIGHT_SUCCEX_E_F7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.194610 +Generated on: 2024-05-14 03:27:32.028762 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: IFLIGHT_SUCCEX_E_F7 @@ -26,42 +26,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-JBF7.h b/src/madflight_board_betaflight_IFRC-JBF7.h index 6e2a3f8..8f95c43 100644 --- a/src/madflight_board_betaflight_IFRC-JBF7.h +++ b/src/madflight_board_betaflight_IFRC-JBF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.201167 +Generated on: 2024-05-14 03:27:32.029833 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JBF7 @@ -26,42 +26,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-JBF7_DJI.h b/src/madflight_board_betaflight_IFRC-JBF7_DJI.h index 9d53a9f..8326594 100644 --- a/src/madflight_board_betaflight_IFRC-JBF7_DJI.h +++ b/src/madflight_board_betaflight_IFRC-JBF7_DJI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.207181 +Generated on: 2024-05-14 03:27:32.031421 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JBF7_DJI @@ -26,42 +26,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_IFRC-JBF7_V2.h b/src/madflight_board_betaflight_IFRC-JBF7_V2.h index c727462..c6ebfa5 100644 --- a/src/madflight_board_betaflight_IFRC-JBF7_V2.h +++ b/src/madflight_board_betaflight_IFRC-JBF7_V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.213574 +Generated on: 2024-05-14 03:27:32.032805 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JBF7_V2 @@ -23,42 +23,82 @@ Manufacturer ID: IFRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB1,PB0,PC8,PC9,PB6,PB7,PB10,PB11} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_JHEF-JHEF405PRO.h b/src/madflight_board_betaflight_JHEF-JHEF405PRO.h index 9f87bc4..540565f 100644 --- a/src/madflight_board_betaflight_JHEF-JHEF405PRO.h +++ b/src/madflight_board_betaflight_JHEF-JHEF405PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.218574 +Generated on: 2024-05-14 03:27:32.033834 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEF405PRO @@ -29,42 +29,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PB13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -85,10 +125,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PB5,PB7,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA9 diff --git a/src/madflight_board_betaflight_JHEF-JHEF411.h b/src/madflight_board_betaflight_JHEF-JHEF411.h index 505d3b4..0d81ab4 100644 --- a/src/madflight_board_betaflight_JHEF-JHEF411.h +++ b/src/madflight_board_betaflight_JHEF-JHEF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.223591 +Generated on: 2024-05-14 03:27:32.035991 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEF411 @@ -27,42 +27,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 5; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PB0,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 5 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PB0,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 5 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PB0,PB4} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_JHEF-JHEF411HD.h b/src/madflight_board_betaflight_JHEF-JHEF411HD.h index 1b46fdb..0db2b46 100644 --- a/src/madflight_board_betaflight_JHEF-JHEF411HD.h +++ b/src/madflight_board_betaflight_JHEF-JHEF411HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.228641 +Generated on: 2024-05-14 03:27:32.036938 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEF411HD @@ -27,42 +27,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_JHEF-JHEF745.h b/src/madflight_board_betaflight_JHEF-JHEF745.h index ffe00af..fdfbc7f 100644 --- a/src/madflight_board_betaflight_JHEF-JHEF745.h +++ b/src/madflight_board_betaflight_JHEF-JHEF745.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.232627 +Generated on: 2024-05-14 03:27:32.037963 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEF745 @@ -26,42 +26,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11,PC9,PA3,PB4,PB5} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PE13 diff --git a/src/madflight_board_betaflight_JHEF-JHEF7DUAL.h b/src/madflight_board_betaflight_JHEF-JHEF7DUAL.h index f12c91b..e34844a 100644 --- a/src/madflight_board_betaflight_JHEF-JHEF7DUAL.h +++ b/src/madflight_board_betaflight_JHEF-JHEF7DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.237637 +Generated on: 2024-05-14 03:27:32.039558 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEF7DUAL @@ -28,42 +28,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB3,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB3,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB3,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_JHEF-JHEH743_AIO.h b/src/madflight_board_betaflight_JHEF-JHEH743_AIO.h index d79f034..c2e57f1 100644 --- a/src/madflight_board_betaflight_JHEF-JHEH743_AIO.h +++ b/src/madflight_board_betaflight_JHEF-JHEH743_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.241628 +Generated on: 2024-05-14 03:27:32.040409 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEH743_AIO @@ -25,42 +25,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PE9,PB0,PE11,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PE9,PB0,PE11,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PE9,PB0,PE11,PB1} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_JHEF-JHEH743_HD.h b/src/madflight_board_betaflight_JHEF-JHEH743_HD.h index b497f51..446ef49 100644 --- a/src/madflight_board_betaflight_JHEF-JHEH743_HD.h +++ b/src/madflight_board_betaflight_JHEF-JHEH743_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.244244 +Generated on: 2024-05-14 03:27:32.041948 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JHEH743_HD @@ -26,42 +26,82 @@ Manufacturer ID: JHEF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} - //other pins #define HW_PIN_BEEPER PE3 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_JMI-JMIF722A.h b/src/madflight_board_betaflight_JMI-JMIF722A.h index 87d1ad5..1f8ac99 100644 --- a/src/madflight_board_betaflight_JMI-JMIF722A.h +++ b/src/madflight_board_betaflight_JMI-JMIF722A.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.244244 +Generated on: 2024-05-14 03:27:32.043097 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: JMIF722A @@ -25,42 +25,82 @@ Manufacturer ID: JMI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_KLEE-SYNERGYF4.h b/src/madflight_board_betaflight_KLEE-SYNERGYF4.h index 00eba75..3997e63 100644 --- a/src/madflight_board_betaflight_KLEE-SYNERGYF4.h +++ b/src/madflight_board_betaflight_KLEE-SYNERGYF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.244244 +Generated on: 2024-05-14 03:27:32.043603 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SYNERGYF4 @@ -25,42 +25,82 @@ Manufacturer ID: KLEE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_LDAR-LDARC_F411.h b/src/madflight_board_betaflight_LDAR-LDARC_F411.h index 5527ac3..f76b0bb 100644 --- a/src/madflight_board_betaflight_LDAR-LDARC_F411.h +++ b/src/madflight_board_betaflight_LDAR-LDARC_F411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.259751 +Generated on: 2024-05-14 03:27:32.044690 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: LDARC_F411 @@ -21,42 +21,82 @@ Manufacturer ID: LDAR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_LEGA-ELLE0.h b/src/madflight_board_betaflight_LEGA-ELLE0.h index 2f3079e..82f3f48 100644 --- a/src/madflight_board_betaflight_LEGA-ELLE0.h +++ b/src/madflight_board_betaflight_LEGA-ELLE0.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.267758 +Generated on: 2024-05-14 03:27:32.045767 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ELLE0 @@ -21,42 +21,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PB5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA0,PA1,PB8,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA0,PA1,PB8,PB9} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PC5; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC5 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA0,PA1,PB8,PB9} - //other pins #define HW_PIN_PPM PA2 #define HW_PIN_PWM PA2 diff --git a/src/madflight_board_betaflight_LEGA-FISHDRONEF4.h b/src/madflight_board_betaflight_LEGA-FISHDRONEF4.h index 3a4476d..566a5d1 100644 --- a/src/madflight_board_betaflight_LEGA-FISHDRONEF4.h +++ b/src/madflight_board_betaflight_LEGA-FISHDRONEF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.267758 +Generated on: 2024-05-14 03:27:32.046296 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FISHDRONEF4 @@ -23,42 +23,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA2,PA15,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA2,PA15,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA2,PA15,PA3} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PB0 diff --git a/src/madflight_board_betaflight_LEGA-KROOZX.h b/src/madflight_board_betaflight_LEGA-KROOZX.h index c00ec16..bec7729 100644 --- a/src/madflight_board_betaflight_LEGA-KROOZX.h +++ b/src/madflight_board_betaflight_LEGA-KROOZX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.275780 +Generated on: 2024-05-14 03:27:32.047347 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: KROOZX @@ -23,42 +23,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C3) -const int HW_PIN_I2C_SDA = PA8; -const int HW_PIN_I2C_SCL = PC9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PC9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA2,PA3,PA0,PA1,PB1,PB0,PB8,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA2,PA3,PA0,PA1,PB1,PB0,PB8,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB13; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB13 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA2,PA3,PA0,PA1,PB1,PB0,PB8,PB9} - //other pins #define HW_PIN_BEEPER PC1 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_LEGA-PIRXF4.h b/src/madflight_board_betaflight_LEGA-PIRXF4.h index 5331dd6..b518b88 100644 --- a/src/madflight_board_betaflight_LEGA-PIRXF4.h +++ b/src/madflight_board_betaflight_LEGA-PIRXF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.275780 +Generated on: 2024-05-14 03:27:32.047876 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PIRXF4 @@ -23,42 +23,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB8,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB8,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB8,PB9} - //other pins #define HW_PIN_BEEPER PA15 //#define HW_PIN_LED PC13 diff --git a/src/madflight_board_betaflight_LEGA-PODIUMF4.h b/src/madflight_board_betaflight_LEGA-PODIUMF4.h index 32a0248..6974d3f 100644 --- a/src/madflight_board_betaflight_LEGA-PODIUMF4.h +++ b/src/madflight_board_betaflight_LEGA-PODIUMF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.275780 +Generated on: 2024-05-14 03:27:32.048936 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PODIUMF4 @@ -23,42 +23,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA0} - //other pins #define HW_PIN_PPM PB14 #define HW_PIN_PWM PB14 diff --git a/src/madflight_board_betaflight_LEGA-STACKX.h b/src/madflight_board_betaflight_LEGA-STACKX.h index 559a245..00462c3 100644 --- a/src/madflight_board_betaflight_LEGA-STACKX.h +++ b/src/madflight_board_betaflight_LEGA-STACKX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.275780 +Generated on: 2024-05-14 03:27:32.050042 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STACKX @@ -23,42 +23,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA2,PA15,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA2,PA15,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA2,PA15,PA3} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PB0 diff --git a/src/madflight_board_betaflight_LEGA-VRRACE.h b/src/madflight_board_betaflight_LEGA-VRRACE.h index e5d0ac8..e0d7eee 100644 --- a/src/madflight_board_betaflight_LEGA-VRRACE.h +++ b/src/madflight_board_betaflight_LEGA-VRRACE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.291413 +Generated on: 2024-05-14 03:27:32.050548 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VRRACE @@ -22,42 +22,82 @@ Manufacturer ID: LEGA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PD14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PD14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PE10; -const int HW_PIN_IMU_EXTI = PD10; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE10 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD10 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA1,PA2,PA3,PB5,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA1,PA2,PA3,PB5,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PA5; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA5 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA1,PA2,PA3,PB5,PB0,PB1} - //other pins #define HW_PIN_BEEPER PA0 #define HW_PIN_PPM PE9 diff --git a/src/madflight_board_betaflight_LMNR-LUXAIO.h b/src/madflight_board_betaflight_LMNR-LUXAIO.h index 626100c..cfcacbe 100644 --- a/src/madflight_board_betaflight_LMNR-LUXAIO.h +++ b/src/madflight_board_betaflight_LMNR-LUXAIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.291413 +Generated on: 2024-05-14 03:27:32.051620 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: LUXAIO @@ -24,42 +24,82 @@ Manufacturer ID: LMNR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PB7,PC8,PB6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PB7,PC8,PB6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PB7,PC8,PB6} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_LMNR-LUXF4OSD.h b/src/madflight_board_betaflight_LMNR-LUXF4OSD.h index 5aa0ce7..9ee70b8 100644 --- a/src/madflight_board_betaflight_LMNR-LUXF4OSD.h +++ b/src/madflight_board_betaflight_LMNR-LUXF4OSD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.291413 +Generated on: 2024-05-14 03:27:32.052671 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: LUXF4OSD @@ -25,42 +25,82 @@ Manufacturer ID: LMNR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PB14 diff --git a/src/madflight_board_betaflight_LMNR-LUXF7HDV.h b/src/madflight_board_betaflight_LMNR-LUXF7HDV.h index 7f65f17..975a472 100644 --- a/src/madflight_board_betaflight_LMNR-LUXF7HDV.h +++ b/src/madflight_board_betaflight_LMNR-LUXF7HDV.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.307040 +Generated on: 2024-05-14 03:27:32.053198 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: LUXF7HDV @@ -23,42 +23,82 @@ Manufacturer ID: LMNR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_LMNR-LUXMINIF7.h b/src/madflight_board_betaflight_LMNR-LUXMINIF7.h index 237cdb7..49d5d6e 100644 --- a/src/madflight_board_betaflight_LMNR-LUXMINIF7.h +++ b/src/madflight_board_betaflight_LMNR-LUXMINIF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.307040 +Generated on: 2024-05-14 03:27:32.054265 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: LUXMINIF7 @@ -25,42 +25,82 @@ Manufacturer ID: LMNR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB6,PC8,PB7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PC8,PB7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PC11; -const int HW_PIN_GPS_TX = PC10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB6,PC8,PB7,PC9} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_MEPS-MEPSF411.h b/src/madflight_board_betaflight_MEPS-MEPSF411.h index 2786969..19668c3 100644 --- a/src/madflight_board_betaflight_MEPS-MEPSF411.h +++ b/src/madflight_board_betaflight_MEPS-MEPSF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.307040 +Generated on: 2024-05-14 03:27:32.055318 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MEPSF411 @@ -26,42 +26,82 @@ Manufacturer ID: MEPS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PA0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MEPS-MEPSF4SX1280.h b/src/madflight_board_betaflight_MEPS-MEPSF4SX1280.h index eed20bb..23d6c83 100644 --- a/src/madflight_board_betaflight_MEPS-MEPSF4SX1280.h +++ b/src/madflight_board_betaflight_MEPS-MEPSF4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.322663 +Generated on: 2024-05-14 03:27:32.055848 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MEPSF4SX1280 @@ -35,42 +35,82 @@ Manufacturer ID: MEPS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL) -const int HW_PIN_GPS_RX = -1; -const int HW_PIN_GPS_TX = -1; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX -1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX -1 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PA0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -91,10 +131,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MERA-MERAKRCF405.h b/src/madflight_board_betaflight_MERA-MERAKRCF405.h index facaad9..fdd602d 100644 --- a/src/madflight_board_betaflight_MERA-MERAKRCF405.h +++ b/src/madflight_board_betaflight_MERA-MERAKRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.322663 +Generated on: 2024-05-14 03:27:32.057428 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MERAKRCF405 @@ -22,42 +22,82 @@ Manufacturer ID: MERA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PA0,PA1,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PA0,PA1,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PA0,PA1,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC8 diff --git a/src/madflight_board_betaflight_MERA-MERAKRCF722.h b/src/madflight_board_betaflight_MERA-MERAKRCF722.h index 864d0fa..9a2252a 100644 --- a/src/madflight_board_betaflight_MERA-MERAKRCF722.h +++ b/src/madflight_board_betaflight_MERA-MERAKRCF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.322663 +Generated on: 2024-05-14 03:27:32.058471 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MERAKRCF722 @@ -22,42 +22,82 @@ Manufacturer ID: MERA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PA0,PA1,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PA0,PA1,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PA0,PA1,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC8 diff --git a/src/madflight_board_betaflight_MOLA-MLTEMPF4.h b/src/madflight_board_betaflight_MOLA-MLTEMPF4.h index 80ecc4d..41616b2 100644 --- a/src/madflight_board_betaflight_MOLA-MLTEMPF4.h +++ b/src/madflight_board_betaflight_MOLA-MLTEMPF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.338288 +Generated on: 2024-05-14 03:27:32.059515 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MLTEMPF4 @@ -23,42 +23,82 @@ Manufacturer ID: MOLA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB5,PB0,PB3,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB5,PB0,PB3,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB5,PB0,PB3,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_MOLA-MLTYPHF4.h b/src/madflight_board_betaflight_MOLA-MLTYPHF4.h index b4679bd..d90b9cd 100644 --- a/src/madflight_board_betaflight_MOLA-MLTYPHF4.h +++ b/src/madflight_board_betaflight_MOLA-MLTYPHF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.338288 +Generated on: 2024-05-14 03:27:32.060560 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MLTYPHF4 @@ -22,42 +22,82 @@ Manufacturer ID: MOLA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC5; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC5 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB5,PB0,PB3,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB5,PB0,PB3,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB5,PB0,PB3,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405AIO.h b/src/madflight_board_betaflight_MTKS-MATEKF405AIO.h index 290c0a4..97e44bc 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405AIO.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.338288 +Generated on: 2024-05-14 03:27:32.061598 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405AIO @@ -23,42 +23,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405CTR.h b/src/madflight_board_betaflight_MTKS-MATEKF405CTR.h index 6dd6a27..2b2174d 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405CTR.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405CTR.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.353913 +Generated on: 2024-05-14 03:27:32.062632 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405CTR @@ -24,42 +24,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405MINI.h b/src/madflight_board_betaflight_MTKS-MATEKF405MINI.h index 61db32f..90df625 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405MINI.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.353913 +Generated on: 2024-05-14 03:27:32.063670 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405MINI @@ -24,42 +24,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405SE.h b/src/madflight_board_betaflight_MTKS-MATEKF405SE.h index 1e55d03..4a79d37 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405SE.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405SE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.353913 +Generated on: 2024-05-14 03:27:32.064715 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405SE @@ -24,42 +24,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB7,PB6,PB0,PB1,PC8,PC9,PB14,PB15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB0,PB1,PC8,PC9,PB14,PB15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB7,PB6,PB0,PB1,PC8,PC9,PB14,PB15} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405STD.h b/src/madflight_board_betaflight_MTKS-MATEKF405STD.h index 437cef9..552e4cd 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405STD.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405STD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.369944 +Generated on: 2024-05-14 03:27:32.065754 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405STD @@ -24,42 +24,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8,PB0} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405TE.h b/src/madflight_board_betaflight_MTKS-MATEKF405TE.h index 74b1b60..01ebbb3 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405TE.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405TE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.369944 +Generated on: 2024-05-14 03:27:32.066790 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405TE @@ -25,42 +25,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC14; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC14 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PC5; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC5 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15} - //other pins #define HW_PIN_BEEPER PB9 #define HW_PIN_SERVO PB14 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF405TE_SD.h b/src/madflight_board_betaflight_MTKS-MATEKF405TE_SD.h index eeb8ca0..a740726 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF405TE_SD.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF405TE_SD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.369944 +Generated on: 2024-05-14 03:27:32.067819 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF405TE_SD @@ -24,42 +24,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC14; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC14 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PC5; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC5 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC9,PC8,PB15,PA8,PB11,PB10,PB3,PA15} - //other pins #define HW_PIN_BEEPER PB9 #define HW_PIN_SERVO PB14 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF411.h b/src/madflight_board_betaflight_MTKS-MATEKF411.h index 3db84bf..efca439 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF411.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.385589 +Generated on: 2024-05-14 03:27:32.068353 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF411 @@ -23,42 +23,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF411RX.h b/src/madflight_board_betaflight_MTKS-MATEKF411RX.h index 4e39b61..2482027 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF411RX.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF411RX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.385589 +Generated on: 2024-05-14 03:27:32.068868 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF411RX @@ -23,42 +23,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PB6,PB7,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PB6,PB7,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PB6,PB7,PB8} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF411SE.h b/src/madflight_board_betaflight_MTKS-MATEKF411SE.h index 5b6060a..aa32c85 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF411SE.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF411SE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.385589 +Generated on: 2024-05-14 03:27:32.070376 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF411SE @@ -23,42 +23,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PA8,PA9,PA10,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PA8,PA9,PA10,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB3; -const int HW_PIN_RCIN_TX = PA15; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA15 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PA8,PA9,PA10,PB8} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF722.h b/src/madflight_board_betaflight_MTKS-MATEKF722.h index c0c1540..17bc436 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF722.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.401222 +Generated on: 2024-05-14 03:27:32.071380 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF722 @@ -25,42 +25,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PB1,PA8,PB8,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PB1,PA8,PB8,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PB1,PA8,PB8,PA2} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF722HD.h b/src/madflight_board_betaflight_MTKS-MATEKF722HD.h index f3d0ccb..1ffa811 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF722HD.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF722HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.401222 +Generated on: 2024-05-14 03:27:32.072272 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF722HD @@ -25,42 +25,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PB4,PB5,PB0,PB1,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB4,PB5,PB0,PB1,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PB4,PB5,PB0,PB1,PB10,PB11} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_SERVO PB6 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF722MINI.h b/src/madflight_board_betaflight_MTKS-MATEKF722MINI.h index ed4184b..9975dbf 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF722MINI.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF722MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.401222 +Generated on: 2024-05-14 03:27:32.073231 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF722MINI @@ -26,42 +26,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKF722SE.h b/src/madflight_board_betaflight_MTKS-MATEKF722SE.h index 80d6fd0..8cd571e 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKF722SE.h +++ b/src/madflight_board_betaflight_MTKS-MATEKF722SE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.416831 +Generated on: 2024-05-14 03:27:32.074244 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKF722SE @@ -26,42 +26,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_MTKS-MATEKH743.h b/src/madflight_board_betaflight_MTKS-MATEKH743.h index 61bc4df..3ba6c88 100644 --- a/src/madflight_board_betaflight_MTKS-MATEKH743.h +++ b/src/madflight_board_betaflight_MTKS-MATEKH743.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.416831 +Generated on: 2024-05-14 03:27:32.075258 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MATEKH743 @@ -28,42 +28,82 @@ Manufacturer ID: MTKS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_SERVO PE5 diff --git a/src/madflight_board_betaflight_NAMO-NAMIMNOF722.h b/src/madflight_board_betaflight_NAMO-NAMIMNOF722.h index 71b0c50..8cf27bb 100644 --- a/src/madflight_board_betaflight_NAMO-NAMIMNOF722.h +++ b/src/madflight_board_betaflight_NAMO-NAMIMNOF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.416831 +Generated on: 2024-05-14 03:27:32.076295 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NAMIMNOF722 @@ -27,42 +27,82 @@ Manufacturer ID: NAMO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7.h b/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7.h index 2abff1a..5666b05 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7.h +++ b/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.416831 +Generated on: 2024-05-14 03:27:32.077411 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_CRICKETF7 @@ -22,42 +22,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB1,PB3,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB1,PB3,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB1,PB3,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7V2.h b/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7V2.h index f4abdd4..41c98ad 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7V2.h +++ b/src/madflight_board_betaflight_NEBD-NBD_CRICKETF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.432456 +Generated on: 2024-05-14 03:27:32.078424 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_CRICKETF7V2 @@ -20,42 +20,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB1,PB3,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB1,PB3,PB0} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB1,PB3,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NEBD-NBD_GALAXYAIO255.h b/src/madflight_board_betaflight_NEBD-NBD_GALAXYAIO255.h index c052cd3..8e915b4 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_GALAXYAIO255.h +++ b/src/madflight_board_betaflight_NEBD-NBD_GALAXYAIO255.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.432456 +Generated on: 2024-05-14 03:27:32.079520 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_GALAXYAIO255 @@ -22,42 +22,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PA0,PA1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA0,PA1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PA0,PA1} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NEBD-NBD_INFINITY200RS.h b/src/madflight_board_betaflight_NEBD-NBD_INFINITY200RS.h index 400b7e1..0955abe 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_INFINITY200RS.h +++ b/src/madflight_board_betaflight_NEBD-NBD_INFINITY200RS.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.448087 +Generated on: 2024-05-14 03:27:32.080372 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_INFINITY200RS @@ -24,42 +24,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE13; -const int HW_PIN_SPI_MOSI = PE14; -const int HW_PIN_SPI_SCLK = PE12; -const int HW_PIN_IMU_CS = PE11; -const int HW_PIN_IMU_EXTI = PB1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE13 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE14 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE12 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE11 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7} - //other pins #define HW_PIN_LED_STRIP PA9 //#define HW_PIN_LED PC0 diff --git a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIO.h b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIO.h index c06bdc2..ccea394 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIO.h +++ b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.448087 +Generated on: 2024-05-14 03:27:32.080879 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_INFINITYAIO @@ -23,42 +23,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB1,PB3,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB1,PB3,PB0} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB1,PB3,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2.h b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2.h index 02046df..e88686a 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2.h +++ b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.448087 +Generated on: 2024-05-14 03:27:32.082009 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_INFINITYAIOV2 @@ -23,42 +23,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE13; -const int HW_PIN_SPI_MOSI = PE14; -const int HW_PIN_SPI_SCLK = PE12; -const int HW_PIN_IMU_CS = PE11; -const int HW_PIN_IMU_EXTI = PB1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE13 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE14 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE12 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE11 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD13 #define HW_PIN_LED_STRIP PA9 diff --git a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2PRO.h b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2PRO.h index 350fb13..90ebec3 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2PRO.h +++ b/src/madflight_board_betaflight_NEBD-NBD_INFINITYAIOV2PRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.463706 +Generated on: 2024-05-14 03:27:32.083418 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_INFINITYAIOV2PRO @@ -23,42 +23,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE13; -const int HW_PIN_SPI_MOSI = PE14; -const int HW_PIN_SPI_SCLK = PE12; -const int HW_PIN_IMU_CS = PE11; -const int HW_PIN_IMU_EXTI = PB1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE13 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE14 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE12 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE11 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_BEEPER PD13 #define HW_PIN_LED_STRIP PA9 diff --git a/src/madflight_board_betaflight_NEBD-NBD_INFINITYF4.h b/src/madflight_board_betaflight_NEBD-NBD_INFINITYF4.h index 227e7b8..d7cd09e 100644 --- a/src/madflight_board_betaflight_NEBD-NBD_INFINITYF4.h +++ b/src/madflight_board_betaflight_NEBD-NBD_INFINITYF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.468213 +Generated on: 2024-05-14 03:27:32.084403 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NBD_INFINITYF4 @@ -24,42 +24,82 @@ Manufacturer ID: NEBD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PC9,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC9,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PA10; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PA10 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PC9,PA8} - //other pins #define HW_PIN_BEEPER PB6 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_NERC-FLOWBOX.h b/src/madflight_board_betaflight_NERC-FLOWBOX.h index 441095d..830da8a 100644 --- a/src/madflight_board_betaflight_NERC-FLOWBOX.h +++ b/src/madflight_board_betaflight_NERC-FLOWBOX.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.468213 +Generated on: 2024-05-14 03:27:32.085389 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLOWBOX @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB10,PA0,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB10,PA0,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = -1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V -1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB10,PA0,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB1 //#define HW_PIN_LED PC13 diff --git a/src/madflight_board_betaflight_NERC-FLOWBOXV2.h b/src/madflight_board_betaflight_NERC-FLOWBOXV2.h index 2c7e921..3a330a0 100644 --- a/src/madflight_board_betaflight_NERC-FLOWBOXV2.h +++ b/src/madflight_board_betaflight_NERC-FLOWBOXV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.479736 +Generated on: 2024-05-14 03:27:32.085893 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FLOWBOXV2 @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PB0,PB1,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PB0,PB1,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = -1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V -1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PB0,PB1,PB10} - //other pins #define HW_PIN_BEEPER PB8 //#define HW_PIN_LED PC13 diff --git a/src/madflight_board_betaflight_NERC-HYBRIDG4.h b/src/madflight_board_betaflight_NERC-HYBRIDG4.h index 0b58d4f..8234f7b 100644 --- a/src/madflight_board_betaflight_NERC-HYBRIDG4.h +++ b/src/madflight_board_betaflight_NERC-HYBRIDG4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.479736 +Generated on: 2024-05-14 03:27:32.086879 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: HYBRIDG4 @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA15; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA15 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB2,PB3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB2,PB3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA15,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB2,PB3} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCF407.h b/src/madflight_board_betaflight_NERC-NEUTRONRCF407.h index cdabe73..6ca6f61 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCF407.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCF407.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.479736 +Generated on: 2024-05-14 03:27:32.088411 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCF407 @@ -21,42 +21,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC13; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC13 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCF411AIO.h b/src/madflight_board_betaflight_NERC-NEUTRONRCF411AIO.h index c091a39..4391e55 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCF411AIO.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCF411AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.495378 +Generated on: 2024-05-14 03:27:32.088915 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCF411AIO @@ -25,42 +25,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PA0,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PA0,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PA0,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCF411SX1280.h b/src/madflight_board_betaflight_NERC-NEUTRONRCF411SX1280.h index e1d8e28..63d09f7 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCF411SX1280.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCF411SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.495378 +Generated on: 2024-05-14 03:27:32.090429 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCF411SX1280 @@ -40,42 +40,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB6; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB6 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PA0,PB10,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA0,PB10,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PB0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -96,10 +136,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PA0,PB10,PB7} - //other pins #define HW_PIN_BEEPER PA14 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCF722AIO.h b/src/madflight_board_betaflight_NERC-NEUTRONRCF722AIO.h index be71f47..4ceb36e 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCF722AIO.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCF722AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.495378 +Generated on: 2024-05-14 03:27:32.090947 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCF722AIO @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCF7AIO.h b/src/madflight_board_betaflight_NERC-NEUTRONRCF7AIO.h index 6f17e2e..fdae2e8 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCF7AIO.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCF7AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.511019 +Generated on: 2024-05-14 03:27:32.092517 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCF7AIO @@ -27,42 +27,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PD0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB5,PD12,PD13,PC8,PC9} - //other pins #define HW_PIN_BEEPER PD2 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCG4AIO.h b/src/madflight_board_betaflight_NERC-NEUTRONRCG4AIO.h index 2d55bf6..8ec4864 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCG4AIO.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCG4AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.511019 +Generated on: 2024-05-14 03:27:32.093559 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCG4AIO @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PA15; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA15 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PB3,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PB3,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PA15,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PB3,PB4} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCH743AIO.h b/src/madflight_board_betaflight_NERC-NEUTRONRCH743AIO.h index da3b1ea..e112707 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCH743AIO.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCH743AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.526629 +Generated on: 2024-05-14 03:27:32.094718 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCH743AIO @@ -20,42 +20,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NERC-NEUTRONRCH7BT.h b/src/madflight_board_betaflight_NERC-NEUTRONRCH7BT.h index 0caaa29..a289d71 100644 --- a/src/madflight_board_betaflight_NERC-NEUTRONRCH7BT.h +++ b/src/madflight_board_betaflight_NERC-NEUTRONRCH7BT.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.526629 +Generated on: 2024-05-14 03:27:32.096299 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NEUTRONRCH7BT @@ -23,42 +23,82 @@ Manufacturer ID: NERC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_NGUA-UAVPNG030MINI.h b/src/madflight_board_betaflight_NGUA-UAVPNG030MINI.h index 3d13274..4336770 100644 --- a/src/madflight_board_betaflight_NGUA-UAVPNG030MINI.h +++ b/src/madflight_board_betaflight_NGUA-UAVPNG030MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.526629 +Generated on: 2024-05-14 03:27:32.097332 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: UAVPNG030MINI @@ -21,42 +21,82 @@ Manufacturer ID: NGUA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PE0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE0 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA8,PE11,PE13,PE14,PB5,PD13,PD14,PD15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PE11,PE13,PE14,PB5,PD13,PD14,PD15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA8,PE11,PE13,PE14,PB5,PD13,PD14,PD15} - //other pins #define HW_PIN_BEEPER PB0 #define HW_PIN_PPM PA2 diff --git a/src/madflight_board_betaflight_OPEN-REVO.h b/src/madflight_board_betaflight_OPEN-REVO.h index 63c2b32..618d753 100644 --- a/src/madflight_board_betaflight_OPEN-REVO.h +++ b/src/madflight_board_betaflight_OPEN-REVO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.526629 +Generated on: 2024-05-14 03:27:32.098383 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: REVO @@ -24,42 +24,82 @@ Manufacturer ID: OPEN #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PA3,PA2,PA1,PA0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA3,PA2,PA1,PA0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PA3,PA2,PA1,PA0} - //other pins #define HW_PIN_PPM PB14 #define HW_PIN_PWM PB14 diff --git a/src/madflight_board_betaflight_OPEN-REVONANO.h b/src/madflight_board_betaflight_OPEN-REVONANO.h index 461b022..854858d 100644 --- a/src/madflight_board_betaflight_OPEN-REVONANO.h +++ b/src/madflight_board_betaflight_OPEN-REVONANO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.542265 +Generated on: 2024-05-14 03:27:32.099417 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: REVONANO @@ -21,42 +21,82 @@ Manufacturer ID: OPEN #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PA15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA15 +#endif //BARO/MAG I2C: (I2C3) -const int HW_PIN_I2C_SDA = PA8; -const int HW_PIN_I2C_SCL = PB4; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB4 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA10,PB3,PB8,PB9,PA0,PA1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA10,PB3,PB8,PB9,PA0,PA1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA6; -const int HW_PIN_BAT_I = PA7; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA6 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA7 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {3,PA8,PB4} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA10,PB3,PB8,PB9,PA0,PA1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB10 diff --git a/src/madflight_board_betaflight_PYDR-PYRODRONEF4.h b/src/madflight_board_betaflight_PYDR-PYRODRONEF4.h index 588269d..9d7d32e 100644 --- a/src/madflight_board_betaflight_PYDR-PYRODRONEF4.h +++ b/src/madflight_board_betaflight_PYDR-PYRODRONEF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.542265 +Generated on: 2024-05-14 03:27:32.100398 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PYRODRONEF4 @@ -22,42 +22,82 @@ Manufacturer ID: PYDR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PC9,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC9,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC3; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC3 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PC9,PA8} - //other pins #define HW_PIN_BEEPER PB5 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_PYDR-PYRODRONEF4PDB.h b/src/madflight_board_betaflight_PYDR-PYRODRONEF4PDB.h index 00c386c..c9c9737 100644 --- a/src/madflight_board_betaflight_PYDR-PYRODRONEF4PDB.h +++ b/src/madflight_board_betaflight_PYDR-PYRODRONEF4PDB.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.552974 +Generated on: 2024-05-14 03:27:32.101425 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PYRODRONEF4PDB @@ -24,42 +24,82 @@ Manufacturer ID: PYDR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PC9,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PC9,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC3; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC3 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PC9,PA8} - //other pins #define HW_PIN_BEEPER PB5 #define HW_PIN_LED_STRIP PB8 diff --git a/src/madflight_board_betaflight_PYDR-PYRODRONEF7.h b/src/madflight_board_betaflight_PYDR-PYRODRONEF7.h index e14394b..89d24e2 100644 --- a/src/madflight_board_betaflight_PYDR-PYRODRONEF7.h +++ b/src/madflight_board_betaflight_PYDR-PYRODRONEF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.561148 +Generated on: 2024-05-14 03:27:32.102456 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PYRODRONEF7 @@ -22,42 +22,82 @@ Manufacturer ID: PYDR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PC8,PA1,PB9,PC9,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_RAST-AIRF7.h b/src/madflight_board_betaflight_RAST-AIRF7.h index b8da018..4897d2e 100644 --- a/src/madflight_board_betaflight_RAST-AIRF7.h +++ b/src/madflight_board_betaflight_RAST-AIRF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.566129 +Generated on: 2024-05-14 03:27:32.103497 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AIRF7 @@ -26,42 +26,82 @@ Manufacturer ID: RAST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = -1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI -1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL3) -const int HW_PIN_RCIN_RX = PC11; -const int HW_PIN_RCIN_TX = PC10; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PC11 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PC10 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL6) -const int HW_PIN_GPS_RX = PC7; -const int HW_PIN_GPS_TX = PC6; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PC7 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PC6 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_RAST-MINI_H743_HD.h b/src/madflight_board_betaflight_RAST-MINI_H743_HD.h index 2e3e90e..6311c1a 100644 --- a/src/madflight_board_betaflight_RAST-MINI_H743_HD.h +++ b/src/madflight_board_betaflight_RAST-MINI_H743_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.571652 +Generated on: 2024-05-14 03:27:32.104541 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MINI_H743_HD @@ -25,42 +25,82 @@ Manufacturer ID: RAST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PD12,PD13,PB0,PB1,PC8,PC9,PB4,PB5} - //other pins #define HW_PIN_BEEPER PB3 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_RCTI-ARESF7.h b/src/madflight_board_betaflight_RCTI-ARESF7.h index 4947a7a..ed52bc7 100644 --- a/src/madflight_board_betaflight_RCTI-ARESF7.h +++ b/src/madflight_board_betaflight_RCTI-ARESF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.576652 +Generated on: 2024-05-14 03:27:32.105880 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ARESF7 @@ -24,42 +24,82 @@ Manufacturer ID: RCTI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA9 diff --git a/src/madflight_board_betaflight_RCTI-BEEROTORF4.h b/src/madflight_board_betaflight_RCTI-BEEROTORF4.h index e9aa6af..2ed0af8 100644 --- a/src/madflight_board_betaflight_RCTI-BEEROTORF4.h +++ b/src/madflight_board_betaflight_RCTI-BEEROTORF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.581393 +Generated on: 2024-05-14 03:27:32.106920 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BEEROTORF4 @@ -23,42 +23,82 @@ Manufacturer ID: RCTI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA8; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA8 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA1,PA0,PC6,PC7,PB5,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA1,PA0,PC6,PC7,PB5,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA1,PA0,PC6,PC7,PB5,PB9} - //other pins #define HW_PIN_BEEPER PB3 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_RUSH-BLADE_F7.h b/src/madflight_board_betaflight_RUSH-BLADE_F7.h index cfd4ed4..54dc84f 100644 --- a/src/madflight_board_betaflight_RUSH-BLADE_F7.h +++ b/src/madflight_board_betaflight_RUSH-BLADE_F7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.587386 +Generated on: 2024-05-14 03:27:32.107961 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BLADE_F7 @@ -27,42 +27,82 @@ Manufacturer ID: RUSH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB10; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB10 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_CAMERA_CONTROL PA8 diff --git a/src/madflight_board_betaflight_RUSH-BLADE_F7_AIO.h b/src/madflight_board_betaflight_RUSH-BLADE_F7_AIO.h index 8a50f9b..0fd6606 100644 --- a/src/madflight_board_betaflight_RUSH-BLADE_F7_AIO.h +++ b/src/madflight_board_betaflight_RUSH-BLADE_F7_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.592385 +Generated on: 2024-05-14 03:27:32.108519 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BLADE_F7_AIO @@ -27,42 +27,82 @@ Manufacturer ID: RUSH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_RUSH-BLADE_F7_HD.h b/src/madflight_board_betaflight_RUSH-BLADE_F7_HD.h index 2fa788c..bad6d5e 100644 --- a/src/madflight_board_betaflight_RUSH-BLADE_F7_HD.h +++ b/src/madflight_board_betaflight_RUSH-BLADE_F7_HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.597750 +Generated on: 2024-05-14 03:27:32.109724 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: BLADE_F7_HD @@ -28,42 +28,82 @@ Manufacturer ID: RUSH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB10; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB10 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PB1,PB0,PC7,PC6,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_RUSH-RUSHCORE7.h b/src/madflight_board_betaflight_RUSH-RUSHCORE7.h index 7bda124..a39a760 100644 --- a/src/madflight_board_betaflight_RUSH-RUSHCORE7.h +++ b/src/madflight_board_betaflight_RUSH-RUSHCORE7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.602101 +Generated on: 2024-05-14 03:27:32.110771 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: RUSHCORE7 @@ -26,42 +26,82 @@ Manufacturer ID: RUSH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PA8,PA9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PA8,PA9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PA8,PA9} - //other pins #define HW_PIN_BEEPER PB1 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_RUSH-RUSHF7AIO.h b/src/madflight_board_betaflight_RUSH-RUSHF7AIO.h index 4fa4d2d..7a07acf 100644 --- a/src/madflight_board_betaflight_RUSH-RUSHF7AIO.h +++ b/src/madflight_board_betaflight_RUSH-RUSHF7AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.607247 +Generated on: 2024-05-14 03:27:32.111820 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: RUSHF7AIO @@ -27,42 +27,82 @@ Manufacturer ID: RUSH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_SDRC-SDMODELH7.h b/src/madflight_board_betaflight_SDRC-SDMODELH7.h index e86c73e..829db33 100644 --- a/src/madflight_board_betaflight_SDRC-SDMODELH7.h +++ b/src/madflight_board_betaflight_SDRC-SDMODELH7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.612432 +Generated on: 2024-05-14 03:27:32.112860 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SDMODELH7 @@ -26,42 +26,82 @@ Manufacturer ID: SDRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB3,PB10,PA0,PA2,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PD12 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF405.h b/src/madflight_board_betaflight_SJET-AOCODAF405.h index 24f60dd..b2cc0de 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF405.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.617459 +Generated on: 2024-05-14 03:27:32.113903 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF405 @@ -24,42 +24,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB11; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB11 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6,PA15,PA8,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6,PA15,PA8,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6,PA15,PA8,PB8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6000.h b/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6000.h index 66e1147..c367ca9 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6000.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6000.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.621432 +Generated on: 2024-05-14 03:27:32.114945 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF405V2MPU6000 @@ -26,42 +26,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} - //other pins #define HW_PIN_BEEPER PB8 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6500.h b/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6500.h index c455a45..4179a30 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6500.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF405V2MPU6500.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.625846 +Generated on: 2024-05-14 03:27:32.115718 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF405V2MPU6500 @@ -26,42 +26,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB10,PB11} - //other pins #define HW_PIN_BEEPER PB8 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF722BLE.h b/src/madflight_board_betaflight_SJET-AOCODAF722BLE.h index 3e8edd6..122f43e 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF722BLE.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF722BLE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.631292 +Generated on: 2024-05-14 03:27:32.117398 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF722BLE @@ -24,42 +24,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC9,PC8,PC7,PC6,PB1,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PC7,PC6,PB1,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC9,PC8,PC7,PC6,PB1,PA8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF722MINI.h b/src/madflight_board_betaflight_SJET-AOCODAF722MINI.h index b6f54a2..a621aa0 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF722MINI.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF722MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.637294 +Generated on: 2024-05-14 03:27:32.118242 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF722MINI @@ -25,42 +25,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PB6,PB3,PA15,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PB6,PB3,PA15,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PB6,PB3,PA15,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODAF722MINIV2.h b/src/madflight_board_betaflight_SJET-AOCODAF722MINIV2.h index 1c6fa09..c1c01d2 100644 --- a/src/madflight_board_betaflight_SJET-AOCODAF722MINIV2.h +++ b/src/madflight_board_betaflight_SJET-AOCODAF722MINIV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.644218 +Generated on: 2024-05-14 03:27:32.119793 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODAF722MINIV2 @@ -27,42 +27,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PC8,PC9,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PC8,PC9,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PC8,PC9,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODARCF405_AIO.h b/src/madflight_board_betaflight_SJET-AOCODARCF405_AIO.h index db3bac1..514e704 100644 --- a/src/madflight_board_betaflight_SJET-AOCODARCF405_AIO.h +++ b/src/madflight_board_betaflight_SJET-AOCODARCF405_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.649835 +Generated on: 2024-05-14 03:27:32.120835 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODARCF405_AIO @@ -27,42 +27,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB8 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_SJET-AOCODARCF411_AIO.h b/src/madflight_board_betaflight_SJET-AOCODARCF411_AIO.h index 6afdfae..e667c4e 100644 --- a/src/madflight_board_betaflight_SJET-AOCODARCF411_AIO.h +++ b/src/madflight_board_betaflight_SJET-AOCODARCF411_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.654833 +Generated on: 2024-05-14 03:27:32.121884 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODARCF411_AIO @@ -26,42 +26,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODARCF722_AIO.h b/src/madflight_board_betaflight_SJET-AOCODARCF722_AIO.h index 82f4a2f..6ad63cb 100644 --- a/src/madflight_board_betaflight_SJET-AOCODARCF722_AIO.h +++ b/src/madflight_board_betaflight_SJET-AOCODARCF722_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.662627 +Generated on: 2024-05-14 03:27:32.123219 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODARCF722_AIO @@ -28,42 +28,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SJET-AOCODARCF7DUAL.h b/src/madflight_board_betaflight_SJET-AOCODARCF7DUAL.h index 520a4e7..9445a0f 100644 --- a/src/madflight_board_betaflight_SJET-AOCODARCF7DUAL.h +++ b/src/madflight_board_betaflight_SJET-AOCODARCF7DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.668135 +Generated on: 2024-05-14 03:27:32.124796 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODARCF7DUAL @@ -26,42 +26,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SJET-AOCODARCH7DUAL.h b/src/madflight_board_betaflight_SJET-AOCODARCH7DUAL.h index 0687a04..0b57f4d 100644 --- a/src/madflight_board_betaflight_SJET-AOCODARCH7DUAL.h +++ b/src/madflight_board_betaflight_SJET-AOCODARCH7DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.673150 +Generated on: 2024-05-14 03:27:32.126377 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: AOCODARCH7DUAL @@ -28,42 +28,82 @@ Manufacturer ID: SJET #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA0,PA1,PA2,PA3,PD12,PD13} - //other pins #define HW_PIN_BEEPER PA15 #define HW_PIN_SERVO PE5 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSF405.h b/src/madflight_board_betaflight_SKST-SKYSTARSF405.h index f3ee28b..a16393e 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSF405.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.677954 +Generated on: 2024-05-14 03:27:32.127424 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSF405 @@ -26,42 +26,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB7,PB6,PB4,PB3,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB4,PB3,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB7,PB6,PB4,PB3,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSF405AIO.h b/src/madflight_board_betaflight_SKST-SKYSTARSF405AIO.h index b32378d..12639c7 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSF405AIO.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSF405AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.683299 +Generated on: 2024-05-14 03:27:32.128993 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSF405AIO @@ -25,42 +25,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB7,PB6,PB4,PB3,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB4,PB3,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB7,PB6,PB4,PB3,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSF411.h b/src/madflight_board_betaflight_SKST-SKYSTARSF411.h index 2e6147a..d7a7f08 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSF411.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.688300 +Generated on: 2024-05-14 03:27:32.130606 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSF411 @@ -24,42 +24,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PC14; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC14 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA0,PA1,PB6,PB7,PB10,PNONE}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB6,PB7,PB10,PNONE} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = PA4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA0,PA1,PB6,PB7,PB10,PNONE} - //other pins //#define HW_PIN_LED PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSF7HD.h b/src/madflight_board_betaflight_SKST-SKYSTARSF7HD.h index 953ddc8..af300cd 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSF7HD.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSF7HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.693299 +Generated on: 2024-05-14 03:27:32.132161 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSF7HD @@ -25,42 +25,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9} - //other pins //#define HW_PIN_LED PC15 #define HW_PIN_LED_2 PC14 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSF7HDPRO.h b/src/madflight_board_betaflight_SKST-SKYSTARSF7HDPRO.h index 89664ec..26a27a5 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSF7HDPRO.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSF7HDPRO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.698836 +Generated on: 2024-05-14 03:27:32.133206 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSF7HDPRO @@ -25,42 +25,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC8,PC9,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC8,PC9,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB4 diff --git a/src/madflight_board_betaflight_SKST-SKYSTARSH7HD.h b/src/madflight_board_betaflight_SKST-SKYSTARSH7HD.h index 94e0ddd..8fa8dc7 100644 --- a/src/madflight_board_betaflight_SKST-SKYSTARSH7HD.h +++ b/src/madflight_board_betaflight_SKST-SKYSTARSH7HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.703837 +Generated on: 2024-05-14 03:27:32.134250 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYSTARSH7HD @@ -24,42 +24,82 @@ Manufacturer ID: SKST #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PD7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC15; -const int HW_PIN_IMU_EXTI = PB2; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PD7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB2 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PD12,PD13,PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PD12,PD13,PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PD12,PD13,PA0,PA1,PA2,PA3} - //other pins #define HW_PIN_BEEPER PB3 #define HW_PIN_SERVO PE5 diff --git a/src/madflight_board_betaflight_SKZO-ATOMRCF405.h b/src/madflight_board_betaflight_SKZO-ATOMRCF405.h index 00d3064..126e280 100644 --- a/src/madflight_board_betaflight_SKZO-ATOMRCF405.h +++ b/src/madflight_board_betaflight_SKZO-ATOMRCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.708892 +Generated on: 2024-05-14 03:27:32.135294 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ATOMRCF405 @@ -24,42 +24,82 @@ Manufacturer ID: SKZO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PC7,PB4,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC7,PB4,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PC7,PB4,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_SKZO-ATOMRCF411.h b/src/madflight_board_betaflight_SKZO-ATOMRCF411.h index abec62b..a2e65c2 100644 --- a/src/madflight_board_betaflight_SKZO-ATOMRCF411.h +++ b/src/madflight_board_betaflight_SKZO-ATOMRCF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.713437 +Generated on: 2024-05-14 03:27:32.135826 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ATOMRCF411 @@ -22,42 +22,82 @@ Manufacturer ID: SKZO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SKZO-ATOMRCF722.h b/src/madflight_board_betaflight_SKZO-ATOMRCF722.h index 3437439..44de418 100644 --- a/src/madflight_board_betaflight_SKZO-ATOMRCF722.h +++ b/src/madflight_board_betaflight_SKZO-ATOMRCF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.718438 +Generated on: 2024-05-14 03:27:32.136885 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ATOMRCF722 @@ -24,42 +24,82 @@ Manufacturer ID: SKZO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PC7,PB4,PC8,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC7,PB4,PC8,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PC7,PB4,PC8,PC6} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_SKZO-SKYZONEF405.h b/src/madflight_board_betaflight_SKZO-SKYZONEF405.h index 9f6a6ce..644d92c 100644 --- a/src/madflight_board_betaflight_SKZO-SKYZONEF405.h +++ b/src/madflight_board_betaflight_SKZO-SKYZONEF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.725437 +Generated on: 2024-05-14 03:27:32.137927 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SKYZONEF405 @@ -23,42 +23,82 @@ Manufacturer ID: SKZO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PC7,PB4,PC8,PC9,PC6,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC7,PB4,PC8,PC9,PC6,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PC7,PB4,PC8,PC9,PC6,PA8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_SLGD-SOLOGOODF405.h b/src/madflight_board_betaflight_SLGD-SOLOGOODF405.h index 8545a03..70961d4 100644 --- a/src/madflight_board_betaflight_SLGD-SOLOGOODF405.h +++ b/src/madflight_board_betaflight_SLGD-SOLOGOODF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.730631 +Generated on: 2024-05-14 03:27:32.138963 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SOLOGOODF405 @@ -27,42 +27,82 @@ Manufacturer ID: SLGD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_SLGD-SOLOGOODF722.h b/src/madflight_board_betaflight_SLGD-SOLOGOODF722.h index d9f6d3b..2406599 100644 --- a/src/madflight_board_betaflight_SLGD-SOLOGOODF722.h +++ b/src/madflight_board_betaflight_SLGD-SOLOGOODF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.735184 +Generated on: 2024-05-14 03:27:32.140526 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SOLOGOODF722 @@ -27,42 +27,82 @@ Manufacturer ID: SLGD #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF4.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF4.h index 0cae9b3..4b4b4d9 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF4.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.739173 +Generated on: 2024-05-14 03:27:32.141575 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF4 @@ -24,42 +24,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB11; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB11 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA15,PA8,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA15,PA8,PB8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA15,PA8,PB8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405MINI.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405MINI.h index b7dde8c..027af72 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405MINI.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.744129 +Generated on: 2024-05-14 03:27:32.142615 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF405MINI @@ -25,42 +25,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V3.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V3.h index 86ae089..216747e 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V3.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.744129 +Generated on: 2024-05-14 03:27:32.143654 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF405V3 @@ -23,42 +23,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC8; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC8 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PB0,PB1,PB5,PB4} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_SERVO PA8 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V4.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V4.h index 50a69dd..9f2a7e1 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V4.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF405V4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.744129 +Generated on: 2024-05-14 03:27:32.144792 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF405V4 @@ -24,42 +24,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB6,PB7,PB0,PB1,PC8,PC9,PB10,PA15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB0,PB1,PC8,PC9,PB10,PA15} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB6,PB7,PB0,PB1,PC8,PC9,PB10,PA15} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7.h index df574d0..96a69fc 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.744129 +Generated on: 2024-05-14 03:27:32.145867 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF7 @@ -26,42 +26,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9,PA8,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9,PA8,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9,PA8,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINI.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINI.h index 88e2781..6f3fa4b 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINI.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.759172 +Generated on: 2024-05-14 03:27:32.146927 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF7MINI @@ -24,42 +24,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINIV2.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINIV2.h index 4d6a949..cd0aa1e 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINIV2.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7MINIV2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.759172 +Generated on: 2024-05-14 03:27:32.148284 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF7MINIV2 @@ -23,42 +23,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V2.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V2.h index b84a76e..dd32faa 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V2.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.768217 +Generated on: 2024-05-14 03:27:32.149311 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF7V2 @@ -25,42 +25,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PC9} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB7 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V3.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V3.h index b8c7f7d..5a1816b 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V3.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEEF7V3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.775223 +Generated on: 2024-05-14 03:27:32.150359 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEEF7V3 @@ -23,42 +23,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA15,PB3,PB4,PB6,PB7,PB5,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA15,PB3,PB4,PB6,PB7,PB5,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA15,PB3,PB4,PB6,PB7,PB5,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPBE-SPEEDYBEE_F745_AIO.h b/src/madflight_board_betaflight_SPBE-SPEEDYBEE_F745_AIO.h index 0a1b304..69164d6 100644 --- a/src/madflight_board_betaflight_SPBE-SPEEDYBEE_F745_AIO.h +++ b/src/madflight_board_betaflight_SPBE-SPEEDYBEE_F745_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.775223 +Generated on: 2024-05-14 03:27:32.151392 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEEDYBEE_F745_AIO @@ -25,42 +25,82 @@ Manufacturer ID: SPBE #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI4) -const int HW_PIN_SPI_MISO = PE5; -const int HW_PIN_SPI_MOSI = PE6; -const int HW_PIN_SPI_SCLK = PE2; -const int HW_PIN_IMU_CS = PE4; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PE5 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PE6 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PE2 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PE9,PE11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PE9,PE11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PE9,PE11} - //other pins #define HW_PIN_BEEPER PD15 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_SPCM-SPCMAKERF411.h b/src/madflight_board_betaflight_SPCM-SPCMAKERF411.h index c153ebc..24d48c3 100644 --- a/src/madflight_board_betaflight_SPCM-SPCMAKERF411.h +++ b/src/madflight_board_betaflight_SPCM-SPCMAKERF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.775223 +Generated on: 2024-05-14 03:27:32.152451 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPCMAKERF411 @@ -24,42 +24,82 @@ Manufacturer ID: SPCM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PB10,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PB10,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PB10,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPDX-SPEDIXF4.h b/src/madflight_board_betaflight_SPDX-SPEDIXF4.h index b5a4494..0dca510 100644 --- a/src/madflight_board_betaflight_SPDX-SPEDIXF4.h +++ b/src/madflight_board_betaflight_SPDX-SPEDIXF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.790897 +Generated on: 2024-05-14 03:27:32.153498 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEDIXF4 @@ -25,42 +25,82 @@ Manufacturer ID: SPDX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC14; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC14 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_SPDX-SPEDIXF405.h b/src/madflight_board_betaflight_SPDX-SPEDIXF405.h index ef689a1..784ac36 100644 --- a/src/madflight_board_betaflight_SPDX-SPEDIXF405.h +++ b/src/madflight_board_betaflight_SPDX-SPEDIXF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.790897 +Generated on: 2024-05-14 03:27:32.154023 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEDIXF405 @@ -26,42 +26,82 @@ Manufacturer ID: SPDX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPDX-SPEDIXF722.h b/src/madflight_board_betaflight_SPDX-SPEDIXF722.h index 9f48460..aacea2e 100644 --- a/src/madflight_board_betaflight_SPDX-SPEDIXF722.h +++ b/src/madflight_board_betaflight_SPDX-SPEDIXF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.790897 +Generated on: 2024-05-14 03:27:32.155430 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPEDIXF722 @@ -27,42 +27,82 @@ Manufacturer ID: SPDX #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB5,PB4,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGF4EVO.h b/src/madflight_board_betaflight_SPRO-SPRACINGF4EVO.h index 137fca2..e153e51 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGF4EVO.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGF4EVO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.806480 +Generated on: 2024-05-14 03:27:32.156477 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGF4EVO @@ -22,42 +22,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PC9,PC8,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC9,PC8,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PB2; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB2 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PC9,PC8,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_SERVO PA9 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGF4NEO.h b/src/madflight_board_betaflight_SPRO-SPRACINGF4NEO.h index 06485e5..16d9af0 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGF4NEO.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGF4NEO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.806480 +Generated on: 2024-05-14 03:27:32.157512 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGF4NEO @@ -23,42 +23,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC7,PC9,PC6,PB6,PB7,PB10,PB11}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC7,PC9,PC6,PB6,PB7,PB10,PB11} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PB2; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB2 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC7,PC9,PC6,PB6,PB7,PB10,PB11} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_SERVO PA9 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGF7DUAL.h b/src/madflight_board_betaflight_SPRO-SPRACINGF7DUAL.h index a03e586..8a65a2e 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGF7DUAL.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGF7DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.806480 +Generated on: 2024-05-14 03:27:32.158944 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGF7DUAL @@ -23,42 +23,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC6,PC9,PC7,PB6,PB7,PB1,PB0} - //other pins #define HW_PIN_BEEPER PC15 #define HW_PIN_SERVO PA9 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGH7EXTREME.h b/src/madflight_board_betaflight_SPRO-SPRACINGH7EXTREME.h index 738e29d..389ab70 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGH7EXTREME.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGH7EXTREME.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.822135 +Generated on: 2024-05-14 03:27:32.161107 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGH7EXTREME @@ -94,42 +94,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = -1; -const int HW_PIN_SPI_MOSI = -1; -const int HW_PIN_SPI_SCLK = -1; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO -1 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI -1 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK -1 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB15; -const int HW_PIN_RCIN_TX = PB14; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB15 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB14 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PNONE; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PNONE +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -150,10 +190,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 4 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PNONE,PNONE}, {3,PNONE,PNONE}, {4,PNONE,PNONE} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} - //other pins #define HW_PIN_BEEPER PD7 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGH7NANO.h b/src/madflight_board_betaflight_SPRO-SPRACINGH7NANO.h index d361ab7..e523356 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGH7NANO.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGH7NANO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.822135 +Generated on: 2024-05-14 03:27:32.162925 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGH7NANO @@ -87,42 +87,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = -1; -const int HW_PIN_SPI_MOSI = -1; -const int HW_PIN_SPI_SCLK = -1; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PE15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO -1 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI -1 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK -1 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB15; -const int HW_PIN_RCIN_TX = PB14; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB15 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB14 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PNONE; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PNONE +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -143,10 +183,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 4 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PNONE,PNONE}, {3,PNONE,PNONE}, {4,PNONE,PNONE} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} - //other pins #define HW_PIN_BEEPER PD7 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGH7RF.h b/src/madflight_board_betaflight_SPRO-SPRACINGH7RF.h index f01445c..486fe16 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGH7RF.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGH7RF.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.822135 +Generated on: 2024-05-14 03:27:32.164881 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGH7RF @@ -140,42 +140,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI6) -const int HW_PIN_SPI_MISO = -1; -const int HW_PIN_SPI_MOSI = -1; -const int HW_PIN_SPI_SCLK = -1; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO -1 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI -1 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK -1 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD15 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PA6,PA7,PA0,PA1,PA2,PA3}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PA6,PA7,PA0,PA1,PA2,PA3} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PNONE; -const int HW_PIN_RCIN_TX = PNONE; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PNONE +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PNONE +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC3; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -196,10 +236,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 4 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11}, {3,PNONE,PNONE}, {4,PNONE,PNONE} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PA6,PA7,PA0,PA1,PA2,PA3} - //other pins #define HW_PIN_BEEPER PE4 #define HW_PIN_LED_STRIP PB7 diff --git a/src/madflight_board_betaflight_SPRO-SPRACINGH7ZERO.h b/src/madflight_board_betaflight_SPRO-SPRACINGH7ZERO.h index c1207b8..15e3a6a 100644 --- a/src/madflight_board_betaflight_SPRO-SPRACINGH7ZERO.h +++ b/src/madflight_board_betaflight_SPRO-SPRACINGH7ZERO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.837730 +Generated on: 2024-05-14 03:27:32.166344 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SPRACINGH7ZERO @@ -101,42 +101,82 @@ Manufacturer ID: SPRO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE3; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE3 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = -1; -const int HW_PIN_SPI_MOSI = -1; -const int HW_PIN_SPI_SCLK = -1; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PD4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO -1 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI -1 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK -1 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PD4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB15; -const int HW_PIN_RCIN_TX = PB14; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB15 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB14 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PNONE; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PNONE +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC4; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC4 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -157,10 +197,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 4 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PNONE,PNONE}, {3,PNONE,PNONE}, {4,PNONE,PNONE} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB6,PB7,PC6,PC7} - //other pins #define HW_PIN_BEEPER PD7 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_STMI-NUCLEOF722.h b/src/madflight_board_betaflight_STMI-NUCLEOF722.h index d08cc66..e1156df 100644 --- a/src/madflight_board_betaflight_STMI-NUCLEOF722.h +++ b/src/madflight_board_betaflight_STMI-NUCLEOF722.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.837730 +Generated on: 2024-05-14 03:27:32.167801 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: NUCLEOF722 @@ -21,42 +21,82 @@ Manufacturer ID: STMI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB7; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB7 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = -1; -const int HW_PIN_IMU_EXTI = PB15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS -1 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB8,PA3,PB5,PB9,PE6,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PA3,PB5,PB9,PE6,PB4} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PD6; -const int HW_PIN_RCIN_TX = PD5; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PD6 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PD5 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PD9; -const int HW_PIN_GPS_TX = PD8; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD9 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD8 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA3; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA3 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB8,PA3,PB5,PB9,PE6,PB4} - //other pins #define HW_PIN_PPM PB15 #define HW_PIN_PWM PB15 diff --git a/src/madflight_board_betaflight_STMI-STM32F411DISCOVERY.h b/src/madflight_board_betaflight_STMI-STM32F411DISCOVERY.h index 6250470..84b376c 100644 --- a/src/madflight_board_betaflight_STMI-STM32F411DISCOVERY.h +++ b/src/madflight_board_betaflight_STMI-STM32F411DISCOVERY.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.853357 +Generated on: 2024-05-14 03:27:32.168304 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STM32F411DISCOVERY @@ -22,42 +22,82 @@ Manufacturer ID: STMI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PD15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PD15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PE3; -const int HW_PIN_IMU_EXTI = PE1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PE3 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PE1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB0,PA2,PA3,PA10,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PA2,PA3,PA10,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA15; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA15 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB0,PA2,PA3,PA10,PA8} - //other pins #define HW_PIN_BEEPER PD12 #define HW_PIN_PPM PB8 diff --git a/src/madflight_board_betaflight_STMI-STM32F4DISCOVERY.h b/src/madflight_board_betaflight_STMI-STM32F4DISCOVERY.h index 2b1174a..da23e62 100644 --- a/src/madflight_board_betaflight_STMI-STM32F4DISCOVERY.h +++ b/src/madflight_board_betaflight_STMI-STM32F4DISCOVERY.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.853357 +Generated on: 2024-05-14 03:27:32.169371 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: STM32F4DISCOVERY @@ -22,42 +22,82 @@ Manufacturer ID: STMI #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PD12; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PD12 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB0,PA2,PA3,PA10,PA8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PA2,PA3,PA10,PA8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB0,PA2,PA3,PA10,PA8} - //other pins #define HW_PIN_PPM PB9 #define HW_PIN_LED_STRIP PB9 diff --git a/src/madflight_board_betaflight_SU25-SUB250F411.h b/src/madflight_board_betaflight_SU25-SUB250F411.h index 8018e81..3b30dde 100644 --- a/src/madflight_board_betaflight_SU25-SUB250F411.h +++ b/src/madflight_board_betaflight_SU25-SUB250F411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.853357 +Generated on: 2024-05-14 03:27:32.170407 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SUB250F411 @@ -26,42 +26,82 @@ Manufacturer ID: SU25 #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PC15; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PC15 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_SU25-SUB250REDFOXF722AIO.h b/src/madflight_board_betaflight_SU25-SUB250REDFOXF722AIO.h index b5dba65..0034a29 100644 --- a/src/madflight_board_betaflight_SU25-SUB250REDFOXF722AIO.h +++ b/src/madflight_board_betaflight_SU25-SUB250REDFOXF722AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.869439 +Generated on: 2024-05-14 03:27:32.171260 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: SUB250REDFOXF722AIO @@ -27,42 +27,82 @@ Manufacturer ID: SU25 #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC8,PC9,PA8,PA9,PB0,PB1,PA10,PB4} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PB3 diff --git a/src/madflight_board_betaflight_TACO-MODULARF4.h b/src/madflight_board_betaflight_TACO-MODULARF4.h index 0958497..72375d3 100644 --- a/src/madflight_board_betaflight_TACO-MODULARF4.h +++ b/src/madflight_board_betaflight_TACO-MODULARF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.875154 +Generated on: 2024-05-14 03:27:32.172281 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: MODULARF4 @@ -20,42 +20,82 @@ Manufacturer ID: TACO #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB1,PB0,PA3,PA2}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB0,PA3,PA2} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB1,PB0,PA3,PA2} - //other pins #define HW_PIN_BEEPER PA8 #define HW_PIN_PPM PC9 diff --git a/src/madflight_board_betaflight_TCMM-TCMMF411.h b/src/madflight_board_betaflight_TCMM-TCMMF411.h index 02e81f7..3964459 100644 --- a/src/madflight_board_betaflight_TCMM-TCMMF411.h +++ b/src/madflight_board_betaflight_TCMM-TCMMF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.880153 +Generated on: 2024-05-14 03:27:32.173319 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TCMMF411 @@ -25,42 +25,82 @@ Manufacturer ID: TCMM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TCMM-TCMMF7.h b/src/madflight_board_betaflight_TCMM-TCMMF7.h index 791b31a..06aea8f 100644 --- a/src/madflight_board_betaflight_TCMM-TCMMF7.h +++ b/src/madflight_board_betaflight_TCMM-TCMMF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.886152 +Generated on: 2024-05-14 03:27:32.174464 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TCMMF7 @@ -24,42 +24,82 @@ Manufacturer ID: TCMM #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TEBS-COLIBRI.h b/src/madflight_board_betaflight_TEBS-COLIBRI.h index 7dbfdb2..cc34012 100644 --- a/src/madflight_board_betaflight_TEBS-COLIBRI.h +++ b/src/madflight_board_betaflight_TEBS-COLIBRI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.891152 +Generated on: 2024-05-14 03:27:32.175494 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: COLIBRI @@ -24,42 +24,82 @@ Manufacturer ID: TEBS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PC0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC0 +#endif //BARO/MAG I2C: (I2C3) -const int HW_PIN_I2C_SDA = PA8; -const int HW_PIN_I2C_SCL = PC9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PA8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PC9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB4,PB1,PB15,PB5,PB14,PB8,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB4,PB1,PB15,PB5,PB14,PB8,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = PB2; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER PB2 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = -1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V -1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB4,PB1,PB15,PB5,PB14,PB8,PB9} - //other pins #define HW_PIN_BEEPER PC5 #define HW_PIN_PPM PA10 diff --git a/src/madflight_board_betaflight_TEBS-PODRACERAIO.h b/src/madflight_board_betaflight_TEBS-PODRACERAIO.h index 6fa17a8..39e321b 100644 --- a/src/madflight_board_betaflight_TEBS-PODRACERAIO.h +++ b/src/madflight_board_betaflight_TEBS-PODRACERAIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.897153 +Generated on: 2024-05-14 03:27:32.176009 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: PODRACERAIO @@ -22,42 +22,82 @@ Manufacturer ID: TEBS #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB6,PB7} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL) -const int HW_PIN_GPS_RX = -1; -const int HW_PIN_GPS_TX = -1; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX -1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX -1 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = PA4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMH7.h b/src/madflight_board_betaflight_TMTR-TMH7.h index 00a0015..412ee4e 100644 --- a/src/madflight_board_betaflight_TMTR-TMH7.h +++ b/src/madflight_board_betaflight_TMTR-TMH7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.903153 +Generated on: 2024-05-14 03:27:32.177066 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMH7 @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = -1; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED -1 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} - //other pins #define HW_PIN_BEEPER PE3 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF4.h b/src/madflight_board_betaflight_TMTR-TMOTORF4.h index bc83e39..6d3cebd 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF4.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.907188 +Generated on: 2024-05-14 03:27:32.178100 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF4 @@ -25,42 +25,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB6,PB7,PB8,PB9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB6,PB7,PB8,PB9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC14; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC14 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB6,PB7,PB8,PB9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA8 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF411.h b/src/madflight_board_betaflight_TMTR-TMOTORF411.h index f08461d..28cf37b 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF411.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.913171 +Generated on: 2024-05-14 03:27:32.179134 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF411 @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PA0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF4SX1280.h b/src/madflight_board_betaflight_TMTR-TMOTORF4SX1280.h index 46b9c88..593b9ac 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF4SX1280.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF4SX1280.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.919171 +Generated on: 2024-05-14 03:27:32.180165 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF4SX1280 @@ -34,42 +34,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL2) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL) -const int HW_PIN_GPS_RX = -1; -const int HW_PIN_GPS_TX = -1; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX -1 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX -1 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PA0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -90,10 +130,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF7.h b/src/madflight_board_betaflight_TMTR-TMOTORF7.h index 7153b77..2ef6a20 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF7.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.925153 +Generated on: 2024-05-14 03:27:32.181276 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF7 @@ -27,42 +27,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA15 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF722SE.h b/src/madflight_board_betaflight_TMTR-TMOTORF722SE.h index 631058d..1baf02a 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF722SE.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF722SE.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.931162 +Generated on: 2024-05-14 03:27:32.182295 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF722SE @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF7V2.h b/src/madflight_board_betaflight_TMTR-TMOTORF7V2.h index 0b42f89..91e6f8c 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF7V2.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.935167 +Generated on: 2024-05-14 03:27:32.183328 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF7V2 @@ -27,42 +27,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PB1,PB4,PB5,PB6,PB7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB4,PB5,PB6,PB7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PB1,PB4,PB5,PB6,PB7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORF7_AIO.h b/src/madflight_board_betaflight_TMTR-TMOTORF7_AIO.h index 92f57b2..b0b3fb3 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORF7_AIO.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORF7_AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.939662 +Generated on: 2024-05-14 03:27:32.184381 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORF7_AIO @@ -25,42 +25,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB2; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB2 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PC6,PC7,PB0,PB1,PB6,PB8,PB7,PC9} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA15 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORH743.h b/src/madflight_board_betaflight_TMTR-TMOTORH743.h index fc503d3..e420bd2 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORH743.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORH743.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.944675 +Generated on: 2024-05-14 03:27:32.185433 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORH743 @@ -28,42 +28,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PE5; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PE5 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PD6; -const int HW_PIN_GPS_TX = PD5; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PD6 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PD5 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB6,PB7}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1,PC8,PC9} - //other pins #define HW_PIN_BEEPER PE3 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_TMTR-TMOTORVELOXF7V2.h b/src/madflight_board_betaflight_TMTR-TMOTORVELOXF7V2.h index c86c55e..c69c76e 100644 --- a/src/madflight_board_betaflight_TMTR-TMOTORVELOXF7V2.h +++ b/src/madflight_board_betaflight_TMTR-TMOTORVELOXF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.949661 +Generated on: 2024-05-14 03:27:32.186496 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMOTORVELOXF7V2 @@ -25,42 +25,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PB2; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PA15,PB3,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_TMTR-TMPACERF7.h b/src/madflight_board_betaflight_TMTR-TMPACERF7.h index f8e1d41..ffb350f 100644 --- a/src/madflight_board_betaflight_TMTR-TMPACERF7.h +++ b/src/madflight_board_betaflight_TMTR-TMPACERF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.954663 +Generated on: 2024-05-14 03:27:32.187013 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMPACERF7 @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PC9,PC8,PB0,PB1,PB7,PB6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PB0,PB1,PB7,PB6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PC9,PC8,PB0,PB1,PB7,PB6} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_TMTR-TMPACERF7MINI.h b/src/madflight_board_betaflight_TMTR-TMPACERF7MINI.h index 3d0f65b..61727cc 100644 --- a/src/madflight_board_betaflight_TMTR-TMPACERF7MINI.h +++ b/src/madflight_board_betaflight_TMTR-TMPACERF7MINI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.958664 +Generated on: 2024-05-14 03:27:32.188050 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMPACERF7MINI @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC4; -const int HW_PIN_IMU_EXTI = PA4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC9,PC8,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC9,PC8,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC9,PC8,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_TMTR-TMVELOXF411.h b/src/madflight_board_betaflight_TMTR-TMVELOXF411.h index 2728347..73206ba 100644 --- a/src/madflight_board_betaflight_TMTR-TMVELOXF411.h +++ b/src/madflight_board_betaflight_TMTR-TMVELOXF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.963663 +Generated on: 2024-05-14 03:27:32.189087 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMVELOXF411 @@ -23,42 +23,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC15; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC15 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA1; -const int HW_PIN_BAT_I = PA0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TMTR-TMVELOXF7.h b/src/madflight_board_betaflight_TMTR-TMVELOXF7.h index 16ec832..1435ba7 100644 --- a/src/madflight_board_betaflight_TMTR-TMVELOXF7.h +++ b/src/madflight_board_betaflight_TMTR-TMVELOXF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.969168 +Generated on: 2024-05-14 03:27:32.189603 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TMVELOXF7 @@ -24,42 +24,82 @@ Manufacturer ID: TMTR #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB1,PB4,PB3,PA15,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB1,PB4,PB3,PA15,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB1,PB4,PB3,PA15,PC8,PC9} - //other pins #define HW_PIN_BEEPER PC14 #define HW_PIN_PPM PC6 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF405HD.h b/src/madflight_board_betaflight_TTRH-TRANSTECF405HD.h index 611140f..cb66309 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF405HD.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF405HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.975186 +Generated on: 2024-05-14 03:27:32.190666 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF405HD @@ -20,42 +20,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PC6,PC7,PC8,PC9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PC6,PC7,PC8,PC9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB8; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB8 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC5; -const int HW_PIN_BAT_I = PC4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC5 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PC6,PC7,PC8,PC9} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB6 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF411.h b/src/madflight_board_betaflight_TTRH-TRANSTECF411.h index 2dafe16..9bf491c 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF411.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.981172 +Generated on: 2024-05-14 03:27:32.191785 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF411 @@ -22,42 +22,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB10,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB10,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC13; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC13 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PB4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB10,PB9} - //other pins #define HW_PIN_BEEPER PB6 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF411AIO.h b/src/madflight_board_betaflight_TTRH-TRANSTECF411AIO.h index 61037bb..55611ce 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF411AIO.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF411AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.986172 +Generated on: 2024-05-14 03:27:32.192291 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF411AIO @@ -20,42 +20,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7,PB3,PB10}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7,PB3,PB10} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PA14; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PA14 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7,PB3,PB10} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF411HD.h b/src/madflight_board_betaflight_TTRH-TRANSTECF411HD.h index e11682b..82dd3d4 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF411HD.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF411HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.991174 +Generated on: 2024-05-14 03:27:32.193859 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF411HD @@ -21,42 +21,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB0,PB1,PB10,PB9}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PB10,PB9} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PC13; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC13 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PB4; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB4 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -77,10 +117,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB0,PB1,PB10,PB9} - //other pins #define HW_PIN_BEEPER PB6 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF7.h b/src/madflight_board_betaflight_TTRH-TRANSTECF7.h index e636069..d337519 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF7.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:44.996184 +Generated on: 2024-05-14 03:27:32.194901 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF7 @@ -23,42 +23,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PC6,PC7,PB3,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC6,PC7,PB3,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PC6,PC7,PB3,PB4} - //other pins #define HW_PIN_CAMERA_CONTROL PB8 #define HW_PIN_LED_STRIP PA15 diff --git a/src/madflight_board_betaflight_TTRH-TRANSTECF7HD.h b/src/madflight_board_betaflight_TTRH-TRANSTECF7HD.h index c06b8dd..061e1a6 100644 --- a/src/madflight_board_betaflight_TTRH-TRANSTECF7HD.h +++ b/src/madflight_board_betaflight_TTRH-TRANSTECF7HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.002175 +Generated on: 2024-05-14 03:27:32.196361 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TRANSTECF7HD @@ -23,42 +23,82 @@ Manufacturer ID: TTRH #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PC2; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PC2 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PB1,PC6,PC7,PB3,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PB1,PC6,PC7,PB3,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB6,PB7} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PB1,PC6,PC7,PB3,PB4} - //other pins #define HW_PIN_LED_STRIP PA15 //#define HW_PIN_LED PA14 diff --git a/src/madflight_board_betaflight_TURC-FPVCYCLEF401.h b/src/madflight_board_betaflight_TURC-FPVCYCLEF401.h index 83781be..33c75e0 100644 --- a/src/madflight_board_betaflight_TURC-FPVCYCLEF401.h +++ b/src/madflight_board_betaflight_TURC-FPVCYCLEF401.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.010187 +Generated on: 2024-05-14 03:27:32.197392 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: FPVCYCLEF401 @@ -22,42 +22,82 @@ Manufacturer ID: TURC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB4,PB5,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB4,PB5,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_TURC-TUNERCF405.h b/src/madflight_board_betaflight_TURC-TUNERCF405.h index d19f348..fe69cbf 100644 --- a/src/madflight_board_betaflight_TURC-TUNERCF405.h +++ b/src/madflight_board_betaflight_TURC-TUNERCF405.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.015173 +Generated on: 2024-05-14 03:27:32.198636 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TUNERCF405 @@ -23,42 +23,82 @@ Manufacturer ID: TURC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB9; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB9 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB0,PA8,PB8,PA15,PC9,PC8,PC7,PC6}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PA8,PB8,PA15,PC9,PC8,PC7,PC6} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB0,PA8,PB8,PA15,PC9,PC8,PC7,PC6} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_TURC-TUNERCF411.h b/src/madflight_board_betaflight_TURC-TUNERCF411.h index 30f0c78..16f51ab 100644 --- a/src/madflight_board_betaflight_TURC-TUNERCF411.h +++ b/src/madflight_board_betaflight_TURC-TUNERCF411.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.020172 +Generated on: 2024-05-14 03:27:32.199671 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: TUNERCF411 @@ -23,42 +23,82 @@ Manufacturer ID: TURC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PA1; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PA1 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB7,PB6,PB5,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB5,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB0; -const int HW_PIN_BAT_I = PB1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -79,10 +119,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB7,PB6,PB5,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_VGRC-VGOODF722DUAL.h b/src/madflight_board_betaflight_VGRC-VGOODF722DUAL.h index 84c9314..6290c10 100644 --- a/src/madflight_board_betaflight_VGRC-VGOODF722DUAL.h +++ b/src/madflight_board_betaflight_VGRC-VGOODF722DUAL.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.026172 +Generated on: 2024-05-14 03:27:32.200718 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VGOODF722DUAL @@ -24,42 +24,82 @@ Manufacturer ID: VGRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PA13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PA13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PC12; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PC12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB4,PB5,PB0,PB1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB4,PB5,PB0,PB1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB4,PB5,PB0,PB1,PB6,PB7} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PA3 diff --git a/src/madflight_board_betaflight_VGRC-VGOODRCF4.h b/src/madflight_board_betaflight_VGRC-VGOODRCF4.h index 454a45d..95ced1b 100644 --- a/src/madflight_board_betaflight_VGRC-VGOODRCF4.h +++ b/src/madflight_board_betaflight_VGRC-VGOODRCF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.032173 +Generated on: 2024-05-14 03:27:32.201747 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VGOODRCF4 @@ -25,42 +25,82 @@ Manufacturer ID: VGRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC3; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC3 +#endif //BARO/MAG I2C: (I2C2) -const int HW_PIN_I2C_SDA = PB10; -const int HW_PIN_I2C_SCL = PB11; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB10 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB11 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PA8,PA9,PA10,PC8,PC9,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA8,PA9,PA10,PC8,PC9,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC0; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC0 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {2,PB10,PB11} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PA8,PA9,PA10,PC8,PC9,PB0,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PC7 diff --git a/src/madflight_board_betaflight_VGRC-VGOODRCF405_DJI.h b/src/madflight_board_betaflight_VGRC-VGOODRCF405_DJI.h index ba0e39f..77c045d 100644 --- a/src/madflight_board_betaflight_VGRC-VGOODRCF405_DJI.h +++ b/src/madflight_board_betaflight_VGRC-VGOODRCF405_DJI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.037178 +Generated on: 2024-05-14 03:27:32.202788 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VGOODRCF405_DJI @@ -24,42 +24,82 @@ Manufacturer ID: VGRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = PC0; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PC0 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -80,10 +120,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_VGRC-VGOODRCF411_DJI.h b/src/madflight_board_betaflight_VGRC-VGOODRCF411_DJI.h index 90e2ddc..135ac65 100644 --- a/src/madflight_board_betaflight_VGRC-VGOODRCF411_DJI.h +++ b/src/madflight_board_betaflight_VGRC-VGOODRCF411_DJI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.043172 +Generated on: 2024-05-14 03:27:32.203840 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VGOODRCF411_DJI @@ -20,42 +20,82 @@ Manufacturer ID: VGRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB0; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB0 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB3,PB4,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB3,PB4,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB10; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB10 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PA0; -const int HW_PIN_BAT_I = PA1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PA0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PA1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB3,PB4,PB6,PB7} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_VGRC-VGOODRCF722_DJI.h b/src/madflight_board_betaflight_VGRC-VGOODRCF722_DJI.h index b6b7e52..bcf35e9 100644 --- a/src/madflight_board_betaflight_VGRC-VGOODRCF722_DJI.h +++ b/src/madflight_board_betaflight_VGRC-VGOODRCF722_DJI.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.048172 +Generated on: 2024-05-14 03:27:32.204364 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VGOODRCF722_DJI @@ -20,42 +20,82 @@ Manufacturer ID: VGRC #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC15; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC15 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA9,PA8,PC9,PC8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA9,PA8,PC9,PC8} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PB6; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PB6 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -76,10 +116,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA9,PA8,PC9,PC8} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PB9 diff --git a/src/madflight_board_betaflight_VIVA-VIVAF4AIO.h b/src/madflight_board_betaflight_VIVA-VIVAF4AIO.h index abb754f..8a05525 100644 --- a/src/madflight_board_betaflight_VIVA-VIVAF4AIO.h +++ b/src/madflight_board_betaflight_VIVA-VIVAF4AIO.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.052922 +Generated on: 2024-05-14 03:27:32.205947 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: VIVAF4AIO @@ -25,42 +25,82 @@ Manufacturer ID: VIVA #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PB0,PC6,PA10,PA8,PC8,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB0,PC6,PA10,PA8,PC8,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PB7; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PB7 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PB0,PC6,PA10,PA8,PC8,PB1} - //other pins #define HW_PIN_BEEPER PC13 #define HW_PIN_PPM PB15 diff --git a/src/madflight_board_betaflight_WIZZ-WIZZF7HD.h b/src/madflight_board_betaflight_WIZZ-WIZZF7HD.h index afe4217..b4a6ddf 100644 --- a/src/madflight_board_betaflight_WIZZ-WIZZF7HD.h +++ b/src/madflight_board_betaflight_WIZZ-WIZZF7HD.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.057927 +Generated on: 2024-05-14 03:27:32.206876 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: WIZZF7HD @@ -22,42 +22,82 @@ Manufacturer ID: WIZZ #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB0; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB0 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 7; -const int HW_PIN_OUT[] = {PB9,PB8,PB7,PB6,PA8,PC8,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 7 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB9,PB8,PB7,PB6,PA8,PC8,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 7 -#define HW_MOTOR_OUT {PB9,PB8,PB7,PB6,PA8,PC8,PB1} - //other pins #define HW_PIN_BEEPER PB4 #define HW_PIN_LED_STRIP PB1 diff --git a/src/madflight_board_betaflight_YUPF-YUPIF4.h b/src/madflight_board_betaflight_YUPF-YUPIF4.h index f5fbc16..389c402 100644 --- a/src/madflight_board_betaflight_YUPF-YUPIF4.h +++ b/src/madflight_board_betaflight_YUPF-YUPIF4.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.062926 +Generated on: 2024-05-14 03:27:32.207928 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: YUPIF4 @@ -25,42 +25,82 @@ Manufacturer ID: YUPF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB6; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB6 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = PB12; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER PB12 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB7} - //other pins #define HW_PIN_BEEPER PC9 #define HW_PIN_PPM PC8 diff --git a/src/madflight_board_betaflight_YUPF-YUPIF7.h b/src/madflight_board_betaflight_YUPF-YUPIF7.h index 5369e5a..be17cb2 100644 --- a/src/madflight_board_betaflight_YUPF-YUPIF7.h +++ b/src/madflight_board_betaflight_YUPF-YUPIF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.067926 +Generated on: 2024-05-14 03:27:32.208711 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: YUPIF7 @@ -26,42 +26,82 @@ Manufacturer ID: YUPF #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PB4; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PB4 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[] = {PA0,PA1,PA2,PA3,PB0,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PA2,PA3,PB0,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB11; -const int HW_PIN_GPS_TX = PB10; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB11 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PB10 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC1; -const int HW_PIN_BAT_I = PC2; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC2 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -82,10 +122,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 6 -#define HW_MOTOR_OUT {PA0,PA1,PA2,PA3,PB0,PB1} - //other pins #define HW_PIN_BEEPER PB14 #define HW_PIN_PPM PC8 diff --git a/src/madflight_board_betaflight_ZEEZ-ZEEZF7.h b/src/madflight_board_betaflight_ZEEZ-ZEEZF7.h index e32f1e2..5e2cadf 100644 --- a/src/madflight_board_betaflight_ZEEZ-ZEEZF7.h +++ b/src/madflight_board_betaflight_ZEEZ-ZEEZF7.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.072433 +Generated on: 2024-05-14 03:27:32.209767 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEEZF7 @@ -25,42 +25,82 @@ Manufacturer ID: ZEEZ #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI2) -const int HW_PIN_SPI_MISO = PB14; -const int HW_PIN_SPI_MOSI = PB15; -const int HW_PIN_SPI_SCLK = PB13; -const int HW_PIN_IMU_CS = PB12; -const int HW_PIN_IMU_EXTI = PC9; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB14 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB15 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PB12 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC9 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = -1; -const int HW_PIN_I2C_SCL = -1; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA -1 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL -1 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PB8,PB7,PB6,PB4}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB8,PB7,PB6,PB4} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC2; -const int HW_PIN_BAT_I = PC3; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC3 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -81,10 +121,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 0 #define HW_PIN_I2C { } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PB8,PB7,PB6,PB4} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_PPM PA1 diff --git a/src/madflight_board_betaflight_ZEEZ-ZEEZF7V2.h b/src/madflight_board_betaflight_ZEEZ-ZEEZF7V2.h index ee52f76..a9e59d0 100644 --- a/src/madflight_board_betaflight_ZEEZ-ZEEZF7V2.h +++ b/src/madflight_board_betaflight_ZEEZ-ZEEZF7V2.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.078432 +Generated on: 2024-05-14 03:27:32.210796 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEEZF7V2 @@ -27,42 +27,82 @@ Manufacturer ID: ZEEZ #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PC4; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA6 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC4 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB7,PB6,PB4,PB3,PC8,PC7,PC6,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB4,PB3,PC8,PC7,PC6,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -83,10 +123,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB7,PB6,PB4,PB3,PC8,PC7,PC6,PB1} - //other pins #define HW_PIN_BEEPER PB2 #define HW_PIN_LED_STRIP PB0 diff --git a/src/madflight_board_betaflight_ZEEZ-ZEEZF7V3.h b/src/madflight_board_betaflight_ZEEZ-ZEEZF7V3.h index 2cfc32e..73875e9 100644 --- a/src/madflight_board_betaflight_ZEEZ-ZEEZF7V3.h +++ b/src/madflight_board_betaflight_ZEEZ-ZEEZF7V3.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.083433 +Generated on: 2024-05-14 03:27:32.211839 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEEZF7V3 @@ -28,42 +28,82 @@ Manufacturer ID: ZEEZ #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC14; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC14 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PC11; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PC10; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PC13; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PC11 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PC10 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PC13 +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 8; -const int HW_PIN_OUT[] = {PB7,PB6,PB4,PB3,PC6,PC7,PC8,PB1}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 8 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB7,PB6,PB4,PB3,PC6,PC7,PC8,PB1} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PC0; -const int HW_PIN_BAT_I = PC1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PC0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PC1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -84,10 +124,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 2 #define HW_PIN_I2C { {1,PB8,PB9}, {3,PA8,PC9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 8 -#define HW_MOTOR_OUT {PB7,PB6,PB4,PB3,PC6,PC7,PC8,PB1} - //other pins #define HW_PIN_BEEPER PC4 #define HW_PIN_LED_STRIP PB0 diff --git a/src/madflight_board_betaflight_ZEEZ-ZEEZWHOOP.h b/src/madflight_board_betaflight_ZEEZ-ZEEZWHOOP.h index ad2b512..e28a1d6 100644 --- a/src/madflight_board_betaflight_ZEEZ-ZEEZWHOOP.h +++ b/src/madflight_board_betaflight_ZEEZ-ZEEZWHOOP.h @@ -1,5 +1,5 @@ /*============================================================================== -Generated on: 2024-03-11 20:33:45.089433 +Generated on: 2024-05-14 03:27:32.212881 Generated by: betaflight_target_converter.py Source: https://github.com/betaflight/unified-targets Board name: ZEEZWHOOP @@ -22,42 +22,82 @@ Manufacturer ID: ZEEZ #define MAG_I2C_ADR 0 //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_PIN_LED + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: (SPI3) -const int HW_PIN_SPI_MISO = PB4; -const int HW_PIN_SPI_MOSI = PB5; -const int HW_PIN_SPI_SCLK = PB3; -const int HW_PIN_IMU_CS = PA15; -const int HW_PIN_IMU_EXTI = PNONE; +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PB4 +#endif +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PB5 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PB3 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PNONE +#endif //BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB8; -const int HW_PIN_I2C_SCL = PB9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB9 +#endif //Outputs: -const int HW_OUT_COUNT = 4; -const int HW_PIN_OUT[] = {PA0,PA1,PB6,PB7}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 4 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PA0,PA1,PB6,PB7} +#endif //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA10; -const int HW_PIN_RCIN_TX = PA9; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA10 +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA9 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL2) -const int HW_PIN_GPS_RX = PA3; -const int HW_PIN_GPS_TX = PA2; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PA3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA2 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif //Battery ADC voltage and current inputs: -const int HW_PIN_BAT_V = PB1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries -#include //I2C communication -#include //SPI communication -#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot +#include //I2C communication +#include //SPI communication +#include "madflight/hw_STM32/STM32_PWM.h" //Servo and oneshot //Bus Setup HardwareSerial *rcin_Serial = new HardwareSerial(HW_PIN_RCIN_RX, HW_PIN_RCIN_TX); @@ -78,10 +118,6 @@ SPIClass *spi = &SPI; #define HW_I2C_COUNT 1 #define HW_PIN_I2C { {1,PB8,PB9} } // {INDEX,SCL,SDA} -//Motors: -#define HW_MOTOR_COUNT 4 -#define HW_MOTOR_OUT {PA0,PA1,PB6,PB7} - //other pins #define HW_PIN_PPM PA3 #define HW_PIN_LED_STRIP PA8 diff --git a/src/madflight_board_default_ESP32-S3.h b/src/madflight_board_default_ESP32-S3.h index f41315e..377a4e0 100644 --- a/src/madflight_board_default_ESP32-S3.h +++ b/src/madflight_board_default_ESP32-S3.h @@ -32,41 +32,87 @@ Programming/debugging: //NOTE: DON'T USE SAME PIN TWICE. All pins here get configured, even if they are not used. Set pin to -1 to disable. //LED: -const int HW_PIN_LED = 38; //Note: plus RGB_LED on pin 48, some versions have RGB_LED on pin 38 and no LED -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_OUT_COUNT + #define HW_PIN_LED 38 //Note: plus RGB_LED on pin 48, some versions have RGB_LED on pin 38 and no LED +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: -const int HW_PIN_SPI_MOSI = 11; -const int HW_PIN_SPI_MISO = 12; -const int HW_PIN_SPI_SCLK = 13; -const int HW_PIN_IMU_CS = 10; -const int HW_PIN_IMU_EXTI = 14; +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI 11 +#endif +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO 12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK 13 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS 10 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI 14 +#endif //BARO/MAG I2C: -const int HW_PIN_I2C_SDA = 8; -const int HW_PIN_I2C_SCL = 9; +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA 8 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL 9 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[HW_OUT_COUNT] = {4,5,6,7,15,16}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {4,5,6,7,15,16} +#endif + +//Serial Debug on tx0 (pin 1), rx0 (pin 3) connected to serial->USB converter //RC Receiver: -const int HW_PIN_RCIN_RX = 18; //also used as PPM input -const int HW_PIN_RCIN_TX = 17; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX 18 //also used as PPM input +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX 17 +#endif //GPS: -const int HW_PIN_GPS_RX = 3; -const int HW_PIN_GPS_TX = 46; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX 3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX 46 +#endif //Battery ADC -const int HW_PIN_BAT_V = -1; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V -1 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif //BlackBox SPI: -const int HW_PIN_SPI2_MISO = -1; -const int HW_PIN_SPI2_MOSI = -1; -const int HW_PIN_SPI2_SCLK = -1; -const int HW_PIN_BB_CS = -1; +#ifndef HW_PIN_SPI2_MISO + #define HW_PIN_SPI2_MISO -1 +#endif +#ifndef HW_PIN_SPI2_MOSI + #define HW_PIN_SPI2_MOSI -1 +#endif +#ifndef HW_PIN_SPI2_SCLK + #define HW_PIN_SPI2_SCLK -1 +#endif +#ifndef HW_PIN_BB_CS + #define HW_PIN_BB_CS -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; /*-------------------------------------------------------------------------------------------------- diff --git a/src/madflight_board_default_ESP32.h b/src/madflight_board_default_ESP32.h index f016949..bd42923 100644 --- a/src/madflight_board_default_ESP32.h +++ b/src/madflight_board_default_ESP32.h @@ -6,44 +6,87 @@ //NOTE: DON'T USE SAME PIN TWICE. All pins here get configured, even if they are not used. Set pin to -1 to disable. //LED: -const int HW_PIN_LED = 2; //Note: ESP32 DevKitC has no on-board LED -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_OUT_COUNT + #define HW_PIN_LED 2 //Note: ESP32 DevKitC has no on-board LED +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: -const int HW_PIN_SPI_MOSI = 21; // defaults: VSPI 23, HSPI 13 -const int HW_PIN_SPI_MISO = 36; //VP defaults: VSPI 19, HSPI 12 -const int HW_PIN_SPI_SCLK = 19; // defaults: VSPI 18, HSPI 14 -const int HW_PIN_IMU_CS = 18; // defaults: VSPI 5, HSPI 15 -const int HW_PIN_IMU_EXTI = 39; //VN only used when USE_IMU_INTERRUPT is defined +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI 21 // defaults: VSPI 23, HSPI 13 +#endif +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO 36 //VP defaults: VSPI 19, HSPI 12 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK 19 // defaults: VSPI 18, HSPI 14 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS 18 // defaults: VSPI 5, HSPI 15 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI 39 //VN only used when USE_IMU_INTERRUPT is defined +#endif //BARO/MAG I2C: -const int HW_PIN_I2C_SDA = 23; //default: Wire 21 -const int HW_PIN_I2C_SCL = 22; //default: Wire 22 +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA 23 //default: Wire 21 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL 22 //default: Wire 22 +#endif //Outputs: -const int HW_OUT_COUNT = 11; -const int HW_PIN_OUT[HW_OUT_COUNT] = {33,25,26,27,14,12,13,15,0,4,16}; //for ESP32 it is recommended to use only pins 2,4,12-19,21-23,25-27,32-33 for motors/servos +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 11 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {33,25,26,27,14,12,13,15,0,4,16} //for ESP32 it is recommended to use only pins 2,4,12-19,21-23,25-27,32-33 for motors/servos +#endif //Serial Debug on tx0 (pin 1), rx0 (pin 3) connected to serial->USB converter //RC Receiver: -const int HW_PIN_RCIN_RX = 35; //also used as PPM input -const int HW_PIN_RCIN_TX = 32; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX 5 //also used as PPM input +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX 32 +#endif //GPS: -const int HW_PIN_GPS_RX = 17; -const int HW_PIN_GPS_TX = 5; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX 17 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX 5 +#endif //Battery ADC -const int HW_PIN_BAT_V = 34; -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V 34 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif //BlackBox SPI: -const int HW_PIN_SPI2_MISO = -1; -const int HW_PIN_SPI2_MOSI = -1; -const int HW_PIN_SPI2_SCLK = -1; -const int HW_PIN_BB_CS = -1; +#ifndef HW_PIN_SPI2_MISO + #define HW_PIN_SPI2_MISO -1 +#endif +#ifndef HW_PIN_SPI2_MOSI + #define HW_PIN_SPI2_MOSI -1 +#endif +#ifndef HW_PIN_SPI2_SCLK + #define HW_PIN_SPI2_SCLK -1 +#endif +#ifndef HW_PIN_BB_CS + #define HW_PIN_BB_CS -1 +#endif +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; /*-------------------------------------------------------------------------------------------------- diff --git a/src/madflight_board_default_RP2040.h b/src/madflight_board_default_RP2040.h index e32d34b..97011f1 100644 --- a/src/madflight_board_default_RP2040.h +++ b/src/madflight_board_default_RP2040.h @@ -9,43 +9,87 @@ //NOTE: DON'T USE SAME PIN TWICE. All pins here get configured, even if they are not used. Set pin to -1 to disable. //LED: -const int HW_PIN_LED = 25; //internal on Raspberry Pi Pico -const int HW_LED_ON = 1; //0:low is on, 1:high is on +#ifndef HW_OUT_COUNT + #define HW_PIN_LED 25 //internal on Raspberry Pi Pico +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 1 //0:low is on, 1:high is on +#endif //IMU SPI: -const int HW_PIN_SPI_MISO = 16; //spi0: 0, 4, 16(default) spi1: 8, 12(default) -const int HW_PIN_SPI_MOSI = 19; //spi0: 3, 7, 19(default) spi1: 11, 15(default) -const int HW_PIN_SPI_SCLK = 18; //spi0: 2, 6, 18(default) spi1: 10, 14(default) -const int HW_PIN_IMU_CS = 17; //spi0: 1, 5, 17(default) spi1: 9, 13(default) -const int HW_PIN_IMU_EXTI = 22; //only used when USE_IMU_INTERRUPT is defined - -//I2C: -const int HW_PIN_I2C_SDA = 20; //Wire: 0, 4(default), 8, 12, 16, 20 Wire1: 2, 6, 10, 14, 18, 26(default) -const int HW_PIN_I2C_SCL = 21; //Wire: 1, 5(default), 9, 13, 17, 21 Wire1: 3, 7, 11, 15, 19, 27(default) +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI 16 //spi0: 0, 4, 16(default) spi1: 8, 12(default) +#endif +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO 19 //spi0: 3, 7, 19(default) spi1: 11, 15(default) +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK 18 //spi0: 2, 6, 18(default) spi1: 10, 14(default) +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS 17 //spi0: 1, 5, 17(default) spi1: 9, 13(default) +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI 22 //only used when USE_IMU_INTERRUPT is defined +#endif + +//BARO/MAG I2C: +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA 20 //Wire: 0, 4(default), 8, 12, 16, 20 Wire1: 2, 6, 10, 14, 18, 26(default) +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL 21 //Wire: 1, 5(default), 9, 13, 17, 21 Wire1: 3, 7, 11, 15, 19, 27(default) +#endif //Outputs: -const int HW_OUT_COUNT = 12; -const int HW_PIN_OUT[HW_OUT_COUNT] = {2,3,4,5,6,7,10,11,12,13,14,15}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 12 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {2,3,4,5,6,7,10,11,12,13,14,15} +#endif //Serial debug on USB Serial port (no GPIO pins) //RC Receiver: -const int HW_PIN_RCIN_RX = 1; //uart0: 1(default), 5, 13, 17 uart1: 5, 9(default) , this pin is also used as PPM input -const int HW_PIN_RCIN_TX = 0; //uart0: 0(default), 4, 12, 16 uart1: 4, 8(default) +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX 1 //uart0: 1(default), 5, 13, 17 uart1: 5, 9(default) , this pin is also used as PPM input +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX 0 //uart0: 0(default), 4, 12, 16 uart1: 4, 8(default) +#endif //GPS: -const int HW_PIN_GPS_RX = 9; //uart0: 1(default), 5, 13, 17 uart1: 5, 9(default) -const int HW_PIN_GPS_TX = 8; //uart0: 0(default), 4, 12, 16 uart1: 4, 8(default) +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX 9 //uart0: 1(default), 5, 13, 17 uart1: 5, 9(default) +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX 8 //uart0: 0(default), 4, 12, 16 uart1: 4, 8(default) +#endif //Battery ADC -const int HW_PIN_BAT_V = 28; //pin A2 -const int HW_PIN_BAT_I = -1; +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V 28 //pin A2 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I -1 +#endif //BlackBox SPI: -const int HW_PIN_SPI2_MISO = -1; -const int HW_PIN_SPI2_MOSI = -1; -const int HW_PIN_SPI2_SCLK = -1; -const int HW_PIN_BB_CS = -1; +#ifndef HW_PIN_SPI2_MISO + #define HW_PIN_SPI2_MISO -1 +#endif +#ifndef HW_PIN_SPI2_MOSI + #define HW_PIN_SPI2_MOSI -1 +#endif +#ifndef HW_PIN_SPI2_SCLK + #define HW_PIN_SPI2_SCLK -1 +#endif +#ifndef HW_PIN_BB_CS + #define HW_PIN_BB_CS -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //------------------------------------- //Include Libraries diff --git a/src/madflight_board_default_STM32.h b/src/madflight_board_default_STM32.h index 34d2d45..d9f2597 100644 --- a/src/madflight_board_default_STM32.h +++ b/src/madflight_board_default_STM32.h @@ -20,43 +20,93 @@ //NOTE: DON'T USE SAME PIN TWICE. All pins here get configured, even if they are not used. Set pin to -1 to disable. //LED: -const int HW_PIN_LED = PC13; -const int HW_LED_ON = 0; //0:low is on, 1:high is on +#ifndef HW_OUT_COUNT + #define HW_PIN_LED PC13 +#endif +#ifndef HW_LED_ON + #define HW_LED_ON 0 //0:low is on, 1:high is on +#endif -//IMU SPI: (SPI1) -const int HW_PIN_SPI_MISO = PA6; -const int HW_PIN_SPI_MOSI = PA7; -const int HW_PIN_SPI_SCLK = PA5; -const int HW_PIN_IMU_CS = PA4; -const int HW_PIN_IMU_EXTI = PB10; +//IMU SPI: +#ifndef HW_PIN_SPI_MOSI + #define HW_PIN_SPI_MOSI PA6 +#endif +#ifndef HW_PIN_SPI_MISO + #define HW_PIN_SPI_MISO PA7 +#endif +#ifndef HW_PIN_SPI_SCLK + #define HW_PIN_SPI_SCLK PA5 +#endif +#ifndef HW_PIN_IMU_CS + #define HW_PIN_IMU_CS PA4 +#endif +#ifndef HW_PIN_IMU_EXTI + #define HW_PIN_IMU_EXTI PB10 +#endif -//BARO/MAG I2C: (I2C1) -const int HW_PIN_I2C_SDA = PB6; -const int HW_PIN_I2C_SCL = PB7; +//BARO/MAG I2C: +#ifndef HW_PIN_I2C_SDA + #define HW_PIN_I2C_SDA PB6 +#endif +#ifndef HW_PIN_I2C_SCL + #define HW_PIN_I2C_SCL PB7 +#endif //Outputs: -const int HW_OUT_COUNT = 6; -const int HW_PIN_OUT[HW_OUT_COUNT] = {PB2,PB5,PA8,PA9,PA10,PB8}; +#ifndef HW_OUT_COUNT + #define HW_OUT_COUNT 6 +#endif +#ifndef HW_PIN_OUT_LIST + #define HW_PIN_OUT_LIST {PB2,PB5,PA8,PA9,PA10,PB8} +#endif + +//Serial Debug on tx0 (pin 1), rx0 (pin 3) connected to serial->USB converter //RC Receiver: (SERIAL1) -const int HW_PIN_RCIN_RX = PA3; -const int HW_PIN_RCIN_TX = PA2; -const int HW_PIN_RCIN_INVERTER = -1; +#ifndef HW_PIN_RCIN_RX + #define HW_PIN_RCIN_RX PA3 //also used as PPM input +#endif +#ifndef HW_PIN_RCIN_TX + #define HW_PIN_RCIN_TX PA2 +#endif +#ifndef HW_PIN_RCIN_INVERTER + #define HW_PIN_RCIN_INVERTER -1 +#endif //GPS: (SERIAL3) -const int HW_PIN_GPS_RX = PB3; -const int HW_PIN_GPS_TX = PA15; -const int HW_PIN_GPS_INVERTER = -1; +#ifndef HW_PIN_GPS_RX + #define HW_PIN_GPS_RX PB3 +#endif +#ifndef HW_PIN_GPS_TX + #define HW_PIN_GPS_TX PA15 +#endif +#ifndef HW_PIN_GPS_INVERTER + #define HW_PIN_GPS_INVERTER -1 +#endif -//Battery ADC (uncomment at least one pin to enable the battery monitor) -#define HW_PIN_BAT_V PB0 -#define HW_PIN_BAT_I PB1 +//Battery ADC +#ifndef HW_PIN_BAT_V + #define HW_PIN_BAT_V PB0 +#endif +#ifndef HW_PIN_BAT_I + #define HW_PIN_BAT_I PB1 +#endif //BlackBox SPI: -const int HW_PIN_SPI2_MISO = -1; -const int HW_PIN_SPI2_MOSI = -1; -const int HW_PIN_SPI2_SCLK = -1; -const int HW_PIN_BB_CS = -1; +#ifndef HW_PIN_SPI2_MISO + #define HW_PIN_SPI2_MISO -1 +#endif +#ifndef HW_PIN_SPI2_MOSI + #define HW_PIN_SPI2_MOSI -1 +#endif +#ifndef HW_PIN_SPI2_SCLK + #define HW_PIN_SPI2_SCLK -1 +#endif +#ifndef HW_PIN_BB_CS + #define HW_PIN_BB_CS -1 +#endif + +const int HW_PIN_OUT[] = HW_PIN_OUT_LIST; //Include Libraries #include //I2C communication