PX4 Firmware
PX4 Autopilot Software http://px4.io
PAW3902 Class Reference

#include <PAW3902.hpp>

Inheritance diagram for PAW3902:
Collaboration diagram for PAW3902:

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}
 

Detailed Description

Definition at line 89 of file PAW3902.hpp.

Constructor & Destructor Documentation

◆ PAW3902()

PAW3902::PAW3902 ( int  bus = PAW3902_BUS,
enum Rotation  yaw_rotation = ROTATION_NONE 
)

Definition at line 36 of file PAW3902.cpp.

◆ ~PAW3902()

PAW3902::~PAW3902 ( )
virtual

Definition at line 46 of file PAW3902.cpp.

References _comms_errors, _dupe_count_perf, _sample_perf, perf_free(), and stop().

Here is the call graph for this function:

Member Function Documentation

◆ changeMode()

bool PAW3902::changeMode ( Mode  newMode)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

int PAW3902::init ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modeBright()

bool PAW3902::modeBright ( )
private

Definition at line 170 of file PAW3902.cpp.

References registerWrite().

Referenced by changeMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modeLowLight()

bool PAW3902::modeLowLight ( )
private

Definition at line 285 of file PAW3902.cpp.

References registerWrite().

Referenced by changeMode(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modeSuperLowLight()

bool PAW3902::modeSuperLowLight ( )
private

Definition at line 401 of file PAW3902.cpp.

References registerWrite().

Referenced by changeMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_info()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ probe()

int PAW3902::probe ( )
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.

Here is the call graph for this function:

◆ registerRead()

uint8_t PAW3902::registerRead ( uint8_t  reg)
private

Definition at line 517 of file PAW3902.cpp.

References PixArt_PAW3902JF::T_SRR.

Referenced by changeMode(), probe(), and reset().

Here is the caller graph for this function:

◆ registerWrite()

void PAW3902::registerWrite ( uint8_t  reg,
uint8_t  data 
)
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().

Here is the caller graph for this function:

◆ reset()

bool PAW3902::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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Run()

void PAW3902::Run ( )
overrideprivate

◆ start()

void PAW3902::start ( )

Definition at line 682 of file PAW3902.cpp.

References PixArt_PAW3902JF::SAMPLE_INTERVAL_MODE_1.

Referenced by init().

Here is the caller graph for this function:

◆ stop()

void PAW3902::stop ( )

Definition at line 689 of file PAW3902.cpp.

Referenced by ~PAW3902().

Here is the caller graph for this function:

Member Data Documentation

◆ _collect_time

constexpr uint64_t PAW3902::_collect_time {15000}
staticprivate

Definition at line 126 of file PAW3902.hpp.

Referenced by Run().

◆ _comms_errors

perf_counter_t PAW3902::_comms_errors
private

Definition at line 123 of file PAW3902.hpp.

Referenced by print_info(), Run(), and ~PAW3902().

◆ _dupe_count_perf

perf_counter_t PAW3902::_dupe_count_perf
private

Definition at line 124 of file PAW3902.hpp.

Referenced by print_info(), and ~PAW3902().

◆ _flow_dt_sum_usec

uint64_t PAW3902::_flow_dt_sum_usec {0}
private

Definition at line 129 of file PAW3902.hpp.

Referenced by Run().

◆ _flow_sum_x

int PAW3902::_flow_sum_x {0}
private

Definition at line 134 of file PAW3902.hpp.

Referenced by Run().

◆ _flow_sum_y

int PAW3902::_flow_sum_y {0}
private

Definition at line 135 of file PAW3902.hpp.

Referenced by Run().

◆ _frame_count_since_last

unsigned PAW3902::_frame_count_since_last {0}
private

Definition at line 130 of file PAW3902.hpp.

Referenced by Run().

◆ _mode

Mode PAW3902::_mode {Mode::LowLight}
private

Definition at line 137 of file PAW3902.hpp.

Referenced by changeMode(), and Run().

◆ _optical_flow_pub

uORB::PublicationMulti<optical_flow_s> PAW3902::_optical_flow_pub {ORB_ID(optical_flow)}
private

Definition at line 120 of file PAW3902.hpp.

Referenced by Run().

◆ _previous_collect_timestamp

uint64_t PAW3902::_previous_collect_timestamp {0}
private

Definition at line 128 of file PAW3902.hpp.

Referenced by init(), and Run().

◆ _sample_perf

perf_counter_t PAW3902::_sample_perf
private

Definition at line 122 of file PAW3902.hpp.

Referenced by print_info(), Run(), and ~PAW3902().


The documentation for this class was generated from the following files: