mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
PORT103R - Initial support for the Waveshare Port 103R development
board.
This commit is contained in:
parent
848a35ff40
commit
d0f622bb81
5 changed files with 117 additions and 5 deletions
|
@ -69,7 +69,7 @@ enum {
|
|||
MAP_TO_SERVO_OUTPUT,
|
||||
};
|
||||
|
||||
#if defined(NAZE) || defined(OLIMEXINO) || defined(NAZE32PRO) || defined(STM32F3DISCOVERY) || defined(EUSTM32F103RC) || defined(MASSIVEF3)
|
||||
#if defined(NAZE) || defined(OLIMEXINO) || defined(NAZE32PRO) || defined(STM32F3DISCOVERY) || defined(EUSTM32F103RC) || defined(MASSIVEF3) || defined(PORT103R)
|
||||
static const uint16_t multiPPM[] = {
|
||||
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
|
||||
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
TIM4 4 channels
|
||||
*/
|
||||
|
||||
#if defined(CJMCU) || defined(EUSTM32F103RC) || defined(NAZE) || defined(OLIMEXINO)
|
||||
#if defined(CJMCU) || defined(EUSTM32F103RC) || defined(NAZE) || defined(OLIMEXINO) || defined(PORT103R)
|
||||
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
|
||||
{ TIM2, GPIOA, Pin_0, TIM_Channel_1, TIM2_IRQn, 0, Mode_IPD}, // PWM1
|
||||
{ TIM2, GPIOA, Pin_1, TIM_Channel_2, TIM2_IRQn, 0, Mode_IPD}, // PWM2
|
||||
|
|
|
@ -39,7 +39,7 @@ int32_t sonarAlt = -1; // in cm , -1 indicate sonar is not in range
|
|||
|
||||
void Sonar_init(void)
|
||||
{
|
||||
#if defined(NAZE) || defined(EUSTM32F103RC)
|
||||
#if defined(NAZE) || defined(EUSTM32F103RC) || defined(PORT103R)
|
||||
static const sonarHardware_t const sonarPWM56 = {
|
||||
.trigger_pin = Pin_8, // PWM5 (PB8) - 5v tolerant
|
||||
.echo_pin = Pin_9, // PWM6 (PB9) - 5v tolerant
|
||||
|
|
109
src/main/target/PORT103R/target.h
Normal file
109
src/main/target/PORT103R/target.h
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* 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 "103R"
|
||||
|
||||
#define LED0_GPIO GPIOD
|
||||
#define LED0_PIN Pin_2 // PD2 (LED)
|
||||
#define LED0_PERIPHERAL RCC_APB2Periph_GPIOD
|
||||
|
||||
#define BEEP_GPIO GPIOA
|
||||
#define BEEP_PIN Pin_12 // PA12 (Beeper)
|
||||
#define BEEP_PERIPHERAL RCC_APB2Periph_GPIOA
|
||||
|
||||
#define BARO_XCLR_GPIO GPIOC
|
||||
#define BARO_XCLR_PIN Pin_13
|
||||
#define BARO_EOC_GPIO GPIOC
|
||||
#define BARO_EOC_PIN Pin_14
|
||||
#define BARO_APB2_PERIPHERALS RCC_APB2Periph_GPIOC
|
||||
|
||||
#define INVERTER_PIN Pin_2 // PB2 (BOOT1) abused as inverter select GPIO
|
||||
#define INVERTER_GPIO GPIOB
|
||||
#define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
|
||||
#define INVERTER_USART USART2
|
||||
|
||||
#define MPU6000_CS_GPIO GPIOB
|
||||
#define MPU6000_CS_PIN GPIO_Pin_12
|
||||
#define MPU6000_SPI_INSTANCE SPI2
|
||||
|
||||
#define MPU6500_CS_GPIO GPIOB
|
||||
#define MPU6500_CS_PIN GPIO_Pin_12
|
||||
#define MPU6500_SPI_INSTANCE SPI2
|
||||
|
||||
#define ACC
|
||||
#define USE_FAKE_ACC
|
||||
//#define USE_ACC_ADXL345
|
||||
//#define USE_ACC_BMA280
|
||||
//#define USE_ACC_MMA8452
|
||||
//#define USE_ACC_MPU3050
|
||||
#define USE_ACC_MPU6050
|
||||
//#define USE_ACC_SPI_MPU6000
|
||||
//#define USE_ACC_SPI_MPU6500
|
||||
|
||||
#define GYRO
|
||||
#define USE_FAKE_GYRO
|
||||
//#define USE_GYRO_L3G4200D
|
||||
//#define USE_GYRO_L3GD20
|
||||
//#define USE_GYRO_MPU3050
|
||||
#define USE_GYRO_MPU6050
|
||||
//#define USE_GYRO_SPI_MPU6000
|
||||
//#define USE_GYRO_SPI_MPU6500
|
||||
|
||||
#define BARO
|
||||
#define USE_BARO_MS5611
|
||||
//#define USE_BARO_BMP085
|
||||
|
||||
#define MAG
|
||||
#define SONAR
|
||||
#define BEEPER
|
||||
#define LED0
|
||||
#define INVERTER
|
||||
#define DISPLAY
|
||||
|
||||
#define USE_USART1
|
||||
#define USE_USART2
|
||||
#define USE_SOFTSERIAL1
|
||||
#define USE_SOFTSERIAL2
|
||||
#define SERIAL_PORT_COUNT 4
|
||||
|
||||
#define SOFTSERIAL_1_TIMER TIM3
|
||||
#define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
|
||||
#define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
|
||||
#define SOFTSERIAL_2_TIMER TIM3
|
||||
#define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
|
||||
#define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
|
||||
|
||||
#define USE_I2C
|
||||
#define I2C_DEVICE (I2CDEV_2)
|
||||
|
||||
// #define SOFT_I2C // enable to test software i2c
|
||||
// #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
|
||||
// #define SOFT_I2C_PB67
|
||||
|
||||
#define SENSORS_SET (SENSOR_ACC | SENSOR_BARO | SENSOR_MAG)
|
||||
|
||||
#define LED0
|
||||
#define GPS
|
||||
#define LED_STRIP
|
||||
#define LED_STRIP_TIMER TIM3
|
||||
|
||||
#define TELEMETRY
|
||||
#define SERIAL_RX
|
||||
#define AUTOTUNE
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue