Paparazzi UAS  v5.15_devel-61-g9c6bcf9
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
radio_control_spektrum module

Radio control based on Spektrum DSM2 or DSMX receivers

Define USE_DSMX on STM32 microcontrollers to bind in DSMX instead of DSM2

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="radio_control_spektrum">
2  <define name="USE_DSMX" value="FALSE|TRUE" />
3  <define name="SPEKTRUM_SYS_TYPE" value="0" />
4  <configure name="RADIO_CONTROL_LED" value="none|num" />
5  <configure name="RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT" value="uartX" />
6  <configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="uartX" />
7  <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="0|1" />
8 </module>

Module configuration options

Configure Options

  • name: RADIO_CONTROL_LED value: none|num
    Description: LED number or 'none' to disable
  • name: RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT value: uartX
    Description: UART for primary spektrum receiver
  • name: RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT value: uartX
    Description: UART for optional secondary spektrum receiver
  • name: USE_SECONDARY_SPEKTRUM_RECEIVER value: 0|1
    Description: enable secondary receiver (default: disabled)

Define Options

  • name: USE_DSMX value: FALSE|TRUE
    Description: activate DSMX binding mode for compatible receivers (default: FALSE, DSM2 is used)
  • name: SPEKTRUM_SYS_TYPE value: 0
    Description: force system type (default: 0 for auto detect)

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw radio_control_spektrum.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="radio_control_spektrum" dir="radio_control">
<doc>
<description>
Radio control based on Spektrum DSM2 or DSMX receivers
Define USE_DSMX on STM32 microcontrollers to bind in DSMX instead of DSM2
</description>
<configure name="RADIO_CONTROL_LED" value="none|num" description="LED number or 'none' to disable"/>
<configure name="RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT" value="uartX" description="UART for primary spektrum receiver"/>
<configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="uartX" description="UART for optional secondary spektrum receiver"/>
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="0|1" description="enable secondary receiver (default: disabled)"/>
<define name="USE_DSMX" value="FALSE|TRUE" description="activate DSMX binding mode for compatible receivers (default: FALSE, DSM2 is used)"/>
<define name="SPEKTRUM_SYS_TYPE" value="0" description="force system type (default: 0 for auto detect)"/>
</doc>
<header>
<file name="spektrum.h" dir="subsystems/radio_control"/>
</header>
<makefile target="ap|fbw|sim|nps|test_radio_control">
<configure name="RADIO_CONTROL_LED" default="none"/>
<define name="RADIO_CONTROL_LED" value="$(RADIO_CONTROL_LED)" cond="ifneq ($(RADIO_CONTROL_LED),none)"/>
</makefile>
<makefile target="fbw|test_radio_control">
<define name="RADIO_CONTROL"/>
<define name="RADIO_CONTROL_TYPE_H" value="subsystems/radio_control/spektrum.h" type="string"/>
<define name="RADIO_CONTROL_BIND_IMPL_FUNC" value="spektrum_try_bind"/>
<configure name="SPEKTRUM_PRIMARY_UART" value="$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)" case="upper|lower"/>
<define name="USE_$(SPEKTRUM_PRIMARY_UART_UPPER)"/>
<define name="SPEKTRUM_PRIMARY_UART" value="$(SPEKTRUM_PRIMARY_UART_LOWER)"/>
<define name="SPEKTRUM_PRIMARY_UART_UPPER" value="$(SPEKTRUM_PRIMARY_UART_UPPER)_GPIO"/>
<define name="$(SPEKTRUM_PRIMARY_UART_UPPER)_BAUD" value="B115200"/>
<define name="USE_$(SPEKTRUM_PRIMARY_UART_UPPER)_TX" value="FALSE"/>
<configure name="SPEKTRUM_SECONDARY_UART" value="$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)" case="upper|lower"/>
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" default="0"/>
<define name="USE_$(SPEKTRUM_SECONDARY_UART_UPPER)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="SPEKTRUM_SECONDARY_UART" value="$(SPEKTRUM_SECONDARY_UART_LOWER)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="SPEKTRUM_SECONDARY_UART_UPPER" value="$(SPEKTRUM_SECONDARY_UART_UPPER)_GPIO" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="$(SPEKTRUM_SECONDARY_UART_UPPER)_BAUD" value="B115200" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="USE_$(SPEKTRUM_SECONDARY_UART_UPPER)_TX" value="FALSE" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<file name="radio_control.c" dir="subsystems"/>
<file name="spektrum.c" dir="subsystems/radio_control"/>
</makefile>
<makefile target="ap">
<define name="RADIO_CONTROL_TYPE_H" value="subsystems/radio_control/spektrum.h" type="string"/>
</makefile>
<makefile target="ap" cond="ifeq (,$(findstring $(SEPARATE_FBW),1 TRUE))">
<define name="RADIO_CONTROL"/>
<define name="RADIO_CONTROL_BIND_IMPL_FUNC" value="spektrum_try_bind"/>
<configure name="SPEKTRUM_PRIMARY_UART" value="$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)" case="upper|lower"/>
<define name="USE_$(SPEKTRUM_PRIMARY_UART_UPPER)"/>
<define name="SPEKTRUM_PRIMARY_UART" value="$(SPEKTRUM_PRIMARY_UART_LOWER)"/>
<define name="SPEKTRUM_PRIMARY_UART_UPPER" value="$(SPEKTRUM_PRIMARY_UART_UPPER)_GPIO"/>
<define name="$(SPEKTRUM_PRIMARY_UART_UPPER)_BAUD" value="B115200"/>
<define name="USE_$(SPEKTRUM_PRIMARY_UART_UPPER)_TX" value="FALSE"/>
<configure name="SPEKTRUM_SECONDARY_UART" value="$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)" case="upper|lower"/>
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" default="0"/>
<define name="USE_$(SPEKTRUM_SECONDARY_UART_UPPER)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="SPEKTRUM_SECONDARY_UART" value="$(SPEKTRUM_SECONDARY_UART_LOWER)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="SPEKTRUM_SECONDARY_UART_UPPER" value="$(SPEKTRUM_SECONDARY_UART_UPPER)_GPIO" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="$(SPEKTRUM_SECONDARY_UART_UPPER)_BAUD" value="B115200" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="USE_$(SPEKTRUM_SECONDARY_UART_UPPER)_TX" value="FALSE" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<file name="radio_control.c" dir="subsystems"/>
<file name="spektrum.c" dir="subsystems/radio_control"/>
</makefile>
<makefile target="sim|nps|hitl">
<define name="RADIO_CONTROL"/>
<define name="RADIO_CONTROL_TYPE_H" value="subsystems/radio_control/spektrum_arch.h" type="string"/>
<file name="radio_control.c" dir="subsystems"/>
<file_arch name="spektrum_arch.c" dir="subsystems/radio_control"/>
</makefile>
</module>