add new target SpeedyBee F4 (#5552)

* add new target speedybee f4

* modify BEEPER define
This commit is contained in:
allenfor2017 2018-03-30 12:54:25 +08:00 committed by Michael Keller
parent 22004cfd56
commit a02c404157
5 changed files with 354 additions and 0 deletions

View File

@ -0,0 +1,104 @@
# Board - SpeedyBee F4 AIO
### Descriptions
This SpeedyBee F4 AIO board integrates the Bluetooth module, with SpeedyBee App, we can set the FC parameter via mobile device.It runs Betaflight, with Built-in LC-Filter for 5V and 9V, and no pinned-connectors all direct solder for optimal durability on top side. It has the current sensor and ESC power output.
### Hardware Features
* MCU: STM32F405
* IMU: MPU6000
* OSD: BetaFlight OSD w/ AT7456E chip
* BLE Module: inner connect to UART5 for remote setting with SpeedyBee App or other similar apps
* BlackBox: 16Mb onboard dataflash
* Current Sensor: 200A(Scale 608)
* Power input: 3s - 6s Lipo
* Power output: 4.5V * 1 , 3.3V * 1, 5V * 3 , 9V * 1
* Cam And VTX power output: Built-in LC-Filter for 5V and 9V
* ESC power output: 4 * VCC output
* UART: UART Pads * 3(UART1, UART3, UART4)
* UART2 for Receiver: Built in inverter of RX2 for SBUS input through SBUS pad, RX2 pad used for PPM, DSM2, DSMX, IBUS
* RSSI input: RSSI input solder pad
* I2C: Used for external GPS, Barometer module
* Buzzer: Buz- and 5V pad used for 5V Buzzer
* ESC signal: s1 - s7
* LED pin: Used for WS2812 LED
* Boot button: Used to easy enter DFU mode
### All uarts have pad on board
| Value | Identifier | RX | TX | Notes |
| ----- | ------------ | -----| -----| ------------------------------------------------------------------------------------------- |
| 1 | USART1 | PA10 | PA9 | PB7 FOR SBUS IN(inverter built-in) |
| 2 | USART2 | PA3 | PA2 | PA3 for SBUS signal through SBUS pad, and normally connect to RX2 pad for other types receiver |
| 3 | USART3 | PC11 | PC10| USE FOR GPS |
| 4 | USART4 | PA1 | PA0 | PA0 FOR RSSI/FPORT/TEL etc |
| 5 | USART5 | PD2 | PC12| PAD |
### I2C, use for Barometer or compass
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ---------| -------| ------------------------------------------------------------------------------------- |
| 1 | I2C1 | SDA | PB7 |
| 2 | I2C1 | SCL | PB6 |
### Buzzer/LED output
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ---------| -------| ------------------------------------------------------------------------------------- |
| 1 | LED0 | LED | PB9 |
| 2 | BEEPER | BEE | PC13 |
### Analog signal input
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ----------| ------| ------------------------------------------------------------------------------------- |
| 1 | ADC1 | VBAT | PC2 |
| 2 | ADC1 | CURR | PC1 |
| 3 | ADC1 | RSSI | PC3 |
### 7 PWM Outputs
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ----------| ------| ------------------------------------------------------------------------------------- |
| 1 | TIM8_CH1 | OUPUT1 | PC6 | DMA1_Stream7
| 2 | TIM8_CH2 | OUPUT2 | PC7 | DMA2_Stream2
| 3 | TIM8_CH3 | OUPUT3 | PC8 | DMA2_Stream6
| 4 | TIM8_CH4 | OUPUT4 | PC9 | DMA2_Stream1
| 5 | TIM2_CH1 | OUPUT5 | PA15 | DMA2_Stream4
| 6 | TIM1_CH1 | OUPUT6 | PA8 | DMA1_Stream2
| 7 | TIM4_CH3 | OUPUT7 | PB8 | DMA1_Stream5
### LED & PPM Input
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ----------| ------| ------------------------------------------------------------------------------------- |
| 1 | TIM5_CH4 | PPM | PC11 |
| 2 | TIM4_CH1 | LED Strip Signal Input | PB6 |
### Gyro & ACC(MPU6000)
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ---------| -------| ------------------------------------------------------------------------------------- |
| 1 | SPI1 | SCK | PA5 |
| 2 | SPI1 | MISO | PA6 |
| 3 | SPI1 | MOSI | PA7 |
| 4 | SPI1 | CS | PB11 |
### OSD(AT7456E)
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ---------| -------| ------------------------------------------------------------------------------------- |
| 1 | SPI2 | SCK | PB13 |
| 2 | SPI2 | MISO | PB14 |
| 3 | SPI2 | MOSI | PB15 |
| 4 | SPI2 | CS | PB10 |
### 16Mbyte onboard flash
| Value | Identifier | function | pin | Notes |
| ----- | ------------ | ---------| -------| ------------------------------------------------------------------------------------- |
| 1 | SPI3 | SCK | PB3 |
| 2 | SPI3 | MISO | PB4 |
| 3 | SPI3 | MOSI | PB5 |
| 4 | SPI3 | CS | PC0 |

View File

@ -0,0 +1,44 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it 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.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <platform.h>
#ifdef USE_TARGET_CONFIG
#include "io/serial.h"
#include "pg/pinio.h"
#include "pg/piniobox.h"
#include "target.h"
#define BLUETOOTH_MSP_UART SERIAL_PORT_UART5
#define BLUETOOTH_MSP_BAUDRATE BAUD_19200
void targetConfiguration(void)
{
pinioConfigMutable()->config[0] = PINIO_CONFIG_OUT_INVERTED | PINIO_CONFIG_MODE_OUT_PP;
pinioBoxConfigMutable()->permanentId[0] = BOXARM;
serialPortConfig_t *bluetoothMspUART = serialFindPortConfiguration(BLUETOOTH_MSP_UART);
if (bluetoothMspUART) {
bluetoothMspUART->functionMask = FUNCTION_MSP;
bluetoothMspUART->msp_baudrateIndex = BLUETOOTH_MSP_BAUDRATE;
}
}
#endif

View File

@ -0,0 +1,43 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it 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.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <platform.h>
#include "drivers/io.h"
#include "drivers/dma.h"
#include "drivers/timer.h"
#include "drivers/timer_def.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM5, CH4, PC11, TIM_USE_PPM, 0, 0), // PPM
DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // S1 UP(1,2)
DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 1), // S2 UP(2,1)
DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // S3 UP(2,1)
DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // S4 UP(2,1)
DEF_TIM(TIM2, CH1, PA15, TIM_USE_MOTOR, 0, 0), // S5 UP(1,7)
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0, 0), // S6 UP(2,5)
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // S7 D(1,7)!S5 UP(2,6)
DEF_TIM(TIM4, CH1, PB6, TIM_USE_LED, 0, 0), // LED D(1,0) UP(2,6)
DEF_TIM(TIM5, CH1, PA0, TIM_USE_PWM, 0, 0), // TX4 UP(1,6) D(1,2)!S1
DEF_TIM(TIM5, CH2, PA1, TIM_USE_PWM, 0, 0), // RX4 UP(1,6) D(1,4)
DEF_TIM(TIM9, CH1, PA2, TIM_USE_PWM, 0, 0), // TX2
};

