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

//copy this line to madflight.ino to use this flight controller
#include <madflight_zzz_STMI-STM32F411DISCOVERY.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-STMI-STM32F411DISCOVERY"
#define HAL_MCU "STM32F411"

#define MADFLIGHT_BOARD R""(
// resource BEEPER 1 D12
pin_out0 PB1 // resource MOTOR 1 B01
pin_out1 PB0 // resource MOTOR 2 B00
pin_out2 PA2 // resource MOTOR 3 A02
pin_out3 PA3 // resource MOTOR 4 A03
pin_out4 PA10 // resource MOTOR 5 A10
pin_out5 PA8 // resource MOTOR 6 A08
pin_rcl_ppm PB8 // resource PPM 1 B08
// resource LED_STRIP 1 B08
pin_ser0_tx PA15 // resource SERIAL_TX 1 A15
pin_ser1_tx PA2 // resource SERIAL_TX 2 A02
pin_ser5_tx PC6 // resource SERIAL_TX 6 C06
pin_ser0_rx PA10 // resource SERIAL_RX 1 A10
pin_ser1_rx PA3 // resource SERIAL_RX 2 A03
pin_ser5_rx PC7 // resource SERIAL_RX 6 C07
pin_i2c0_scl PB6 // resource I2C_SCL 1 B06
pin_i2c0_sda PB9 // resource I2C_SDA 1 B09
pin_led PD15 // resource LED 1 D15
// resource LED 2 D13
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
// resource ESCSERIAL 1 B08
pin_bat_v PC1 // resource ADC_BATT 1 C01
bat_gizmo ADC
pin_bat_i PC2 // resource ADC_CURR 1 C02
bat_gizmo ADC
pin_imu_int PE1 // resource GYRO_EXTI 1 E01
pin_imu_cs PE3 // resource GYRO_CS 1 E03
// resource USB_DETECT 1 A09
// set mag_bustype = I2C
mag_i2c_bus 0 // set mag_i2c_device = 1
// set current_meter = ADC
// set battery_meter = ADC
// set beeper_frequency = 2000
// set system_hse_mhz = 8
// set gyro_1_bustype = SPI
imu_spi_bus 0 // set gyro_1_spibus = 1
imu_align CW180 // set gyro_1_sensor_align = CW180
// set gyro_1_align_yaw = 1800
)"" //end of MADFLIGHT_BOARD


/*
#==============================================================================
# BetaFlight Source file
#==============================================================================
# Betaflight / STM32F411 (S411) 4.2.0 Feb  2 2020 / 16:19:09 (30bf9e809f) MSP API: 1.43

#define USE_ACC
#define USE_ACC_LSM303DLHC
#define USE_GYRO
#define USE_GYRO_L3GD20
#define MPU_I2C_INSTANCE I2CDEV_1

board_name STM32F411DISCOVERY
manufacturer_id STMI

# resources
resource BEEPER 1 D12
resource MOTOR 1 B01
resource MOTOR 2 B00
resource MOTOR 3 A02
resource MOTOR 4 A03
resource MOTOR 5 A10
resource MOTOR 6 A08
resource PPM 1 B08
resource LED_STRIP 1 B08
resource SERIAL_TX 1 A15
resource SERIAL_TX 2 A02
resource SERIAL_TX 6 C06
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A03
resource SERIAL_RX 6 C07
resource I2C_SCL 1 B06
resource I2C_SDA 1 B09
resource LED 1 D15
resource LED 2 D13
resource SPI_SCK 1 A05
resource SPI_MISO 1 A06
resource SPI_MOSI 1 A07
resource ESCSERIAL 1 B08
resource ADC_BATT 1 C01
resource ADC_CURR 1 C02
resource GYRO_EXTI 1 E01
resource GYRO_CS 1 E03
resource USB_DETECT 1 A09

# timer
timer B08 AF2
# pin B08: TIM4 CH3 (AF2)
timer D12 AF2
# pin D12: TIM4 CH1 (AF2)
timer B01 AF2
# pin B01: TIM3 CH4 (AF2)
timer B00 AF2
# pin B00: TIM3 CH3 (AF2)
timer A02 AF1
# pin A02: TIM2 CH3 (AF1)
timer A03 AF1
# pin A03: TIM2 CH4 (AF1)
timer A10 AF1
# pin A10: TIM1 CH3 (AF1)
timer A08 AF1
# pin A08: TIM1 CH1 (AF1)

# dma
dma ADC 1 1
# ADC 1: DMA2 Stream 4 Channel 0
dma pin B08 0
# pin B08: DMA1 Stream 7 Channel 2
dma pin D12 0
# pin D12: DMA1 Stream 0 Channel 2
dma pin B01 0
# pin B01: DMA1 Stream 2 Channel 5
dma pin B00 0
# pin B00: DMA1 Stream 7 Channel 5
dma pin A02 0
# pin A02: DMA1 Stream 1 Channel 3
dma pin A03 1
# pin A03: DMA1 Stream 6 Channel 3
dma pin A10 1
# pin A10: DMA2 Stream 6 Channel 6
dma pin A08 1
# pin A08: DMA2 Stream 1 Channel 6

# master
set mag_bustype = I2C
set mag_i2c_device = 1
set current_meter = ADC
set battery_meter = ADC
set beeper_frequency = 2000
set system_hse_mhz = 8
set gyro_1_bustype = SPI
set gyro_1_spibus = 1
set gyro_1_sensor_align = CW180
set gyro_1_align_yaw = 1800

*/
