1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 01:05:21 +03:00

Add PINIO 3 & 4

There are plenty of flight controllers around now that use PINIO 1 and 2 internally for camera switching and switchable VTx power. This left no scope for user definable PINIO. A friend wanted to control a Caddx Peanut on such an FC. So I have implemented USER 3 and USER 4 PINIO options. Also in the PR is the target that was created for my friend.
This commit is contained in:
Darren Lines 2022-09-17 08:27:44 +01:00
parent 1c681a6f80
commit fca5a0eac7
9 changed files with 41 additions and 5 deletions

View file

@ -0,0 +1,16 @@
# Board - MATEKSYS F722-PX/WPX/HD
## Vendor Information / specification
http://www.mateksys.com/?portfolio=f722-px
http://www.mateksys.com/?portfolio=f722-wpx
http://www.mateksys.com/?portfolio=f722-hd
## Firmware
Three firmware variants are available.
* `inav_x.y.z_MATEKF722PX.hex`
* `inav_x.y.z_MATEKF722WPX.hex`
* `inav_x.y.z_MATEKF722PX_PINIO.hex`
The WPX vairant is for the MATEK F722-WPX wing flight controller. The PX variants are for the MATEK F722-PX and MATEK F722-HD flight controllers. The PINIO variant adds USER 3 PINIO as a replacement to UART 5 (TX)

View file

@ -84,9 +84,11 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ .boxId = BOXOSDALT3, .boxName = "OSD ALT 3", .permanentId = 44 },
{ .boxId = BOXNAVCOURSEHOLD, .boxName = "NAV COURSE HOLD", .permanentId = 45 },
{ .boxId = BOXBRAKING, .boxName = "MC BRAKING", .permanentId = 46 },
{ .boxId = BOXUSER1, .boxName = "USER1", .permanentId = BOX_PERMANENT_ID_USER1 },
{ .boxId = BOXUSER2, .boxName = "USER2", .permanentId = BOX_PERMANENT_ID_USER2 },
{ .boxId = BOXUSER3, .boxName = "USER3", .permanentId = BOX_PERMANENT_ID_USER3 },
{ .boxId = BOXUSER1, .boxName = "USER1", .permanentId = BOX_PERMANENT_ID_USER1 }, // 47
{ .boxId = BOXUSER2, .boxName = "USER2", .permanentId = BOX_PERMANENT_ID_USER2 }, // 48
{ .boxId = BOXUSER3, .boxName = "USER3", .permanentId = BOX_PERMANENT_ID_USER3 }, // 57
{ .boxId = BOXUSER4, .boxName = "USER4", .permanentId = BOX_PERMANENT_ID_USER4 }, // 58
{ .boxId = BOXLOITERDIRCHN, .boxName = "LOITER CHANGE", .permanentId = 49 },
{ .boxId = BOXMSPRCOVERRIDE, .boxName = "MSP RC OVERRIDE", .permanentId = 50 },
{ .boxId = BOXPREARM, .boxName = "PREARM", .permanentId = 51 },
{ .boxId = BOXTURTLE, .boxName = "TURTLE", .permanentId = 52 },
@ -94,7 +96,6 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ .boxId = BOXAUTOLEVEL, .boxName = "AUTO LEVEL", .permanentId = 54 },
{ .boxId = BOXPLANWPMISSION, .boxName = "WP PLANNER", .permanentId = 55 },
{ .boxId = BOXSOARING, .boxName = "SOARING", .permanentId = 56 },
{ .boxId = BOXLOITERDIRCHN, .boxName = "LOITER CHANGE", .permanentId = 57 },
{ .boxId = CHECKBOX_ITEM_COUNT, .boxName = NULL, .permanentId = 0xFF }
};
@ -315,6 +316,7 @@ void initActiveBoxIds(void)
ADD_ACTIVE_BOX(BOXUSER1);
ADD_ACTIVE_BOX(BOXUSER2);
ADD_ACTIVE_BOX(BOXUSER3);
ADD_ACTIVE_BOX(BOXUSER4);
#endif
#if defined(USE_OSD) && defined(OSD_LAYOUT_COUNT)
@ -393,6 +395,7 @@ void packBoxModeFlags(boxBitmask_t * mspBoxModeFlags)
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXUSER1)), BOXUSER1);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXUSER2)), BOXUSER2);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXUSER3)), BOXUSER3);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXUSER4)), BOXUSER4);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLOITERDIRCHN)), BOXLOITERDIRCHN);
#if defined(USE_RX_MSP) && defined(USE_MSP_RC_OVERRIDE)
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXMSPRCOVERRIDE)), BOXMSPRCOVERRIDE);

View file

@ -75,6 +75,7 @@ typedef enum {
BOXPLANWPMISSION = 46,
BOXSOARING = 47,
BOXUSER3 = 48,
BOXUSER4 = 49,
CHECKBOX_ITEM_COUNT
} boxId_e;

View file

@ -29,7 +29,8 @@
#define BOX_PERMANENT_ID_USER1 47
#define BOX_PERMANENT_ID_USER2 48
#define BOX_PERMANENT_ID_USER3 49
#define BOX_PERMANENT_ID_USER3 57
#define BOX_PERMANENT_ID_USER4 58
#define BOX_PERMANENT_ID_NONE 255 // A permanent ID for no box mode

View file

@ -688,6 +688,10 @@ static int logicConditionGetFlightModeOperandValue(int operand) {
return IS_RC_MODE_ACTIVE(BOXUSER3);
break;
case LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER4:
return IS_RC_MODE_ACTIVE(BOXUSER4);
break;
default:
return 0;
break;

View file

@ -148,6 +148,7 @@ typedef enum {
LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER2, // 10
LOGIC_CONDITION_OPERAND_FLIGHT_MODE_COURSE_HOLD, // 11
LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER3, // 12
LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER4, // 13
} logicFlightModeOperands_e;
typedef enum {

View file

@ -1,2 +1,3 @@
target_stm32f722xe(MATEKF722PX)
target_stm32f722xe(MATEKF722PX_PINIO)
target_stm32f722xe(MATEKF722WPX)

View file

@ -31,6 +31,9 @@ void targetConfiguration(void)
{
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
#ifdef MATEKF722PX_PINIO
pinioBoxConfigMutable()->permanentId[2] = BOX_PERMANENT_ID_USER3;
#endif
serialConfigMutable()->portConfigs[6].functionMask = FUNCTION_FRSKY_OSD;
}

View file

@ -115,9 +115,11 @@
#define UART4_TX_PIN PA0
#define UART4_RX_PIN PA1
#ifndef MATEKF722PX_PINIO
#define USE_UART5
#define UART5_TX_PIN PC12
#define UART5_RX_PIN PD2
#endif
#define USE_UART6
#define UART6_TX_PIN PC6
@ -154,6 +156,10 @@
#define PINIO1_PIN PA15 // Power switch
#define PINIO2_PIN PB3 // Camera switch
#ifdef MATEKF722PX_PINIO
#define PINIO3_PIN PC12 // UART 5 TX - USER 3 PINIO
#endif
// *************** LEDSTRIP ************************
#define USE_LED_STRIP
#define WS2811_PIN PA8