Skip to content

Commit 5233d25

Browse files
committed
Target: Add JHEMCUF405WING, JHEMCUF745, JHEMCUH743HD board
1 parent 23967cb commit 5233d25

File tree

11 files changed

+777
-0
lines changed

11 files changed

+777
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f405xg(JHEMCUF405WING)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*
8+
* Alternatively, the contents of this file may be used under the terms
9+
* of the GNU General Public License Version 3, as described below:
10+
*
11+
* This file is free software: you may copy, redistribute and/or modify
12+
* it under the terms of the GNU General Public License as published by the
13+
* Free Software Foundation, either version 3 of the License, or (at your
14+
* option) any later version.
15+
*
16+
* This file is distributed in the hope that it will be useful, but
17+
* WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19+
* Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with this program. If not, see http://www.gnu.org/licenses/.
23+
*/
24+
25+
#include <stdbool.h>
26+
#include <stdint.h>
27+
28+
#include "platform.h"
29+
30+
#include "fc/fc_msp_box.h"
31+
#include "fc/config.h"
32+
#include "io/serial.h"
33+
#include "io/piniobox.h"
34+
35+
void targetConfiguration(void)
36+
{
37+
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_RX_SERIAL;
38+
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART3)].functionMask = FUNCTION_GPS;
39+
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_MSP;
40+
41+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
42+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
#include <stdint.h>
18+
#include <stdbool.h>
19+
#include <platform.h>
20+
21+
#include "drivers/bus.h"
22+
#include "drivers/io.h"
23+
#include "drivers/pwm_mapping.h"
24+
#include "drivers/timer.h"
25+
#include "drivers/pinio.h"
26+
#include "drivers/sensor.h"
27+
28+
timerHardware_t timerHardware[] = {
29+
DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 1, 0), // S1 D(1,3,2)
30+
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 1, 0), // S2 D(1,0,2)
31+
32+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 1, 0), // S3 D(1,7,5)
33+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 1, 0), // S4 D(1,2,5)
34+
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 1, 0), // S5 D(2,4,7)
35+
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 1, 0), // S6 D(2,7,7)
36+
37+
DEF_TIM(TIM8, CH2N,PB14, TIM_USE_OUTPUT_AUTO, 1, 0), // S7
38+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 1, 0), // S8
39+
DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 1, 0), // S9
40+
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 1, 0), // S10
41+
DEF_TIM(TIM1, CH3N,PB15, TIM_USE_OUTPUT_AUTO, 1, 0), // S11
42+
43+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0), //2812LED D(1,5,3)
44+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_ANY, 0, 0), //TX2 softserial1_Tx
45+
};
46+
47+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
20+
#define USE_TARGET_CONFIG
21+
22+
#define TARGET_BOARD_IDENTIFIER "JH45"
23+
#define USBD_PRODUCT_STRING "JHEMCUF405WING"
24+
25+
// LEDs
26+
#define LED0 PA14 //Blue
27+
#define LED1 PA13 //Green
28+
29+
// Beeper
30+
#define BEEPER PC15
31+
#define BEEPER_INVERTED
32+
33+
// SPI1
34+
#define USE_SPI
35+
#define USE_SPI_DEVICE_1
36+
#define SPI1_SCK_PIN PA5
37+
#define SPI1_MISO_PIN PA6
38+
#define SPI1_MOSI_PIN PA7
39+
40+
// SPI2
41+
#define USE_SPI_DEVICE_2
42+
#define SPI2_SCK_PIN PB13
43+
#define SPI2_MISO_PIN PC2
44+
#define SPI2_MOSI_PIN PC3
45+
46+
// SPI3
47+
#define USE_SPI_DEVICE_3
48+
#define SPI3_SCK_PIN PB3
49+
#define SPI3_MISO_PIN PB4
50+
#define SPI3_MOSI_PIN PB5
51+
52+
// Serial ports
53+
#define USE_VCP
54+
55+
#define USE_UART1
56+
#define UART1_TX_PIN PA9
57+
#define UART1_RX_PIN PA10
58+
59+
#define USE_UART2
60+
#define UART2_TX_PIN PA2
61+
#define UART2_RX_PIN PA3
62+
63+
#define USE_UART3
64+
#define UART3_TX_PIN PC10
65+
#define UART3_RX_PIN PC11
66+
67+
#define USE_UART4
68+
#define UART4_TX_PIN PA0
69+
#define UART4_RX_PIN PA1
70+
71+
#define USE_UART5
72+
#define UART5_TX_PIN PC12
73+
#define UART5_RX_PIN PD2
74+
75+
#define USE_UART6
76+
#define UART6_TX_PIN PC6
77+
#define UART6_RX_PIN PC7
78+
79+
// Optional Softserial on UART2 TX Pin PA2
80+
#define USE_SOFTSERIAL1
81+
#define SOFTSERIAL_1_TX_PIN PA2
82+
#define SOFTSERIAL_1_RX_PIN PA2
83+
84+
#define SERIAL_PORT_COUNT 8
85+
86+
#define USE_I2C
87+
#define USE_I2C_DEVICE_1
88+
#define I2C1_SCL PB8
89+
#define I2C1_SDA PB9
90+
91+
// ICM42605/ICM42688P
92+
#define USE_IMU_ICM42605
93+
#define IMU_ICM42605_ALIGN CW270_DEG
94+
#define ICM42605_CS_PIN PA4
95+
#define ICM42605_SPI_BUS BUS_SPI1
96+
97+
// Baro
98+
#define USE_BARO
99+
#define BARO_I2C_BUS BUS_I2C1
100+
#define USE_BARO_ALL
101+
102+
// Mag
103+
#define USE_MAG
104+
#define MAG_I2C_BUS BUS_I2C1
105+
#define USE_MAG_ALL
106+
107+
#define RANGEFINDER_I2C_BUS BUS_I2C1
108+
#define PITOT_I2C_BUS BUS_I2C1
109+
#define TEMPERATURE_I2C_BUS BUS_I2C1
110+
111+
// OSD
112+
#define USE_MAX7456
113+
#define MAX7456_CS_PIN PB12
114+
#define MAX7456_SPI_BUS BUS_SPI2
115+
116+
// SD Card
117+
#define USE_SDCARD
118+
#define USE_SDCARD_SPI
119+
#define SDCARD_SPI_BUS BUS_SPI3
120+
#define SDCARD_CS_PIN PC14
121+
122+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
123+
124+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
125+
#define SERIALRX_PROVIDER SERIALRX_CRSF
126+
#define SERIALRX_UART SERIAL_PORT_USART1
127+
128+
// ADC
129+
#define USE_ADC
130+
#define ADC_INSTANCE ADC1
131+
#define ADC1_DMA_STREAM DMA2_Stream0
132+
#define ADC_CHANNEL_1_PIN PC0
133+
#define ADC_CHANNEL_2_PIN PC1
134+
#define ADC_CHANNEL_3_PIN PC5
135+
#define ADC_CHANNEL_4_PIN PC4
136+
#define VBAT_ADC_CHANNEL ADC_CHN_1
137+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
138+
#define RSSI_ADC_CHANNEL ADC_CHN_4
139+
#define AIRSPEED_ADC_CHANNEL ADC_CHN_3
140+
141+
// LED2812
142+
#define USE_LED_STRIP
143+
#define WS2811_PIN PA8
144+
145+
// PINIO
146+
#define USE_PINIO
147+
#define USE_PINIOBOX
148+
#define PINIO1_PIN PC13 // 2xCamera switcher
149+
150+
// OTHERS
151+
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_BLACKBOX | FEATURE_AIRMODE)
152+
#define CURRENT_METER_SCALE 175
153+
154+
#define USE_DSHOT
155+
#define USE_ESC_SENSOR
156+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
157+
158+
#define TARGET_IO_PORTA 0xffff
159+
#define TARGET_IO_PORTB 0xffff
160+
#define TARGET_IO_PORTC 0xffff
161+
#define TARGET_IO_PORTD (BIT(2))
162+
163+
#define MAX_PWM_OUTPUT_PORTS 11
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f745xg(JHEMCUF745)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*
8+
* Alternatively, the contents of this file may be used under the terms
9+
* of the GNU General Public License Version 3, as described below:
10+
*
11+
* This file is free software: you may copy, redistribute and/or modify
12+
* it under the terms of the GNU General Public License as published by the
13+
* Free Software Foundation, either version 3 of the License, or (at your
14+
* option) any later version.
15+
*
16+
* This file is distributed in the hope that it will be useful, but
17+
* WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19+
* Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with this program. If not, see http://www.gnu.org/licenses/.
23+
*/
24+
25+
#include <platform.h>
26+
#include "drivers/io.h"
27+
#include "drivers/pwm_mapping.h"
28+
#include "drivers/timer.h"
29+
#include "drivers/bus.h"
30+
#include "drivers/pinio.h"
31+
32+
timerHardware_t timerHardware[] = {
33+
DEF_TIM(TIM1, CH3, PE13, TIM_USE_PPM, 0, 1), // PPM, DMA2_ST6
34+
35+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // M1, DMA1_ST7
36+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // M2, DMA1_ST2
37+
DEF_TIM(TIM1, CH1, PE9, TIM_USE_OUTPUT_AUTO, 0, 2), // M3, DMA2_ST2
38+
DEF_TIM(TIM1, CH2, PE11, TIM_USE_OUTPUT_AUTO, 0, 1), // M4, DMA2_ST4
39+
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // M5, DMA2_ST7
40+
DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0), // M6, DMA1_ST1
41+
DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // S7
42+
DEF_TIM(TIM3, CH2, PB5, TIM_USE_OUTPUT_AUTO, 0, 0), // S8
43+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_LED, 0, 0), // LED_STRIP, DMA1_ST0
44+
};
45+
46+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

0 commit comments

Comments
 (0)