38 #include <sys/types.h> 46 #include <sys/ioctl.h> 48 #include <asm-generic/termbits.h> 50 #include <px4_platform_common/px4_config.h> 51 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 52 #include <px4_platform_common/defines.h> 57 #define RCINPUT_MEASURE_INTERVAL_US 4700 59 #define SBUS_RANGE_MIN 200.0f 60 #define SBUS_RANGE_MAX 1800.0f 61 #define SBUS_TARGET_MIN 1000.0f 62 #define SBUS_TARGET_MAX 2000.0f 64 #define SBUS_SCALE_FACTOR ((SBUS_TARGET_MAX - SBUS_TARGET_MIN) / (SBUS_RANGE_MAX - SBUS_RANGE_MIN)) 65 #define SBUS_SCALE_OFFSET (int)(SBUS_TARGET_MIN - (SBUS_SCALE_FACTOR * SBUS_RANGE_MIN + 0.5f)) 69 class RcInput :
public px4::ScheduledWorkItem
73 ScheduledWorkItem(MODULE_NAME,
px4::wq_configurations::hp_default),
78 0xff, 0x07, 0x40, 0x00, 0x02,
79 0x10, 0x80, 0x2c, 0x64, 0x21,
80 0x0b, 0x59, 0x08, 0x40, 0x00,
81 0x02, 0x10, 0x80, 0x00, 0x00 }
116 static void usage(
const char *reason);
static void usage(const char *reason)
Print the correct usage.
API for the uORB lightweight object broker.
static RcInput * rc_input
Namespace encapsulating all device framework classes, functions and data.
High-resolution timer with callouts and timekeeping.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
__EXPORT int linux_sbus_main(int argc, char **argv)