Forward datalink over inter-mcu link between FBW and AP
Flight termination commands can still be decoded by FBW even when AP is down
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="fbw_datalink">
b'<configure name="MODEM_PORT" value="UARTx" />\n '
b'<configure name="MODEM_BAUD" value="B57600" />\n '
b'<configure name="AUTOPILOT_PORT" value="UARTx" />\n '
</module>
Module configuration options
Configure Options
- name:
MODEM_PORT
value: UARTx
Description: UART where the modem is connected to (UART1, UART2, etc)
- name:
MODEM_BAUD
value: B57600
Description: UART baud rate
- name:
AUTOPILOT_PORT
value: UARTx
Description: UART where the autopilot is connected to (UART1, UART2, etc)
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw fbw_datalink.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="fbw_datalink" dir="datalink" task="fbw">
<doc>
<description>
Forward datalink over inter-mcu link between FBW and AP
Flight termination commands can still be decoded by FBW even when AP is down
</description>
<configure name="MODEM_PORT" value="UARTx" description="UART where the modem is connected to (UART1, UART2, etc)"/>
<configure name="MODEM_BAUD" value="B57600" description="UART baud rate"/>
<configure name="AUTOPILOT_PORT" value="UARTx" description="UART where the autopilot is connected to (UART1, UART2, etc)"/>
</doc>
<header>
<file name="fbw_datalink.h" dir="firmwares/fixedwing"/>
</header>
<makefile target="fbw" firmware="fixedwing">
<configure name="MODEM_PORT" case="upper|lower"/>
<configure name="AUTOPILOT_PORT" case="upper|lower"/>
<define name="USE_$(MODEM_PORT_UPPER)"/>
<define name="$(MODEM_PORT_UPPER)_BAUD" value="$(MODEM_BAUD)"/>
<define name="MODEM_LINK" value="$(MODEM_PORT_LOWER)"/>
<define name="USE_$(AUTOPILOT_PORT_UPPER)"/>
<define name="$(AUTOPILOT_PORT_UPPER)_BAUD" value="$(MODEM_BAUD)"/>
<define name="AUTOPILOT_LINK" value="$(AUTOPILOT_PORT_LOWER)"/>
<define name="FBW_DATALINK"/>
<file name="fbw_datalink.c" dir="firmwares/fixedwing"/>
</makefile>
</module>