Merge pull request #4913 from AlienWiiBF/PIKOF4OSD

Adding PIKOF4OSD to PIKOF4 target
This commit is contained in:
Michael Keller 2018-01-09 10:57:42 +13:00 committed by GitHub
commit b1a84c8557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 21 deletions

View File

@ -25,9 +25,18 @@
#include "drivers/timer_def.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), // S3_OUT - DMA1_ST6
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - DMA1_ST7
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), // S4_OUT - DMA1_ST1
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - DMA1_ST2
#if defined(FF_PIKOF4OSD)
DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - DMA1_ST7
DEF_TIM(TIM3, CH3, PB1, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - DMA1_ST1
DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), // S3_OUT - DMA1_ST6
DEF_TIM(TIM3, CH4, PB0, TIM_USE_MOTOR, 0, 0 ), // S4_OUT - DMA1_ST2
DEF_TIM(TIM8, CH2N, PB14, TIM_USE_MOTOR, 0, 0 ), // PA14 RC4 - DMA2_ST6, *DMA2_ST2
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_MOTOR, 0, 0 ), // PA15 RC5 - DMA2_ST6, DMA2_ST6
#else
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), // S1_OUT - DMA1_ST6
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - DMA1_ST7
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), // S3_OUT - DMA1_ST1
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), // S4_OUT - DMA1_ST2
#endif
DEF_TIM(TIM4, CH2, PB7, TIM_USE_LED, 0, 0 ), // LED - DMA1_ST3
};

View File

@ -16,12 +16,22 @@
*/
#pragma once
#if defined(FF_PIKOF4OSD)
#define TARGET_BOARD_IDENTIFIER "PKOS"
#define USBD_PRODUCT_STRING "PikoF4OSD"
#else
#define TARGET_BOARD_IDENTIFIER "PIK4"
#define USBD_PRODUCT_STRING "PikoF4"
#endif
#define USE_TARGET_CONFIG
/*--------------LED----------------*/
#if defined(FF_PIKOF4OSD)
#define LED0_PIN PB5
#define LED1_PIN PB4
#else
#define LED0_PIN PA15
#define LED1_PIN PB6
#endif
/*---------------------------------*/
/*------------BEEPER---------------*/
@ -29,6 +39,10 @@
#define BEEPER_INVERTED
/*---------------------------------*/
/*----------CAMERA CONTROL---------*/
// #define CAMERA_CONTROL_PIN PB7
/*---------------------------------*/
/*------------SENSORS--------------*/
// MPU interrupt
#define USE_EXTI
@ -37,40 +51,45 @@
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW
#if defined(FF_PIKOF4OSD)
#define MPU6000_CS_PIN PA15
#define MPU6000_SPI_INSTANCE SPI3
#define MPU6500_CS_PIN PA15
#define MPU6500_SPI_INSTANCE SPI3
#else
#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_INSTANCE SPI1
#define MPU6500_CS_PIN PA4
#define MPU6500_SPI_INSTANCE SPI1
#define ICM20689_CS_PIN PA4
#define ICM20689_SPI_INSTANCE SPI1
#endif
#define USE_GYRO
#define USE_GYRO_SPI_ICM20689
#define GYRO_ICM20689_ALIGN CW180_DEG
#define USE_GYRO_SPI_MPU6000
#define GYRO_MPU6000_ALIGN CW180_DEG
#define USE_ACC_SPI_MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
#define USE_GYRO_MPU6500
#define USE_GYRO_SPI_MPU6500
#define GYRO_MPU6500_ALIGN CW180_DEG
#define USE_ACC
#define USE_ACC_SPI_ICM20689
#define ACC_ICM20689_ALIGN CW180_DEG
#define USE_ACC_SPI_MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
#define USE_ACC_MPU6500
#define USE_ACC_SPI_MPU6500
#define ACC_MPU6500_ALIGN CW180_DEG
/*---------------------------------*/
#if defined(FF_PIKOF4OSD)
/*-------------OSD-----------------*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI1
#define MAX7456_SPI_CS_PIN PA4
#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz
#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
/*---------------------------------*/
#else
/*------------FLASH----------------*/
#define M25P16_CS_PIN PB3
#define M25P16_SPI_INSTANCE SPI3
@ -78,6 +97,7 @@
#define USE_FLASHFS
#define USE_FLASH_M25P16
/*---------------------------------*/
#endif
/*-----------USB-UARTs-------------*/
#define USE_VCP
@ -91,13 +111,22 @@
#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10
#if defined(FF_PIKOF4OSD)
#define INVERTER_PIN_UART3 PC3
#else
#define INVERTER_PIN_UART3 PC8
#endif
#define USE_UART4
#define UART4_TX_PIN PA0
#define UART4_RX_PIN PA1
#define USE_UART6
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#define SERIAL_PORT_COUNT 4
#define SERIAL_PORT_COUNT 5
/*---------------------------------*/
@ -111,7 +140,11 @@
#define SPI1_MOSI_PIN PA7
#define USE_SPI_DEVICE_3
#if defined(FF_PIKOF4OSD)
#define SPI3_NSS_PIN PA15
#else
#define SPI3_NSS_PIN PB3
#endif
#define SPI3_SCK_PIN PC10
#define SPI3_MISO_PIN PC11
#define SPI3_MOSI_PIN PC12
@ -119,8 +152,13 @@
/*-------------ADCs----------------*/
#define USE_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define VBAT_ADC_PIN PC2
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define VBAT_ADC_PIN PC2
#if defined(FF_PIKOF4OSD)
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define CURRENT_METER_ADC_PIN PC1
#define CURRENT_METER_SCALE_DEFAULT 250
#endif
/*---------------------------------*/
/*-------------ESCs----------------*/
@ -132,6 +170,9 @@
/*--------DEFAULT VALUES-----------*/
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#if defined(FF_PIKOF4OSD)
#define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD )
#endif
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART3
@ -142,6 +183,11 @@
/*---------------------------------*/
/*--------------TIMERS-------------*/
#if defined(FF_PIKOF4OSD)
#define USABLE_TIMER_CHANNEL_COUNT 7
#define USED_TIMERS ( TIM_N(1) | TIM_N(3) | TIM_N(5) | TIM_N(8) )
#else
#define USABLE_TIMER_CHANNEL_COUNT 5
#define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) )
#endif
/*---------------------------------*/

View File

@ -5,4 +5,5 @@ TARGET_SRC = \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_mpu6500.c \
drivers/accgyro/accgyro_spi_mpu6500.c \
drivers/accgyro/accgyro_spi_icm20689.c
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/max7456.c