/*==============================================================================
Generated on: 2025-03-24 13:58:26.020225
Generated by: betaflight_target_converter.py
Source: https://github.com/betaflight/unified-targets
Board name: TAKERG4AIO
Manufacturer ID: GEPR

//copy this line to madflight.ino to use this flight controller
#include <madflight_zzz_GEPR-TAKERG4AIO.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.
==============================================================================*/

#define HAL_BOARD_NAME "BETAFLIGHT-GEPR-TAKERG4AIO"
#define HAL_MCU "STM32G47X"

#define MADFLIGHT_BOARD R""(
imu_gizmo MPU6000 // #define USE_GYRO_SPI_MPU6000
imu_gizmo ICM42688P // #define USE_GYRO_SPI_ICM42688P
// 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
// resource LED_STRIP 1 B06
pin_ser0_tx PA9 // resource SERIAL_TX 1 A09
pin_ser1_tx PB3 // resource SERIAL_TX 2 B03
pin_ser2_tx PB9 // resource SERIAL_TX 3 B09
pin_ser3_tx PC10 // resource SERIAL_TX 4 C10
pin_ser10_tx PB10 // resource SERIAL_TX 11 B10
pin_ser0_rx PA10 // resource SERIAL_RX 1 A10
pin_ser1_rx PB4 // resource SERIAL_RX 2 B04
pin_ser3_rx PC11 // resource SERIAL_RX 4 C11
pin_ser10_rx PB11 // resource SERIAL_RX 11 B11
pin_i2c0_scl PA13 // resource I2C_SCL 1 A13
pin_i2c0_sda PA14 // resource I2C_SDA 1 A14
pin_led PB7 // resource LED 1 B07
pin_spi0_sclk PA5 // resource SPI_SCK 1 A05
pin_spi1_sclk PB13 // resource SPI_SCK 2 B13
pin_spi2_sclk PB3 // resource SPI_SCK 3 B03
pin_spi0_miso PA6 // resource SPI_MISO 1 A06
pin_spi1_miso PB14 // resource SPI_MISO 2 B14
pin_spi2_miso PB4 // resource SPI_MISO 3 B04
pin_spi0_mosi PA7 // resource SPI_MOSI 1 A07
pin_spi1_mosi PB15 // resource SPI_MOSI 2 B15
pin_spi2_mosi PB5 // resource SPI_MOSI 3 B05
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 PA4 // resource GYRO_EXTI 1 A04
pin_imu_cs PB0 // resource GYRO_CS 1 B00
// set blackbox_device = SPIFLASH
// set max7456_spi_bus = 2
// set beeper_inversion = ON
// set beeper_od = OFF
// set current_meter = ADC
// set battery_meter = ADC
// set ibata_scale = 120
// set flash_spi_bus = 2
// set gyro_1_bustype = SPI
imu_spi_bus 0 // set gyro_1_spibus = 1
// set align_board_yaw = 45
imu_align CW270 // set gyro_1_sensor_align = CW270
)"" //end of MADFLIGHT_BOARD


/*
#==============================================================================
# BetaFlight Source file
#==============================================================================
# Betaflight / STM32G47X (SG47) 4.5.0 Feb 21 2023 / 01:24:44 (d98740b) MSP API: 1.45

#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_ACC_SPI_ICM42688P
#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define USE_GYRO_SPI_ICM42688P
#define USE_FLASH
#define USE_FLASH_W25Q128FV
#define USE_MAX7456

board_name TAKERG4AIO 
manufacturer_id GEPR

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

# 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 ADC 2 8
# ADC 2: DMA2 Channel 1 Request 36
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 RX_SERIAL
feature TELEMETRY
feature OSD
feature AIRMODE


# master
set blackbox_device = SPIFLASH
set max7456_spi_bus = 2
set beeper_inversion = ON
set beeper_od = OFF
set current_meter = ADC
set battery_meter = ADC
set ibata_scale = 120
set flash_spi_bus = 2 
set gyro_1_bustype = SPI
set gyro_1_spibus = 1
set align_board_yaw = 45
set gyro_1_sensor_align = CW270

*/
