Skip to content

Commit 1086f9d

Browse files
Merge pull request #11497 from sensei-hacker/target/paurcf405v2
Add new target: PAURCF405V2
2 parents d2ac268 + c49b564 commit 1086f9d

4 files changed

Lines changed: 243 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f405xg(PAURCF405V2)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
#include "platform.h"
20+
#include "fc/fc_msp_box.h"
21+
#include "fc/config.h"
22+
#include "io/piniobox.h"
23+
24+
void targetConfiguration(void)
25+
{
26+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
27+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
28+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdbool.h>
19+
#include <platform.h>
20+
#include "drivers/bus.h"
21+
#include "drivers/io.h"
22+
#include "drivers/pwm_mapping.h"
23+
#include "drivers/timer.h"
24+
#include "drivers/sensor.h"
25+
#include "drivers/timer_def_stm32f4xx.h"
26+
27+
timerHardware_t timerHardware[] = {
28+
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // S1 D(2,7,7) UP217
29+
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0), // S2 D(2,2,0) UP217
30+
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_OUTPUT_AUTO, 0, 0), // S3 D(2,6,0) UP256
31+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 2), // S4 D(2,3,6) UP256
32+
33+
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 0), // S5 D(1,7,3) UP173
34+
DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 D(1,1,3) UP173
35+
DEF_TIM(TIM2, CH2, PB3, TIM_USE_OUTPUT_AUTO, 0, 0), // S7 D(1,6,3) UP173
36+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // S8 D(1,5,3) UP173
37+
38+
DEF_TIM(TIM12, CH1, PB14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9 DMA NONE
39+
DEF_TIM(TIM13, CH1, PA6, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA NONE
40+
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S11 D(1,0,2)
41+
42+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_LED, 0, 0), // 2812LED D(1,2,5)
43+
DEF_TIM(TIM11, CH1, PB9, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
44+
45+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_ANY, 0, 0), //TX2 softserial1_Tx ISR-driven, does not use DMA1_Stream0
46+
};
47+
48+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
#define USE_TARGET_CONFIG
20+
21+
#define TARGET_BOARD_IDENTIFIER "PA42"
22+
#define USBD_PRODUCT_STRING "PauRcF405v2"
23+
24+
#define LED0 PA14 //Blue
25+
#define LED1 PA13 //Green
26+
27+
#define BEEPER PB9
28+
#define BEEPER_INVERTED
29+
#define BEEPER_PWM_FREQUENCY 2500
30+
31+
// *************** SPI1 IMU & OSD *******************
32+
#define USE_SPI
33+
#define USE_SPI_DEVICE_1
34+
35+
#define SPI1_SCK_PIN PA5
36+
#define SPI1_MISO_PIN PB4
37+
#define SPI1_MOSI_PIN PA7
38+
39+
// Board ships with either ICM42605/ICM42688P or BMI270 - same CS pin (PC14)
40+
#define USE_IMU_ICM42605
41+
#define IMU_ICM42605_ALIGN CW0_DEG
42+
#define ICM42605_SPI_BUS BUS_SPI1
43+
#define ICM42605_CS_PIN PC14
44+
45+
#define USE_IMU_BMI270
46+
#define IMU_BMI270_ALIGN CW180_DEG
47+
#define BMI270_SPI_BUS BUS_SPI1
48+
#define BMI270_CS_PIN PC14
49+
50+
51+
52+
#define USE_MAX7456
53+
#define MAX7456_SPI_BUS BUS_SPI1
54+
#define MAX7456_CS_PIN PB12
55+
56+
// *************** SPI2 Flash ****************
57+
#define USE_SPI_DEVICE_2
58+
#define SPI2_SCK_PIN PB13
59+
#define SPI2_MISO_PIN PC2
60+
#define SPI2_MOSI_PIN PC3
61+
62+
#define USE_FLASHFS
63+
#define USE_FLASH_M25P16
64+
#define M25P16_SPI_BUS BUS_SPI2
65+
#define M25P16_CS_PIN PC13
66+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
67+
68+
// *************** I2C /Baro/Mag *********************
69+
#define USE_I2C
70+
#define USE_I2C_DEVICE_1
71+
#define I2C1_SCL PB8
72+
#define I2C1_SDA PB7
73+
74+
#define USE_BARO
75+
#define BARO_I2C_BUS BUS_I2C1
76+
#define USE_BARO_BMP280
77+
#define USE_BARO_MS5611
78+
#define USE_BARO_DPS310
79+
#define USE_BARO_SPL06
80+
81+
#define USE_MAG
82+
#define MAG_I2C_BUS BUS_I2C1
83+
#define USE_MAG_ALL
84+
85+
#define USE_RANGEFINDER
86+
#define RANGEFINDER_I2C_BUS BUS_I2C1
87+
#define PITOT_I2C_BUS BUS_I2C1
88+
#define TEMPERATURE_I2C_BUS BUS_I2C1
89+
90+
// *************** UART *****************************
91+
#define USE_VCP
92+
93+
#define USE_UART1
94+
#define UART1_TX_PIN PA9
95+
#define UART1_RX_PIN PA10
96+
97+
#define USE_UART2
98+
#define UART2_TX_PIN PA2
99+
#define UART2_RX_PIN PA3
100+
101+
#define USE_UART3
102+
#define UART3_TX_PIN PC10
103+
#define UART3_RX_PIN PC11
104+
105+
#define USE_UART4
106+
#define UART4_TX_PIN PA0
107+
#define UART4_RX_PIN PA1
108+
109+
#define USE_UART5
110+
#define UART5_TX_PIN PC12
111+
#define UART5_RX_PIN PD2
112+
113+
#define USE_UART6
114+
#define UART6_TX_PIN PC6
115+
#define UART6_RX_PIN PC7
116+
117+
#define USE_SOFTSERIAL1
118+
#define SOFTSERIAL_1_TX_PIN PA2 // Shared with UART2_TX - mutually exclusive with UART2
119+
#define SOFTSERIAL_1_RX_PIN PA2 // Shared with UART2_TX - mutually exclusive with UART2
120+
121+
#define SERIAL_PORT_COUNT 8
122+
123+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
124+
#define SERIALRX_PROVIDER SERIALRX_CRSF
125+
#define SERIALRX_UART SERIAL_PORT_USART2
126+
127+
// *************** ADC ***************************
128+
#define USE_ADC
129+
#define ADC_INSTANCE ADC1
130+
#define ADC1_DMA_STREAM DMA2_Stream4
131+
#define ADC_CHANNEL_1_PIN PC4
132+
#define ADC_CHANNEL_2_PIN PC5
133+
#define ADC_CHANNEL_3_PIN PB0
134+
#define ADC_CHANNEL_4_PIN PC0
135+
#define VBAT_ADC_CHANNEL ADC_CHN_1
136+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
137+
#define RSSI_ADC_CHANNEL ADC_CHN_3
138+
#define AIRSPEED_ADC_CHANNEL ADC_CHN_4
139+
140+
// *************** PINIO ***************************
141+
#define USE_PINIO
142+
#define USE_PINIOBOX
143+
#define PINIO1_PIN PA4
144+
#define PINIO2_PIN PB5
145+
146+
// *************** LEDSTRIP ************************
147+
#define USE_LED_STRIP
148+
#define WS2811_PIN PB1
149+
150+
// *************** others ************************
151+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
152+
#define VBAT_SCALE_DEFAULT 2100
153+
#define CURRENT_METER_SCALE 150
154+
155+
#define TARGET_IO_PORTA 0xffff
156+
#define TARGET_IO_PORTB 0xffff
157+
#define TARGET_IO_PORTC 0xffff
158+
#define TARGET_IO_PORTD (BIT(2))
159+
160+
#define MAX_PWM_OUTPUT_PORTS 11
161+
162+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
163+
#define USE_DSHOT
164+
#define USE_DSHOT_DMAR
165+
#define USE_ESC_SENSOR
166+

0 commit comments

Comments
 (0)