From 93ef5f30d82fa28579cd735fbb65b0bb95f92ed2 Mon Sep 17 00:00:00 2001 From: ot0tot <36753790+ot0tot@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:15:01 -0400 Subject: [PATCH] Add FreeAxisF4 target (#199) * Add FreeAxisF4 target Adds target for FreeAxis F4 25A AIO FC based on MATEKF411 target with the addition of a flash chip and BMI270. Solves: https://github.com/betaflight/unified-targets/issues/1149 Discord issue: https://discord.com/channels/868013470023548938/1160296288609390592 Thanks to J. R. on GitHub for the factory config (https://discord.com/channels/868013470023548938/868013470518505494/1167219861601124392) * Fix typos * Change manufacturer to CLNE * Add EOL * Update config.h * Remove BMP280 define * Update configs/FREEAXISF4/config.h Remove USE_BARO since no specific hardware is defined Co-authored-by: Mark Haslinghuis * Remove BARO I2C define --------- Co-authored-by: Mark Haslinghuis --- configs/FREEAXISF4/config.h | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 configs/FREEAXISF4/config.h diff --git a/configs/FREEAXISF4/config.h b/configs/FREEAXISF4/config.h new file mode 100644 index 00000000..c072e0fb --- /dev/null +++ b/configs/FREEAXISF4/config.h @@ -0,0 +1,95 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#pragma once + +#define FC_TARGET_MCU STM32F411 + +#define BOARD_NAME FREEAXISF4 +#define MANUFACTURER_ID CLNE + +#define USE_ACC +#define USE_GYRO +#define USE_ACCGYRO_BMI270 +#define USE_FLASH +#define USE_FLASH_W25N01G +#define USE_MAX7456 + +#define BEEPER_PIN PB2 +#define MOTOR1_PIN PB4 +#define MOTOR2_PIN PB5 +#define MOTOR3_PIN PB6 +#define MOTOR4_PIN PB7 +#define MOTOR5_PIN PB3 +#define MOTOR6_PIN PB10 +#define LED_STRIP_PIN PA8 +#define UART1_TX_PIN PA9 +#define UART2_TX_PIN PA2 +#define UART1_RX_PIN PA10 +#define UART2_RX_PIN PA3 +#define SOFTSERIAL1_TX_PIN PA0 +#define SOFTSERIAL1_RX_PIN PA0 +#define I2C1_SCL_PIN PB8 +#define I2C1_SDA_PIN PB9 +#define LED0_PIN PC13 +#define LED1_PIN PC14 +#define SPI1_SCK_PIN PA5 +#define SPI2_SCK_PIN PB13 +#define SPI1_SDI_PIN PA6 +#define SPI2_SDI_PIN PB14 +#define SPI1_SDO_PIN PA7 +#define SPI2_SDO_PIN PB15 +#define ADC_VBAT_PIN PB0 +#define ADC_CURR_PIN PB1 +#define FLASH_CS_PIN PA15 +#define MAX7456_SPI_CS_PIN PB12 +#define GYRO_1_EXTI_PIN PA1 +#define GYRO_2_EXTI_PIN NONE +#define GYRO_1_CS_PIN PA4 +#define USB_DETECT_PIN PC15 + +#define TIMER_PIN_MAPPING \ + TIMER_PIN_MAP( 0, PA3 , 3, -1) \ + TIMER_PIN_MAP( 1, PB4 , 2, 0) \ + TIMER_PIN_MAP( 2, PB5 , 2, 0) \ + TIMER_PIN_MAP( 3, PB6 , 2, 0) \ + TIMER_PIN_MAP( 4, PB7 , 2, 0) \ + TIMER_PIN_MAP( 5, PB3 , 1, 0) \ + TIMER_PIN_MAP( 6, PB10, 1, 0) \ + TIMER_PIN_MAP( 7, PA0 , 2, 0) \ + TIMER_PIN_MAP( 8, PA2 , 2, 0) \ + TIMER_PIN_MAP( 9, PA8 , 1, 0) + +#define ADC1_DMA_OPT 1 + +#define DEFAULT_DSHOT_BURST DSHOT_DMAR_OFF +#define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_OFF +#define MAG_I2C_INSTANCE (I2CDEV_1) +#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define BEEPER_INVERTED +#define SYSTEM_HSE_MHZ 8 +#define FLASH_SPI_INSTANCE SPI2 +#define MAX7456_SPI_INSTANCE SPI2 +#define USE_SPI_GYRO +#define GYRO_1_SPI_INSTANCE SPI1 +#define GYRO_1_ALIGN CW180_DEG