PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <PAW3902.hpp>
Public Member Functions | |
PAW3902 (int bus=PAW3902_BUS, enum Rotation yaw_rotation=ROTATION_NONE) | |
virtual | ~PAW3902 () |
virtual int | init () |
void | print_info () |
void | start () |
void | stop () |
Protected Member Functions | |
virtual int | probe () |
Private Member Functions | |
void | Run () override |
uint8_t | registerRead (uint8_t reg) |
void | registerWrite (uint8_t reg, uint8_t data) |
bool | reset () |
bool | modeBright () |
bool | modeLowLight () |
bool | modeSuperLowLight () |
bool | changeMode (Mode newMode) |
Private Attributes | |
uORB::PublicationMulti< optical_flow_s > | _optical_flow_pub {ORB_ID(optical_flow)} |
perf_counter_t | _sample_perf |
perf_counter_t | _comms_errors |
perf_counter_t | _dupe_count_perf |
uint64_t | _previous_collect_timestamp {0} |
uint64_t | _flow_dt_sum_usec {0} |
unsigned | _frame_count_since_last {0} |
int | _flow_sum_x {0} |
int | _flow_sum_y {0} |
Mode | _mode {Mode::LowLight} |
Static Private Attributes | |
static constexpr uint64_t | _collect_time {15000} |
Definition at line 89 of file PAW3902.hpp.
PAW3902::PAW3902 | ( | int | bus = PAW3902_BUS , |
enum Rotation | yaw_rotation = ROTATION_NONE |
||
) |
Definition at line 36 of file PAW3902.cpp.
|
virtual |
Definition at line 46 of file PAW3902.cpp.
References _comms_errors, _dupe_count_perf, _sample_perf, perf_free(), and stop().
|
private |
Definition at line 133 of file PAW3902.cpp.
References _mode, f(), modeBright(), modeLowLight(), modeSuperLowLight(), registerRead(), reset(), PixArt_PAW3902JF::Resolution, PixArt_PAW3902JF::SAMPLE_INTERVAL_MODE_0, PixArt_PAW3902JF::SAMPLE_INTERVAL_MODE_1, and PixArt_PAW3902JF::SAMPLE_INTERVAL_MODE_2.
Referenced by Run().
|
virtual |
Definition at line 58 of file PAW3902.cpp.
References _previous_collect_timestamp, hrt_absolute_time(), ToneAlarmInterface::init(), modeLowLight(), OK, param_find(), param_get(), PARAM_INVALID, reset(), and start().
Referenced by pmw3902::start().
|
private |
Definition at line 170 of file PAW3902.cpp.
References registerWrite().
Referenced by changeMode().
|
private |
Definition at line 285 of file PAW3902.cpp.
References registerWrite().
Referenced by changeMode(), and init().
|
private |
Definition at line 401 of file PAW3902.cpp.
References registerWrite().
Referenced by changeMode().
void PAW3902::print_info | ( | ) |
Definition at line 695 of file PAW3902.cpp.
References _comms_errors, _dupe_count_perf, _sample_perf, and perf_print_counter().
Referenced by pmw3902::info().
|
protectedvirtual |
Definition at line 92 of file PAW3902.cpp.
References PixArt_PAW3902JF::PRODUCT_ID, PixArt_PAW3902JF::Product_ID, registerRead(), PixArt_PAW3902JF::REVISION_ID, and PixArt_PAW3902JF::Revision_ID.
|
private |
Definition at line 517 of file PAW3902.cpp.
References PixArt_PAW3902JF::T_SRR.
Referenced by changeMode(), probe(), and reset().
|
private |
Definition at line 527 of file PAW3902.cpp.
References data, DIR_WRITE, and PixArt_PAW3902JF::T_SWW.
Referenced by modeBright(), modeLowLight(), modeSuperLowLight(), and reset().
|
private |
Definition at line 114 of file PAW3902.cpp.
References PixArt_PAW3902JF::Delta_X_H, PixArt_PAW3902JF::Delta_X_L, PixArt_PAW3902JF::Delta_Y_H, PixArt_PAW3902JF::Delta_Y_L, PixArt_PAW3902JF::Motion, PixArt_PAW3902JF::Power_Up_Reset, registerRead(), and registerWrite().
Referenced by changeMode(), and init().
|
overrideprivate |
Definition at line 537 of file PAW3902.cpp.
References _collect_time, _comms_errors, _flow_dt_sum_usec, _flow_sum_x, _flow_sum_y, _frame_count_since_last, _mode, _optical_flow_pub, _previous_collect_timestamp, _sample_perf, changeMode(), data, f(), hrt_absolute_time(), hrt_abstime, PixArt_PAW3902JF::Motion_Burst, perf_begin(), perf_count(), perf_end(), uORB::PublicationMulti< T >::publish(), rotate_3f(), and optical_flow_s::timestamp.
void PAW3902::start | ( | ) |
Definition at line 682 of file PAW3902.cpp.
References PixArt_PAW3902JF::SAMPLE_INTERVAL_MODE_1.
Referenced by init().
void PAW3902::stop | ( | ) |
Definition at line 689 of file PAW3902.cpp.
Referenced by ~PAW3902().
|
staticprivate |
Definition at line 126 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 123 of file PAW3902.hpp.
Referenced by print_info(), Run(), and ~PAW3902().
|
private |
Definition at line 124 of file PAW3902.hpp.
Referenced by print_info(), and ~PAW3902().
|
private |
Definition at line 129 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 134 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 135 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 130 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 137 of file PAW3902.hpp.
Referenced by changeMode(), and Run().
|
private |
Definition at line 120 of file PAW3902.hpp.
Referenced by Run().
|
private |
Definition at line 128 of file PAW3902.hpp.
|
private |
Definition at line 122 of file PAW3902.hpp.
Referenced by print_info(), Run(), and ~PAW3902().