1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-21 15:25:29 +03:00

Merge pull request #764 from iNavFlight/master

Merge back from master to development
This commit is contained in:
Konstantin Sharlaimov 2016-11-06 18:07:51 +10:00 committed by GitHub
commit ad57ed62b9
5 changed files with 317 additions and 0 deletions

38
docs/Board - YuPiF4.md Normal file
View file

@ -0,0 +1,38 @@
# YuPiF4 by RcNet
An high quality flight controller for the most demanding pilotes.
## Description
The YuPiF4 is a 36x36mm (30.5x30.5 mounting holes) board with an F4 microcontroller.
## MCU, Sensors and Features
### Hardware 
- MCU: STM32F405RTG6 
- IMU: not yet defined 
- IMU Interrupt: Yes 
- BARO: No 
- VCP: Yes 
- Hardware UARTS: 3 with an inverter for SBus and a Smart-Port Pad to solder directly your SPort wire 
- Blackbox: SD card slot 
- PPM : A specific pad is available for PPM input 
- Battery Voltage Sensor: Yes, directly connected, no wiring necessary 
- Integrated Voltage Regulator: the board can be powered by your lipo (2S to 6S) 
- Brushed Motor Mosfets: No 
- Motor outputs : can drive up to 6 motors 
- Buttons: Boot0 to enter in DFU mode### Features 
- Current Sensor: Not implemented 
- BlHeli passthrough: Yes  
- WS2811 Led Strip: Yes (on motor output Pin 5) 
- Transponder: No
### Extension Board
- An extension board with a GPS and a Baro will be available
## Designers and Maintainers
[RcNet](https://github.com/ted-rcnet) and [FaduF](https://github.com/Faduf)
## Manufacturers and Distributors
This board is currently in the prototype phase. Only small batches were manufactured for testing.Website : http://www.yupif4.com/

View file

@ -0,0 +1,40 @@
# YuPiF4 by RcNet
An high quality flight controller for the most demanding pilotes.
## Description
The YuPiF4 is a 36x36mm (30.5x30.5 mounting holes) board with an F4 microcontroller.
## MCU, Sensors and Features
### Hardware 
- MCU: STM32F405RTG6 
- IMU: not yet defined 
- IMU Interrupt: Yes 
- BARO: No 
- VCP: Yes 
- Hardware UARTS: 3 with an inverter for SBus and a Smart-Port Pad to solder directly your SPort wire 
- Blackbox: SD card slot 
- PPM : A specific pad is available for PPM input 
- Battery Voltage Sensor: Yes, directly connected, no wiring necessary 
- Integrated Voltage Regulator: the board can be powered by your lipo (2S to 6S) 
- Brushed Motor Mosfets: No 
- Motor outputs : can drive up to 6 motors 
- Buttons: Boot0 to enter in DFU mode### Features 
- Current Sensor: Not implemented 
- BlHeli passthrough: Yes  
- WS2811 Led Strip: Yes (on motor output Pin 5) 
- Transponder: No
### Extension Board
- An extension board with GPS and Baro will be available
## Designers and Maintainers
[RcNet](https://github.com/ted-rcnet) and [FaduF](https://github.com/Faduf)
## Manufacturers and Distributors
This board is currently in the prototype phase. Only small batches were manufactured for testing.Website : http://www.yupif4.com/
![YuPiF4 - Logo](http://www.yupif4.com/imgs/YuPiF4.jpg)

View file

@ -0,0 +1,78 @@
/*
* 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/pwm_mapping.h"
#include "drivers/timer.h"
const uint16_t multiPPM[] = {
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM4 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8),
0xFFFF
};
const uint16_t multiPWM[] = {
PWM1 | (MAP_TO_PWM_INPUT << 8),
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM4 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8),
0xFFFF
};
const uint16_t airPPM[] = {
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM4 | (MAP_TO_SERVO_OUTPUT << 8),
PWM5 | (MAP_TO_SERVO_OUTPUT << 8),
PWM6 | (MAP_TO_SERVO_OUTPUT << 8),
PWM7 | (MAP_TO_SERVO_OUTPUT << 8),
0xFFFF
};
const uint16_t airPWM[] = {
PWM1 | (MAP_TO_PWM_INPUT << 8),
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM4 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8),
0xFFFF
};
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
{ TIM8, IO_TAG(PC8), TIM_Channel_3, TIM8_CC_IRQn, 0, IOCFG_AF_PP, GPIO_AF_TIM8 },
{ TIM2, IO_TAG(PA0), TIM_Channel_1, TIM2_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM2 },
{ TIM2, IO_TAG(PA1), TIM_Channel_2, TIM2_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM2 },
{ TIM2, IO_TAG(PA2), TIM_Channel_3, TIM2_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM2 },
{ TIM2, IO_TAG(PA3), TIM_Channel_4, TIM2_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM2 },
{ TIM3, IO_TAG(PB0), TIM_Channel_3, TIM3_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM3 },
{ TIM3, IO_TAG(PB1), TIM_Channel_4, TIM3_IRQn, 1, IOCFG_AF_PP, GPIO_AF_TIM3 },
};

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 "YPF4"
#define TARGET_CONFIG
#define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
#define USBD_PRODUCT_STRING "YupiF4"
#define LED0 PB6
#define LED1 PB4
#define LED2 PB5
#define BEEPER PC9
//#define BEEPER_INVERTED
#define INVERTER PB15
#define INVERTER_USART USART6
// MPU6500 interrupt
#define USE_EXTI
#define USE_MPU_DATA_READY_SIGNAL
#define MPU_INT_EXTI PC4
// MPU6500
#define MPU6500_CS_PIN PA4
#define MPU6500_SPI_INSTANCE SPI1
#define ACC
#define USE_ACC_MPU6500
#define USE_ACC_SPI_MPU6500
#define ACC_MPU6500_ALIGN CW90_DEG
#define GYRO
#define USE_GYRO_MPU6500
#define USE_GYRO_SPI_MPU6500
#define GYRO_MPU6500_ALIGN CW90_DEG
// Serial Ports
#define USE_VCP
#define USE_UART1
#define UART1_RX_PIN PA10
#define UART1_TX_PIN PA9
#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10
#define USE_UART6
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#define SERIAL_PORT_COUNT 4 // VCP, UART1, UART3, UART6
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_HARDWARE 0
// SD Card
#define USE_SDCARD
#define SDCARD_DETECT_INVERTED
#define SDCARD_DETECT_PIN PD2
#define SDCARD_SPI_INSTANCE SPI3
#define SDCARD_SPI_CS_PIN PA15
// SPI2 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init:
#define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
// Divide to under 25MHz for normal operation:
#define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
#define SDCARD_DMA_CHANNEL_TX DMA1_Stream5
#define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF5
#define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1
#define SDCARD_DMA_CHANNEL DMA_Channel_0
// SPI ports definition
#define USE_SPI
#define USE_SPI_DEVICE_1 // Gyro
#define SPI1_NSS_PIN PA4
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define USE_SPI_DEVICE_3 // SD Card
#define SPI3_NSS_PIN PB3
#define SPI3_SCK_PIN PC10
#define SPI3_MISO_PIN PC11
#define SPI3_MOSI_PIN PC12
// I2C port definition
#define USE_I2C
#define I2C_DEVICE (I2CDEV_1)
#define USE_I2C_PULLUP
// ADC inputs
#define BOARD_HAS_VOLTAGE_DIVIDER
#define USE_ADC
#define VBAT_ADC_PIN PC1
#define RSSI_ADC_GPIO_PIN PC0
// LED Strip can run off Pin 5 (PB1) of the motor outputs
#define LED_STRIP
#define WS2811_PIN PB1
#define WS2811_TIMER TIM3
#define WS2811_TIMER_CHANNEL TIM_Channel_4
#define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST2_HANDLER
#define WS2811_DMA_STREAM DMA1_Stream2
#define WS2811_DMA_FLAG DMA_FLAG_TCIF2
#define WS2811_DMA_IT DMA_IT_TCIF2
#define WS2811_DMA_CHANNEL DMA_Channel_5
#define WS2811_DMA_IRQ DMA1_Stream2_IRQn
// Features
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define DEFAULT_FEATURES FEATURE_BLACKBOX
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
// Number of available PWM outputs
#define MAX_PWM_OUTPUT_PORTS 6
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define USABLE_TIMER_CHANNEL_COUNT 7
#define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(8))

View file

@ -0,0 +1,9 @@
F405_TARGETS += $(TARGET)
FEATURES += SDCARD VCP
TARGET_SRC = \
drivers/accgyro_spi_mpu6500.c \
drivers/accgyro_mpu6500.c \
drivers/light_ws2811strip.c \
drivers/light_ws2811strip_stm32f4xx.c