PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <linux_sbus.h>
Public Member Functions | |
RcInput () | |
~RcInput () | |
int | start (char *device, int channels) |
void | stop () |
bool | isRunning () |
Private Member Functions | |
void | Run () override |
void | _measure () |
int | init () |
Private Attributes | |
bool | _shouldExit |
bool | _isRunning |
orb_advert_t | _rcinput_pub |
struct input_rc_s | _data |
uint8_t | _sbusData [25] |
int | _channels |
int | _device_fd |
int | _channels_data [16] |
serial port device to read SBUS; More... | |
uint8_t | _buffer [25] |
16 channels support; More... | |
char | _device [30] |
bool | _failsafe |
bool | _rc_loss |
Definition at line 69 of file linux_sbus.h.
|
inline |
Definition at line 72 of file linux_sbus.h.
References _sbusData.
Referenced by linux_sbus_main().
|
inline |
Definition at line 83 of file linux_sbus.h.
References _device_fd, _isRunning, start(), and stop().
|
private |
error counter to count the lost frame
Notice: most sbus rx device support sbus1
parse sbus data to pwm
Definition at line 148 of file linux_sbus.cpp.
References _channels, _channels_data, _data, _device_fd, _rcinput_pub, _sbusData, input_rc_s::channel_count, f(), hrt_absolute_time(), input_rc_s::input_source, ORB_ID, orb_publish(), input_rc_s::rc_failsafe, input_rc_s::rc_lost, input_rc_s::rc_lost_frame_count, input_rc_s::rc_ppm_frame_length, input_rc_s::rc_total_frame_count, RCINPUT_MEASURE_INTERVAL_US, read(), input_rc_s::rssi, SBUS_SCALE_FACTOR, SBUS_SCALE_OFFSET, input_rc_s::timestamp, input_rc_s::timestamp_last_signal, linux_sbus::usage(), and input_rc_s::values.
Referenced by isRunning(), and Run().
|
private |
initialize the data of each channel
open the serial port
Setting serial port,8E2, non-blocking.100Kbps
use BOTHER to specify speed directly in c_[io]speed member
Definition at line 43 of file linux_sbus.cpp.
References _data, _device, _device_fd, _rcinput_pub, orb_advertise(), ORB_ID, and input_rc_s::values.
Referenced by start().
|
inline |
Definition at line 93 of file linux_sbus.h.
References _isRunning, _measure(), and Run().
Referenced by linux_sbus_main().
|
overrideprivate |
Definition at line 139 of file linux_sbus.cpp.
References _measure(), _shouldExit, and RCINPUT_MEASURE_INTERVAL_US.
Referenced by isRunning().
int RcInput::start | ( | char * | device, |
int | channels | ||
) |
Definition at line 108 of file linux_sbus.cpp.
References _channels, _device, _isRunning, and init().
Referenced by linux_sbus_main(), and ~RcInput().
void RcInput::stop | ( | ) |
Definition at line 132 of file linux_sbus.cpp.
References _device_fd, and _shouldExit.
Referenced by linux_sbus_main(), and ~RcInput().
|
private |
16 channels support;
Definition at line 109 of file linux_sbus.h.
|
private |
Definition at line 106 of file linux_sbus.h.
Referenced by _measure(), and start().
|
private |
serial port device to read SBUS;
Definition at line 108 of file linux_sbus.h.
Referenced by _measure().
|
private |
Definition at line 104 of file linux_sbus.h.
Referenced by _measure(), and init().
|
private |
Definition at line 110 of file linux_sbus.h.
|
private |
Definition at line 107 of file linux_sbus.h.
Referenced by _measure(), init(), stop(), and ~RcInput().
|
private |
Definition at line 111 of file linux_sbus.h.
|
private |
Definition at line 102 of file linux_sbus.h.
Referenced by isRunning(), start(), and ~RcInput().
|
private |
Definition at line 112 of file linux_sbus.h.
|
private |
Definition at line 103 of file linux_sbus.h.
Referenced by _measure(), and init().
|
private |
Definition at line 105 of file linux_sbus.h.
Referenced by _measure(), and RcInput().
|
private |
Definition at line 101 of file linux_sbus.h.