View File

@ -0,0 +1,152 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it 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.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TARGET_BOARD_IDENTIFIER "SBF4"
#define USBD_PRODUCT_STRING "SpeedyBeeF4"
#define USE_TARGET_CONFIG
#define LED0_PIN PB9
#define USE_BEEPER
#define BEEPER_PIN PC13
#define BEEPER_INVERTED
#define ENABLE_DSHOT_DMAR true
// *************** Gyro & ACC **********************
#define USE_SPI
#define USE_SPI_DEVICE_1
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define MPU6000_CS_PIN PB11
#define MPU6000_SPI_INSTANCE SPI1
#define USE_EXTI
#define MPU_INT_EXTI PC4
#define USE_MPU_DATA_READY_SIGNAL
#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_MAG
#define USE_MAG_HMC5883
#define USE_MAG_QMC5883
// *************** Baro **************************
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C_DEVICE (I2CDEV_1)
#define I2C1_SCL PB6 // SCL pad
#define I2C1_SDA PB7 // SDA pad
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define USE_BARO
#define USE_BARO_BMP280
#define USE_BARO_MS5611
#define USE_BARO_BMP085
#define USE_SPI_DEVICE_3
#define SPI3_SCK_PIN PB3
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5
#define USE_FLASHFS
#define USE_FLASH_M25P16
#define M25P16_CS_PIN PC0
#define M25P16_SPI_INSTANCE SPI3
// *************** OSD *****************************
#define USE_SPI_DEVICE_2
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI2
#define MAX7456_SPI_CS_PIN PB10
// *************** UART *****************************
#define USE_VCP
#define VBUS_SENSING_PIN PB12
#define VBUS_SENSING_ENABLED
#define USE_UART1
#define UART1_RX_PIN PA10
#define UART1_TX_PIN PA9
#define USE_UART2
#define UART2_RX_PIN PA3
#define UART2_TX_PIN PA2
#define USE_UART3
#define UART3_RX_PIN PC11
#define UART3_TX_PIN PC10
#define USE_UART4
#define UART4_RX_PIN PA1
#define UART4_TX_PIN PA0
#define USE_UART5
#define UART5_RX_PIN PD2
#define UART5_TX_PIN PC12
#define USE_SOFTSERIAL1
#define USE_SOFTSERIAL2
#define SERIAL_PORT_COUNT 8
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART2
// *************** ADC *****************************
#define USE_ADC
#define ADC1_DMA_STREAM DMA2_Stream0
#define CURRENT_METER_ADC_PIN PC1
#define VBAT_ADC_PIN PC2
#define RSSI_ADC_PIN PC3
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define CURRENT_METER_SCALE_DEFAULT 608
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PA3
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
// *************** activate/deactivate Bluetooth When disarmed/armed using PINIO_BOX *****************************
#define PINIO1_PIN PB0
#define USABLE_TIMER_CHANNEL_COUNT 12
#define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(4)|TIM_N(5)|TIM_N(8)|TIM_N(9))

View File

@ -0,0 +1,11 @@
F405_TARGETS += $(TARGET)
FEATURES += VCP ONBOARDFLASH
TARGET_SRC = \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/barometer/barometer_bmp085.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
drivers/compass/compass_qmc5883l.c \
drivers/max7456.c