1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

Merge remote-tracking branch 'bitbucket_mthread/thread/LP-104_HOTT_SUMD_Support_15.09' into LP-104_HoTT_wizard_next

This commit is contained in:
Laurent Lalanne 2015-12-21 00:13:52 +01:00
commit 5dadaa9199
9 changed files with 289 additions and 2 deletions

View File

@ -1054,6 +1054,95 @@ static const struct pios_usart_cfg pios_usart_srxl_flexi_cfg = {
}; };
#endif /* PIOS_INCLUDE_SRXL */ #endif /* PIOS_INCLUDE_SRXL */
#if defined(PIOS_INCLUDE_HOTT)
/*
* HOTT USART
*/
#include <pios_hott_priv.h>
static const struct pios_usart_cfg pios_usart_hott_flexi_cfg = {
.regs = USART3,
.remap = GPIO_AF_USART3,
.init = {
.USART_BaudRate = 115200,
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
.USART_HardwareFlowControl = USART_HardwareFlowControl_None,
.USART_Mode = USART_Mode_Rx,
},
.irq = {
.init = {
.NVIC_IRQChannel = USART3_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = GPIOB,
.init = {
.GPIO_Pin = GPIO_Pin_11,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
.tx = {
.gpio = GPIOB,
.init = {
.GPIO_Pin = GPIO_Pin_10,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_OUT,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
};
static const struct pios_usart_cfg pios_usart_hott_main_cfg = {
.regs = USART1,
.remap = GPIO_AF_USART1,
.init = {
.USART_BaudRate = 115200,
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
.USART_HardwareFlowControl = USART_HardwareFlowControl_None,
.USART_Mode = USART_Mode_Rx,
},
.irq = {
.init = {
.NVIC_IRQChannel = USART1_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_10,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
.tx = {
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_9,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
};
#endif /* PIOS_INCLUDE_HOTT */
/* /*
* HK OSD * HK OSD
*/ */

View File

@ -104,6 +104,7 @@
#define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_DSM
#define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_SBUS
#define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_SRXL
#define PIOS_INCLUDE_HOTT
#define PIOS_INCLUDE_GCSRCVR #define PIOS_INCLUDE_GCSRCVR
#define PIOS_INCLUDE_OPLINKRCVR #define PIOS_INCLUDE_OPLINKRCVR

View File

@ -568,6 +568,30 @@ void PIOS_Board_Init(void)
} }
#endif #endif
break; break;
case HWSETTINGS_RM_FLEXIPORT_HOTTSUMD:
case HWSETTINGS_RM_FLEXIPORT_HOTTSUMH:
#if defined(PIOS_INCLUDE_HOTT)
{
uint32_t pios_usart_hott_id;
if (PIOS_USART_Init(&pios_usart_hott_id, &pios_usart_hott_flexi_cfg)) {
PIOS_Assert(0);
}
uint32_t pios_hott_id;
if (PIOS_HOTT_Init(&pios_hott_id, &pios_usart_com_driver, pios_usart_hott_id,
hwsettings_flexiport == HWSETTINGS_RM_FLEXIPORT_HOTTSUMD ? PIOS_HOTT_PROTO_SUMD : PIOS_HOTT_PROTO_SUMH)) {
PIOS_Assert(0);
}
uint32_t pios_hott_rcvr_id;
if (PIOS_RCVR_Init(&pios_hott_rcvr_id, &pios_hott_rcvr_driver, pios_hott_id)) {
PIOS_Assert(0);
}
pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_HOTTFLEXIPORT] = pios_hott_rcvr_id;
}
#endif /* PIOS_INCLUDE_HOTT */
break;
} /* hwsettings_rm_flexiport */ } /* hwsettings_rm_flexiport */
/* Moved this here to allow binding on flexiport */ /* Moved this here to allow binding on flexiport */
@ -751,6 +775,30 @@ void PIOS_Board_Init(void)
PIOS_Board_configure_dsm(&pios_usart_dsm_main_cfg, &pios_dsm_main_cfg, PIOS_Board_configure_dsm(&pios_usart_dsm_main_cfg, &pios_dsm_main_cfg,
&pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT, &hwsettings_DSMxBind); &pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT, &hwsettings_DSMxBind);
break; break;
case HWSETTINGS_RM_MAINPORT_HOTTSUMD:
case HWSETTINGS_RM_MAINPORT_HOTTSUMH:
#if defined(PIOS_INCLUDE_HOTT)
{
uint32_t pios_usart_hott_id;
if (PIOS_USART_Init(&pios_usart_hott_id, &pios_usart_hott_main_cfg)) {
PIOS_Assert(0);
}
uint32_t pios_hott_id;
if (PIOS_HOTT_Init(&pios_hott_id, &pios_usart_com_driver, pios_usart_hott_id,
hwsettings_mainport == HWSETTINGS_RM_MAINPORT_HOTTSUMD ? PIOS_HOTT_PROTO_SUMD : PIOS_HOTT_PROTO_SUMH)) {
PIOS_Assert(0);
}
uint32_t pios_hott_rcvr_id;
if (PIOS_RCVR_Init(&pios_hott_rcvr_id, &pios_hott_rcvr_driver, pios_hott_id)) {
PIOS_Assert(0);
}
pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_HOTTMAINPORT] = pios_hott_rcvr_id;
}
#endif /* PIOS_INCLUDE_HOTT */
break;
case HWSETTINGS_RM_MAINPORT_DEBUGCONSOLE: case HWSETTINGS_RM_MAINPORT_DEBUGCONSOLE:
#if defined(PIOS_INCLUDE_DEBUG_CONSOLE) #if defined(PIOS_INCLUDE_DEBUG_CONSOLE)
{ {

View File

@ -257,6 +257,12 @@ extern uint32_t pios_packet_handler;
#define PIOS_SBUS_MAX_DEVS 1 #define PIOS_SBUS_MAX_DEVS 1
#define PIOS_SBUS_NUM_INPUTS (16 + 2) #define PIOS_SBUS_NUM_INPUTS (16 + 2)
//-------------------------
// Receiver HSUM input
//-------------------------
#define PIOS_HOTT_MAX_DEVS 2
#define PIOS_HOTT_NUM_INPUTS 32
// ------------------------- // -------------------------
// Receiver Multiplex SRXL input // Receiver Multiplex SRXL input
// ------------------------- // -------------------------

View File

@ -535,6 +535,95 @@ static const struct pios_dsm_cfg pios_dsm_flexi_cfg = {
#endif /* PIOS_INCLUDE_DSM */ #endif /* PIOS_INCLUDE_DSM */
#if defined(PIOS_INCLUDE_HOTT)
/*
* HOTT USART
*/
#include <pios_hott_priv.h>
static const struct pios_usart_cfg pios_usart_hott_main_cfg = {
.regs = MAIN_USART_REGS,
.remap = MAIN_USART_REMAP,
.init = {
.USART_BaudRate = 115200,
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
.USART_HardwareFlowControl = USART_HardwareFlowControl_None,
.USART_Mode = USART_Mode_Rx,
},
.irq = {
.init = {
.NVIC_IRQChannel = MAIN_USART_IRQ,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = MAIN_USART_RX_GPIO,
.init = {
.GPIO_Pin = MAIN_USART_RX_PIN,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
.tx = {
.gpio = MAIN_USART_TX_GPIO,
.init = {
.GPIO_Pin = MAIN_USART_TX_PIN,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
};
static const struct pios_usart_cfg pios_usart_hott_flexi_cfg = {
.regs = FLEXI_USART_REGS,
.remap = FLEXI_USART_REMAP,
.init = {
.USART_BaudRate = 115200,
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
.USART_HardwareFlowControl = USART_HardwareFlowControl_None,
.USART_Mode = USART_Mode_Rx,
},
.irq = {
.init = {
.NVIC_IRQChannel = FLEXI_USART_IRQ,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = FLEXI_USART_RX_GPIO,
.init = {
.GPIO_Pin = FLEXI_USART_RX_PIN,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
.tx = {
.gpio = FLEXI_USART_TX_GPIO,
.init = {
.GPIO_Pin = FLEXI_USART_TX_PIN,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_OUT,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
},
};
#endif /* PIOS_INCLUDE_HOTT */
#if defined(PIOS_INCLUDE_SRXL) #if defined(PIOS_INCLUDE_SRXL)
/* /*
* SRXL USART * SRXL USART

View File

@ -108,6 +108,7 @@
#define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_DSM
#define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_SBUS
#define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_SRXL
#define PIOS_INCLUDE_HOTT
#define PIOS_INCLUDE_GCSRCVR #define PIOS_INCLUDE_GCSRCVR
// #define PIOS_INCLUDE_OPLINKRCVR // #define PIOS_INCLUDE_OPLINKRCVR

View File

@ -605,6 +605,30 @@ void PIOS_Board_Init(void)
&pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT, &hwsettings_DSMxBind); &pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT, &hwsettings_DSMxBind);
} }
break; break;
case HWSETTINGS_RM_MAINPORT_HOTTSUMD:
case HWSETTINGS_RM_MAINPORT_HOTTSUMH:
#if defined(PIOS_INCLUDE_HOTT)
{
uint32_t pios_usart_hott_id;
if (PIOS_USART_Init(&pios_usart_hott_id, &pios_usart_hott_main_cfg)) {
PIOS_Assert(0);
}
uint32_t pios_hott_id;
if (PIOS_HOTT_Init(&pios_hott_id, &pios_usart_com_driver, pios_usart_hott_id,
hwsettings_mainport == HWSETTINGS_RM_MAINPORT_HOTTSUMD ? PIOS_HOTT_PROTO_SUMD : PIOS_HOTT_PROTO_SUMH)) {
PIOS_Assert(0);
}
uint32_t pios_hott_rcvr_id;
if (PIOS_RCVR_Init(&pios_hott_rcvr_id, &pios_hott_rcvr_driver, pios_hott_id)) {
PIOS_Assert(0);
}
pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_HOTTMAINPORT] = pios_hott_rcvr_id;
}
#endif /* PIOS_INCLUDE_HOTT */
break;
case HWSETTINGS_RM_MAINPORT_DEBUGCONSOLE: case HWSETTINGS_RM_MAINPORT_DEBUGCONSOLE:
#if defined(PIOS_INCLUDE_DEBUG_CONSOLE) #if defined(PIOS_INCLUDE_DEBUG_CONSOLE)
{ {
@ -714,6 +738,29 @@ void PIOS_Board_Init(void)
} }
#endif #endif
break; break;
case HWSETTINGS_RM_FLEXIPORT_HOTTSUMD:
case HWSETTINGS_RM_FLEXIPORT_HOTTSUMH:
#if defined(PIOS_INCLUDE_HOTT)
{
uint32_t pios_usart_hott_id;
if (PIOS_USART_Init(&pios_usart_hott_id, &pios_usart_hott_flexi_cfg)) {
PIOS_Assert(0);
}
uint32_t pios_hott_id;
if (PIOS_HOTT_Init(&pios_hott_id, &pios_usart_com_driver, pios_usart_hott_id,
hwsettings_flexiport == HWSETTINGS_RM_FLEXIPORT_HOTTSUMD ? PIOS_HOTT_PROTO_SUMD : PIOS_HOTT_PROTO_SUMH)) {
PIOS_Assert(0);
}
uint32_t pios_hott_rcvr_id;
if (PIOS_RCVR_Init(&pios_hott_rcvr_id, &pios_hott_rcvr_driver, pios_hott_id)) {
PIOS_Assert(0);
}
pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_HOTTFLEXIPORT] = pios_hott_rcvr_id;
}
#endif /* PIOS_INCLUDE_HOTT */
break;
} /* hwsettings_rm_flexiport */ } /* hwsettings_rm_flexiport */

View File

@ -257,6 +257,12 @@ extern uint32_t pios_packet_handler;
#define PIOS_SBUS_MAX_DEVS 1 #define PIOS_SBUS_MAX_DEVS 1
#define PIOS_SBUS_NUM_INPUTS (16 + 2) #define PIOS_SBUS_NUM_INPUTS (16 + 2)
//-------------------------
// Receiver HSUM input
//-------------------------
#define PIOS_HOTT_MAX_DEVS 2
#define PIOS_HOTT_NUM_INPUTS 32
// ------------------------- // -------------------------
// Receiver Multiplex SRXL input // Receiver Multiplex SRXL input
// ------------------------- // -------------------------

View File

@ -15,8 +15,8 @@
<field name="RM_RcvrPort" units="function" type="enum" elements="1" options="Disabled,PWM,PPM,PPM+PWM,PPM+Telemetry,PPM+Outputs,Outputs,Telemetry,ComBridge" <field name="RM_RcvrPort" units="function" type="enum" elements="1" options="Disabled,PWM,PPM,PPM+PWM,PPM+Telemetry,PPM+Outputs,Outputs,Telemetry,ComBridge"
defaultvalue="PWM" defaultvalue="PWM"
limits="%0905NE:PPM+PWM:PPM+Telemetry:Telemetry:ComBridge;"/> limits="%0905NE:PPM+PWM:PPM+Telemetry:Telemetry:ComBridge;"/>
<field name="RM_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,S.Bus,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/> <field name="RM_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,S.Bus,DSM,HoTT SUMD,HoTT SUMH,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/>
<field name="RM_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,I2C,DSM,SRXL,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/> <field name="RM_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,I2C,DSM,HoTT SUMD,HoTT SUMH,SRXL,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/>
<field name="TelemetrySpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/> <field name="TelemetrySpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
<field name="GPSSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200,230400" defaultvalue="57600"/> <field name="GPSSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200,230400" defaultvalue="57600"/>