Merge pull request #7020 from conkerkh/PIRX

Add Pirx F4 target.
This commit is contained in:
Michael Keller 2018-11-15 07:00:28 +13:00 committed by GitHub
commit fd35d871d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 7 deletions

View File

View File

@ -28,7 +28,12 @@
#include "drivers/timer_def.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
#if defined(PIRXF4)
DEF_TIM(TIM3, CH1, PB4, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - TIM3_UP - BURST
DEF_TIM(TIM3, CH2, PB5, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - TIM3_UP - BURST
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0 ), // S3_OUT - TIM2_UP - BURST
DEF_TIM(TIM4, CH4, PB9, TIM_USE_MOTOR, 0, 0 ), // S4_OUT - TIM2_UP - BURST
#else
DEF_TIM(TIM4, CH4, PB9, TIM_USE_PPM, 1, 0 ), // PPM IN
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - TIM3_UP - BURST
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - TIM3_UP - BURST
@ -36,5 +41,6 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), // S4_OUT - TIM2_UP - BURST
DEF_TIM(TIM1, CH3, PA10, TIM_USE_MOTOR | TIM_USE_LED, 0, 1 ), // S5_OUT - TIM1_UP - BURST
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0, 1 ), // S6_OUT - TIM1_UP - BURST
#endif
};

View File

@ -20,51 +20,97 @@
#pragma once
#if defined(PIRXF4)
#define TARGET_BOARD_IDENTIFIER "PIRX"
#define USBD_PRODUCT_STRING "Pirx F4"
#else
#define TARGET_BOARD_IDENTIFIER "RRF4"
#define USBD_PRODUCT_STRING "Worm FC"
#endif
//LEDs
#if defined(PIRXF4)
#define LED0_PIN PC13
#define LED1_PIN PC14
#else
#define LED0_PIN PA15
#define LED1_PIN PC14
#endif
#define ENABLE_DSHOT_DMAR true
//define camera control
#if defined(PIRXF4)
#define USE_CAMERA_CONTROL
#define CAMERA_CONTROL_PIN PA4
#endif
//BEEPER
#define USE_BEEPER
#if defined(PIRXF4)
#define BEEPER_PIN PA15
#else
#define BEEPER_PIN PB14
#endif
#define BEEPER_INVERTED
// MPU6500 interrupt
#define USE_EXTI
#define USE_GYRO_EXTI
#if defined(PIRXF4)
#define GYRO_1_EXTI_PIN PC5
#else
#define GYRO_1_EXTI_PIN PC4
#endif
#define USE_MPU_DATA_READY_SIGNAL
//#define DEBUG_MPU_DATA_READY_INTERRUPT
#define GYRO_1_CS_PIN PA4
#define GYRO_1_SPI_INSTANCE SPI1
#if defined(PIRXF4)
#define GYRO_1_CS_PIN PC4
#else
#define GYRO_1_CS_PIN PA4
#endif
#define GYRO_1_SPI_INSTANCE SPI1
// ACC section -- start
#define USE_ACC
#define USE_ACC_SPI_MPU6500
#define ACC_1_ALIGN CW180_DEG_FLIP
#if defined(PIRXF4)
#define ACC_1_ALIGN CW0_DEG
#else
#define ACC_1_ALIGN CW180_DEG_FLIP
#endif
// ACC section -- end
// GYRO section -- start
#define USE_GYRO
#define USE_GYRO_SPI_MPU6500
#define GYRO_1_ALIGN CW180_DEG_FLIP
#if defined(PIRXF4)
#define GYRO_1_ALIGN CW0_DEG
#else
#define GYRO_1_ALIGN CW180_DEG_FLIP
#endif
// GYRO section -- end
//BARO
#if !defined(PIRXF4)
#define USE_BARO
#define USE_BARO_SPI_LPS
#define LPS_SPI_INSTANCE SPI3
#define LPS_CS_PIN PB8
#endif
//UARTs
#if defined(PIRXF4)
#define INVERTER_PIN_UART6 PA8
#define INVERTER_PIN_UART3 PB1
#else
#define INVERTER_PIN_UART6 PB13
#define INVERTER_PIN_UART3 PB12
#endif
#define USE_VCP
#define USB_DETECT_PIN PA9
@ -74,6 +120,12 @@
#define UART1_RX_PIN PB7
#define UART1_TX_PIN PB6
#if defined(PIRXF4)
#define USE_UART2
#define UART2_RX_PIN PA3
#define UART2_TX_PIN PA2
#endif
#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10
@ -86,7 +138,11 @@
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#if defined(PIRXF4)
#define SERIAL_PORT_COUNT 6 //VCP, USART1, USART2, USART3, USART4, USART6
#else
#define SERIAL_PORT_COUNT 5 //VCP, USART1, USART3, USART4, USART6
#endif
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PB9
@ -96,24 +152,39 @@
#define USE_SPI_DEVICE_1
#if defined(PIRXF4)
#define USE_SPI_DEVICE_2
#else
#define USE_SPI_DEVICE_3
#define SPI3_SCK_PIN PB3
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5
#endif
//OSD
#define USE_MAX7456
#if defined(PIRXF4)
#define MAX7456_SPI_INSTANCE SPI2
#define MAX7456_SPI_CS_PIN PB12
#else
#define MAX7456_SPI_INSTANCE SPI3
#define MAX7456_SPI_CS_PIN PC0
#endif
#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz
#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
#define USE_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define BOARD_HAS_VOLTAGE_DIVIDER
#if defined(PIRXF4)
#define VBAT_ADC_PIN PC2
#define RSSI_ADC_PIN PC1
#define CURRENT_METER_ADC_PIN PC3
#else
#define VBAT_ADC_PIN PC1
//#define RSSI_ADC_PIN PC2
#define CURRENT_METER_ADC_PIN PC2
#endif
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_SBUS
@ -127,7 +198,11 @@
#define SDIO_DMA DMA2_Stream3
#define SDCARD_SPI_CS_PIN NONE //This is not used on SDIO, has to be kept for now to keep compiler happy
#if defined(PIRXF4)
#define SDCARD_DETECT_PIN PC15
#else
#define SDCARD_DETECT_PIN PB15
#endif
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff