Paparazzi UAS  v5.12_stable-4-g9b43e9b
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  <configure name="RADIO_CONTROL_LED" value="none|num" />
4  <configure name="RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT" value="num" />
5  <configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="num" />
6  <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="0|1" />
7 </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: num
    Description: UART number for primary spektrum receiver
  • name: RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT value: num
    Description: UART number 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: Set to true to use DSMX instead of DSM2

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="num" description="UART number for primary spektrum receiver"/>
<configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="num" description="UART number 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="Set to true to use DSMX instead of DSM2"/>
</doc>
<header>
<file name="spektrum.h" dir="subsystems/radio_control"/>
</header>
<makefile target="ap|fbw|sim|nps|hitl|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)"/>
<define name="RADIO_CONTROL_TYPE_H" value="subsystems/radio_control/spektrum.h" type="string"/>
<raw>
ifeq ($(ARCH), lpc21)
ifndef RADIO_CONTROL_SPEKTRUM_MODEL
RADIO_CONTROL_SPEKTRUM_MODEL=\"subsystems/radio_control/spektrum_dx7se.h\"
endif
RC_CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=$(RADIO_CONTROL_SPEKTRUM_MODEL)
endif
</raw>
</makefile>
<makefile target="fbw|sim|nps|hitl|test_radio_control">
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" default="0"/>
<define name="RADIO_CONTROL"/>
<define name="RADIO_CONTROL_BIND_IMPL_FUNC" value="radio_control_spektrum_try_bind"/>
<define name="RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT" value="SPEKTRUM_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)"/>
<define name="OVERRIDE_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)_IRQ_HANDLER"/>
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="SPEKTRUM_$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="OVERRIDE_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)_IRQ_HANDLER" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<file name="radio_control.c" dir="subsystems"/>
<file name="spektrum.c" dir="subsystems/radio_control"/>
<file name="spektrum_arch.c" dir="$(SRC_ARCH)/subsystems/radio_control"/>
</makefile>
<makefile target="ap" cond="ifeq (,$(findstring $(SEPARATE_FBW),1 TRUE))">
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" default="0"/>
<define name="RADIO_CONTROL"/>
<define name="RADIO_CONTROL_BIND_IMPL_FUNC" value="radio_control_spektrum_try_bind"/>
<define name="RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT" value="SPEKTRUM_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)"/>
<define name="OVERRIDE_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)_IRQ_HANDLER"/>
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="SPEKTRUM_$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<define name="OVERRIDE_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)_IRQ_HANDLER" cond="ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)"/>
<file name="radio_control.c" dir="subsystems"/>
<file name="spektrum.c" dir="subsystems/radio_control"/>
<file name="spektrum_arch.c" dir="$(SRC_ARCH)/subsystems/radio_control"/>
</makefile>
</module>