Skip to content

Commit 9db7d61

Browse files
authored
Merge pull request #10070 from HishamGhosheh/jhef05pro
Add JHEF405PRO (aka GHF405AIO-HD) support
2 parents 2efebc3 + e37ed9f commit 9db7d61

File tree

3 files changed

+189
-0
lines changed

3 files changed

+189
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f405xg(JHEF405PRO SKIP_RELEASES)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
4+
* Cleanflight 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+
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdbool.h>
19+
#include <platform.h>
20+
#include "drivers/io.h"
21+
#include "drivers/pwm_mapping.h"
22+
#include "drivers/timer.h"
23+
24+
timerHardware_t timerHardware[] = {
25+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // S1
26+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // S2
27+
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1), // S3
28+
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MOTOR, 0, 0), // S4
29+
30+
DEF_TIM(TIM4, CH3, PB8, TIM_USE_PPM, 0, 0), // PPM
31+
DEF_TIM(TIM1, CH2, PA9, TIM_USE_LED, 0, 1 ), //LED
32+
};
33+
34+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* This is free software: you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License as published by
4+
* the Free Software Foundation, either version 3 of the License, or
5+
* (at your option) any later version.
6+
*
7+
* This software is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* GNU General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU General Public License
13+
* along with this software. If not, see <http://www.gnu.org/licenses/>.
14+
*/
15+
16+
#pragma once
17+
18+
#define TARGET_BOARD_IDENTIFIER "JHEF405PRO"
19+
#define USBD_PRODUCT_STRING "JHEF405PRO"
20+
21+
#define LED0 PC14
22+
#define BEEPER PC13
23+
#define BEEPER_INVERTED
24+
25+
// *************** SPI1 Gyro & ACC **********************
26+
#define USE_SPI
27+
#define USE_SPI_DEVICE_1
28+
29+
#define SPI1_SCK_PIN PA5
30+
#define SPI1_MISO_PIN PA6
31+
#define SPI1_MOSI_PIN PA7
32+
33+
#define USE_IMU_ICM42605
34+
#define IMU_ICM42605_ALIGN CW90_DEG
35+
#define ICM42605_CS_PIN PB12
36+
#define ICM42605_SPI_BUS BUS_SPI1
37+
38+
#define USE_EXTI
39+
#define GYRO_INT_EXTI PB13
40+
#define USE_MPU_DATA_READY_SIGNAL
41+
42+
// *************** SPI3 OSD & Flash ***************************
43+
#define USE_SPI_DEVICE_3
44+
#define SPI3_SCK_PIN PC10
45+
#define SPI3_MISO_PIN PC11
46+
#define SPI3_MOSI_PIN PC12
47+
48+
// OSD
49+
#define USE_OSD
50+
#define USE_MAX7456
51+
#define MAX7456_SPI_BUS BUS_SPI3
52+
#define MAX7456_CS_PIN PB14
53+
54+
// Flash
55+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
56+
#define USE_FLASHFS
57+
#define USE_FLASH_M25P16
58+
#define M25P16_CS_PIN PB3
59+
#define M25P16_SPI_BUS BUS_SPI3
60+
61+
// *************** I2C /Baro/Mag *********************
62+
#define USE_I2C
63+
#define USE_I2C_DEVICE_1
64+
#define I2C1_SCL PB8
65+
#define I2C1_SDA PB9
66+
#define DEFAULT_I2C_BUS BUS_I2C1
67+
68+
// Baro
69+
#define USE_BARO
70+
#define BARO_I2C_BUS DEFAULT_I2C_BUS
71+
#define USE_BARO_DPS310
72+
73+
// Mag
74+
#define USE_MAG
75+
#define USE_MAG_ALL
76+
#define MAG_I2C_BUS DEFAULT_I2C_BUS
77+
78+
// Temperature
79+
#define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
80+
81+
// Range finder
82+
#define USE_RANGEFINDER
83+
#define USE_RANGEFINDER_HCSR04_I2C
84+
#define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
85+
86+
// PITOT
87+
#define PITOT_I2C_BUS DEFAULT_I2C_BUS
88+
89+
// *************** UART *****************************
90+
#define USB_IO
91+
#define USE_VCP
92+
#define VBUS_SENSING_PIN PA8 // TODO validate
93+
#define VBUS_SENSING_ENABLED
94+
95+
#define USE_UART1
96+
#define UART1_RX_PIN PA10
97+
#define UART1_TX_PIN PB6
98+
99+
#define USE_UART2
100+
#define UART2_RX_PIN PD6
101+
#define UART2_TX_PIN PD5
102+
103+
#define USE_UART3
104+
#define UART3_RX_PIN PB11
105+
#define UART3_TX_PIN PB10
106+
107+
#define USE_UART4
108+
#define UART4_RX_PIN PA1
109+
#define UART4_TX_PIN PA0
110+
111+
#define USE_UART6
112+
#define UART6_RX_PIN PC7
113+
#define UART6_TX_PIN PC6
114+
115+
#define SERIAL_PORT_COUNT 6
116+
117+
// *************** ADC ***************************
118+
#define USE_ADC
119+
#define ADC_INSTANCE ADC1
120+
#define ADC1_DMA_STREAM DMA2_Stream0
121+
#define ADC_CHANNEL_1_PIN PC3
122+
#define ADC_CHANNEL_2_PIN PC2
123+
#define ADC_CHANNEL_3_PIN PC0
124+
#define VBAT_ADC_CHANNEL ADC_CHN_1
125+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
126+
#define RSSI_ADC_CHANNEL ADC_CHN_3
127+
#define CURRENT_METER_SCALE 250
128+
129+
// *************** OTHERS *************************
130+
#define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_OSD | FEATURE_TELEMETRY)
131+
132+
// Rx defaults
133+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
134+
#define SERIALRX_PROVIDER SERIALRX_CRSF
135+
#define SERIALRX_UART SERIAL_PORT_USART2
136+
137+
138+
// *************** LED2812 ************************
139+
#define USE_LED_STRIP
140+
#define WS2811_PIN PA9
141+
142+
143+
144+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
145+
146+
#define TARGET_IO_PORTA 0xffff
147+
#define TARGET_IO_PORTB 0xffff
148+
#define TARGET_IO_PORTC 0xffff
149+
#define TARGET_IO_PORTD 0xffff
150+
151+
//TIMER
152+
#define MAX_PWM_OUTPUT_PORTS 4
153+
154+
#define USE_DSHOT

0 commit comments

Comments
 (0)