PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <asm-generic/termbits.h>
#include <errno.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <px4_platform_common/defines.h>
#include <drivers/drv_hrt.h>
#include <uORB/uORB.h>
#include <uORB/topics/input_rc.h>
Go to the source code of this file.
Classes | |
class | linux_sbus::RcInput |
Namespaces | |
linux_sbus | |
Macros | |
#define | RCINPUT_MEASURE_INTERVAL_US 4700 |
#define | SBUS_RANGE_MIN 200.0f |
#define | SBUS_RANGE_MAX 1800.0f |
#define | SBUS_TARGET_MIN 1000.0f |
#define | SBUS_TARGET_MAX 2000.0f |
#define | SBUS_SCALE_FACTOR ((SBUS_TARGET_MAX - SBUS_TARGET_MIN) / (SBUS_RANGE_MAX - SBUS_RANGE_MIN)) |
#define | SBUS_SCALE_OFFSET (int)(SBUS_TARGET_MIN - (SBUS_SCALE_FACTOR * SBUS_RANGE_MIN + 0.5f)) |
Functions | |
static void | linux_sbus::usage (const char *reason) |
Print the correct usage. More... | |
__EXPORT int | linux_sbus_main (int argc, char **argv) |
Variables | |
static RcInput * | linux_sbus::rc_input = nullptr |
#define RCINPUT_MEASURE_INTERVAL_US 4700 |
Definition at line 57 of file linux_sbus.h.
Referenced by linux_sbus::RcInput::_measure(), rpi_rc_in::RcInput::Run(), and linux_sbus::RcInput::Run().
#define SBUS_RANGE_MAX 1800.0f |
Definition at line 60 of file linux_sbus.h.
#define SBUS_RANGE_MIN 200.0f |
Definition at line 59 of file linux_sbus.h.
#define SBUS_SCALE_FACTOR ((SBUS_TARGET_MAX - SBUS_TARGET_MIN) / (SBUS_RANGE_MAX - SBUS_RANGE_MIN)) |
Definition at line 64 of file linux_sbus.h.
Referenced by linux_sbus::RcInput::_measure().
#define SBUS_SCALE_OFFSET (int)(SBUS_TARGET_MIN - (SBUS_SCALE_FACTOR * SBUS_RANGE_MIN + 0.5f)) |
Definition at line 65 of file linux_sbus.h.
Referenced by linux_sbus::RcInput::_measure().
#define SBUS_TARGET_MAX 2000.0f |
Definition at line 62 of file linux_sbus.h.
#define SBUS_TARGET_MIN 1000.0f |
Definition at line 61 of file linux_sbus.h.
__EXPORT int linux_sbus_main | ( | int | argc, |
char ** | argv | ||
) |
ttyS1 for default, it can be changed through -d parameter
8 channel for default setting, it can be changed through -c parameter
Parse command line and get device and channels count from consolex
Channels count can't be higher than 16;
Check if alloc worked.
Wait for task to die
Definition at line 249 of file linux_sbus.cpp.
References command, linux_sbus::RcInput::isRunning(), linux_sbus::rc_input, linux_sbus::RcInput::RcInput(), linux_sbus::RcInput::start(), linux_sbus::RcInput::stop(), and linux_sbus::usage().