/*==============================================================================
Generated on: 2025-06-11 20:35:53.872580
Generated by: betaflight_target_converter.py
Source: https://github.com/betaflight/unified-targets
Board name: MAMBAG4
Manufacturer ID: DIAT

//copy this line to madflight.ino to use this flight controller
#define MF_BOARD "brd/betaflight/DIAT-MAMBAG4.h"

Note: madflight will pick the last sensor defined here, this might not be the sensor that is actually on the board. Comment the offending sensors out, or use madflight_config to override.
==============================================================================*/

#define MF_BOARD_NAME "BETAFLIGHT-DIAT-MAMBAG4"
#define MF_MCU_NAME "STM32G47X"

const char madflight_board[] = R""(
imu_bus_type SPI
bar_gizmo DPS310 // #define USE_BARO_DPS310
imu_gizmo MPU6000 // #define USE_GYRO_SPI_MPU6000
// resource BEEPER 1 A15
pin_out0 PA0 // resource MOTOR 1 A00
pin_out1 PA1 // resource MOTOR 2 A01
pin_out2 PA2 // resource MOTOR 3 A02
pin_out3 PA3 // resource MOTOR 4 A03
pin_ser0_tx PA9 // resource SERIAL_TX 1 A09
pin_ser1_tx PB3 // resource SERIAL_TX 2 B03
pin_ser2_tx PB10 // resource SERIAL_TX 3 B10
pin_ser3_tx PC10 // resource SERIAL_TX 4 C10
pin_ser10_tx PB9 // resource SERIAL_TX 11 B09
pin_ser0_rx PA10 // resource SERIAL_RX 1 A10
pin_ser1_rx PB4 // resource SERIAL_RX 2 B04
pin_ser2_rx PB11 // resource SERIAL_RX 3 B11
pin_ser3_rx PC11 // resource SERIAL_RX 4 C11
pin_i2c0_scl PA13 // resource I2C_SCL 1 A13
pin_i2c0_sda PA14 // resource I2C_SDA 1 A14
pin_led PC15 // resource LED 1 C15
// resource LED 2 C14
pin_bat_v PB2 // resource ADC_BATT 1 B02
bat_gizmo ADC
pin_bat_i PB1 // resource ADC_CURR 1 B01
bat_gizmo ADC
// resource FLASH_CS 1 C06
// resource OSD_CS 1 A08
pin_imu_int PC4 // resource GYRO_EXTI 1 C04
// resource GYRO_EXTI 2 B12
pin_imu_cs PA4 // resource GYRO_CS 1 A04
// resource GYRO_CS 2 B00
// resource LED_STRIP 1 B06
pin_spi0_sclk PA5 // resource SPI_SCK 1 A05
pin_spi0_miso PA6 // resource SPI_MISO 1 A06
pin_spi0_mosi PA7 // resource SPI_MOSI 1 A07
pin_spi1_sclk PB13 // resource SPI_SCK 2 B13
pin_spi1_miso PB14 // resource SPI_MISO 2 B14
pin_spi1_mosi PB15 // resource SPI_MOSI 2 B15
// set baro_bustype = I2C
bar_i2c_bus 0 // set baro_i2c_device = 1
// set blackbox_device = SPIFLASH
// set dshot_burst = ON
// set current_meter = ADC
// set battery_meter = ADC
// set beeper_inversion = ON
// set beeper_od = OFF
// set pid_process_denom = 2
// set max7456_spi_bus = 2
// set flash_spi_bus = 2
imu_spi_bus 0 // set gyro_1_spibus = 1
imu_align CW180 // set gyro_1_sensor_align = CW180
// set gyro_1_align_yaw = 1800
// set gyro_2_spibus = 1
// set gyro_2_sensor_align = CW270
// set gyro_2_align_yaw = 2700
)""; //end of madflight_board


/*
#==============================================================================
# BetaFlight Source file
#==============================================================================
# Betaflight / STM32G47X (SG47) 4.5.0 Feb 21 2023 / 02:35:25 (05f58c178) MSP API: 1.45

#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_BARO
#define USE_BARO_DPS310
#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define USE_FLASH
#define USE_FLASH_W25Q128FV
#define USE_MAX7456

# config: YES

board_name MAMBAG4
manufacturer_id DIAT

# resources
resource BEEPER 1 A15
resource MOTOR 1 A00
resource MOTOR 2 A01
resource MOTOR 3 A02
resource MOTOR 4 A03
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 B03
resource SERIAL_TX 3 B10
resource SERIAL_TX 4 C10
resource SERIAL_TX 11 B09
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 B04
resource SERIAL_RX 3 B11
resource SERIAL_RX 4 C11
resource I2C_SCL 1 A13
resource I2C_SDA 1 A14
resource LED 1 C15
resource LED 2 C14
resource ADC_BATT 1 B02
resource ADC_CURR 1 B01
resource FLASH_CS 1 C06
resource OSD_CS 1 A08
resource GYRO_EXTI 1 C04
resource GYRO_EXTI 2 B12
resource GYRO_CS 1 A04
resource GYRO_CS 2 B00
resource LED_STRIP 1 B06
resource SPI_SCK 1 A05
resource SPI_MISO 1 A06
resource SPI_MOSI 1 A07
resource SPI_SCK 2 B13
resource SPI_MISO 2 B14
resource SPI_MOSI 2 B15

# timer
timer A00 AF1
# pin A00: TIM2 CH1 (AF1)
timer A01 AF1
# pin A01: TIM2 CH2 (AF1)
timer A02 AF1
# pin A02: TIM2 CH3 (AF1)
timer A03 AF1
# pin A03: TIM2 CH4 (AF1)
timer B06 AF5
# pin B06: TIM8 CH1 (AF5)

# dma
dma ADC 1 1
# ADC 1: DMA1 Channel 2 Request 5
dma TIMUP 2 0
# TIMUP 2: DMA1 Channel 1 Request 60
dma TIMUP 8 0
# TIMUP 8: DMA1 Channel 1 Request 53
dma pin A00 1
# pin A00: DMA1 Channel 2 Request 56
dma pin A01 2
# pin A01: DMA1 Channel 3 Request 57
dma pin A02 3
# pin A02: DMA1 Channel 4 Request 58
dma pin A03 4
# pin A03: DMA1 Channel 5 Request 59
dma pin B06 9
# pin B06: DMA2 Channel 2 Request 49

# feature
feature TELEMETRY
feature OSD

# serial
serial 2 1024 115200 57600 0 115200

# master
set baro_bustype = I2C
set baro_i2c_device = 1
set blackbox_device = SPIFLASH
set dshot_burst = ON
set current_meter = ADC
set battery_meter = ADC
set beeper_inversion = ON
set beeper_od = OFF
set pid_process_denom = 2
set max7456_spi_bus = 2
set flash_spi_bus = 2
set gyro_1_spibus = 1
set gyro_1_sensor_align = CW180
set gyro_1_align_yaw = 1800
set gyro_2_spibus = 1
set gyro_2_sensor_align = CW270
set gyro_2_align_yaw = 2700

*/
