|
M5Unit-GESTURE 0.2.0 git rev:70c2663
|
PAJ7620U2 unit. More...
#include <unit_PAJ7620U2.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| UnitPAJ7620U2 (const uint8_t addr=DEFAULT_ADDRESS) | |
| Constructor. | |
| virtual | ~UnitPAJ7620U2 () |
| Destructor. | |
| virtual bool | begin () override |
| Begin communication with the sensor. | |
| virtual void | update (const bool force=false) override |
| Update periodic measurement data. | |
| uint8_t | rotation () const |
| Get the rotation. | |
| void | setRotate (const uint8_t rot) |
| Set the rotation. | |
| paj7620u2::Frequency | frequency () const |
| Gets the inner frequency. | |
| bool | readFrequency (uint16_t &raw) |
| Read the raw R_IDLE_TIME register value. | |
| bool | readFrequency (paj7620u2::Frequency &f) |
| Read the frequency. | |
| bool | writeFrequency (const paj7620u2::Frequency f) |
| Write the frequency. | |
| float | readFrequencyHz () |
| Read the current frequency in Hz from hardware. | |
| bool | writeFrequencyHz (const float hz) |
| Write the frequency in Hz. | |
| bool | readHorizontalFlip (bool &flip) |
| Read the horizontal flipping. | |
| bool | readVerticalFlip (bool &flip) |
| Read the vertical flipping. | |
| bool | writeHorizontalFlip (const bool flip) |
| Write the horizontal flipping. | |
| bool | writeVerticalFlip (const bool flip) |
| Write the vertical flipping. | |
Settings for begin | |
| config_t | config () |
| Gets the configuration. | |
| void | config (const config_t &cfg) |
| Set the configuration. | |
Measurement data by periodic | |
| paj7620u2::Gesture | gesture () const |
| Oldest gesture. | |
| uint8_t | brightness () const |
| Oldest brightness if Proximity mode. | |
| bool | approach () const |
| Oldest approach status if Proximity mode. | |
| uint16_t | cursorX () const |
| Oldest cursor X if Cursor mode. | |
| uint16_t | cursorY () const |
| Oldest cursor Y if Cursor mode. | |
Periodic measurement | |
| bool | startPeriodicMeasurement (const uint32_t intervalMs=0) |
| Start periodic measurement in the current settings. | |
| bool | startPeriodicMeasurement (const paj7620u2::Mode mode, const paj7620u2::Frequency freq, const uint32_t intervalMs) |
| Start periodic measurement. | |
| bool | stopPeriodicMeasurement () |
| Stop periodic measurement. | |
For detect gesture | |
| bool | readGesture (paj7620u2::Gesture &gesture) |
| Read gesture. | |
| bool | readObjectCenter (uint16_t &x, uint16_t &y) |
| Object center position. | |
| bool | readObjectSize (uint16_t &sz) |
| Read gesture object size. | |
| bool | existsObject (bool &exists) |
| Is the object present within the detection range? | |
| bool | readNoObjectCount (uint8_t &cnt) |
| State counter with no objects detected. | |
| bool | readNoMotionCount (uint8_t &cnt) |
| State counter which a non-moving object is detected. | |
For detect proximity | |
| bool | readProximity (uint8_t &brightness, uint8_t &approach) |
| Read proximity. | |
| bool | readApproachThreshold (uint8_t &high, uint8_t &low) |
| Read the threshold for detect approach. | |
| bool | writeApproachThreshold (const uint8_t high, const uint8_t low) |
| Write the threshold for detect approach. | |
For detect cursor | |
| bool | readCursor (uint16_t &x, uint16_t &y) |
| Cursor position. | |
Detection mode | |
| paj7620u2::Mode | mode () const |
| Gets the detection mode. | |
| bool | writeMode (const paj7620u2::Mode mode) |
| Write the detection mode. | |
General purpose | |
| bool | enable (const bool flag) |
| Enable/disable sensor. | |
| bool | enable () |
| enable sensor | |
| bool | disable () |
| disable sensor | |
| bool | suspend () |
| suspend | |
| bool | resume () |
| resume from suspended | |
Protected Member Functions | |
| bool | start_periodic_measurement (const uint32_t intervalMs=0) |
| bool | start_periodic_measurement (const paj7620u2::Mode mode, const paj7620u2::Frequency freq, const uint32_t intervalMs) |
| bool | stop_periodic_measurement () |
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitPAJ7620U2, paj7620u2::Data) | |
| bool | select_bank (const uint8_t bank, const bool force=false) |
| bool | read_banked_register (const uint16_t reg, uint8_t *buf, const size_t len) |
| bool | read_banked_register8 (const uint16_t reg, uint8_t &value) |
| bool | write_banked_register (const uint16_t reg, const uint8_t *buf, const size_t len) |
| bool | write_banked_register8 (const uint16_t reg, const uint8_t value) |
| bool | update_gesture (paj7620u2::Data &d) |
| bool | update_proximity (paj7620u2::Data &d) |
| bool | update_cursor (paj7620u2::Data &d) |
| bool | read_gesture (paj7620u2::Data &d) |
| bool | read_proximity (paj7620u2::Data &d) |
| bool | read_cursor (paj7620u2::Data &d) |
| bool | wakeup () |
| bool | was_wakeup () |
| bool | read_chip_id (uint16_t &id) |
| bool | read_version (uint8_t &version) |
Protected Attributes | |
| uint8_t | _current_bank {0xFF} |
| paj7620u2::Mode | _mode {} |
| paj7620u2::Frequency | _frequency {} |
| uint8_t | _rotation {} |
| std::unique_ptr< m5::container::CircularBuffer< paj7620u2::Data > > | _data {} |
| config_t | _cfg {} |
PAJ7620U2 unit.
|
inlineexplicit |
Constructor.
| addr | I2C address (default: 0x73) |
|
overridevirtual |
Begin communication with the sensor.
| bool m5::unit::UnitPAJ7620U2::enable | ( | const bool | flag | ) |
Enable/disable sensor.
| flag | true:enable false:disable |
|
inline |
Is the object present within the detection range?
| [out] | exists | true if exists |
| bool m5::unit::UnitPAJ7620U2::readApproachThreshold | ( | uint8_t & | high, |
| uint8_t & | low ) |
Read the threshold for detect approach.
| [out] | high | High threshold |
| [out] | low | Low threshold |
| bool m5::unit::UnitPAJ7620U2::readCursor | ( | uint16_t & | x, |
| uint16_t & | y ) |
Cursor position.
| [out] | x | X coordinate |
| [out] | y | Y coordinate |
| bool m5::unit::UnitPAJ7620U2::readFrequency | ( | paj7620u2::Frequency & | f | ) |
Read the frequency.
| [out] | f | Frequency |
| bool m5::unit::UnitPAJ7620U2::readFrequency | ( | uint16_t & | raw | ) |
Read the raw R_IDLE_TIME register value.
| [out] | raw | R_IDLE_TIME[15:0] |
| float m5::unit::UnitPAJ7620U2::readFrequencyHz | ( | ) |
Read the current frequency in Hz from hardware.
| bool m5::unit::UnitPAJ7620U2::readGesture | ( | paj7620u2::Gesture & | gesture | ) |
Read gesture.
| [out] | gesture | Detected gesture result |
| bool m5::unit::UnitPAJ7620U2::readHorizontalFlip | ( | bool & | flip | ) |
Read the horizontal flipping.
| [out] | flip | Horizontal flip state |
| bool m5::unit::UnitPAJ7620U2::readNoMotionCount | ( | uint8_t & | cnt | ) |
State counter which a non-moving object is detected.
| [out] | cnt | Count in ticks [0...12] |
| bool m5::unit::UnitPAJ7620U2::readNoObjectCount | ( | uint8_t & | cnt | ) |
State counter with no objects detected.
| [out] | cnt | Count in ticks [0...255] |
| bool m5::unit::UnitPAJ7620U2::readObjectCenter | ( | uint16_t & | x, |
| uint16_t & | y ) |
Object center position.
| [out] | x | X coordinate |
| [out] | y | Y coordinate |
| bool m5::unit::UnitPAJ7620U2::readObjectSize | ( | uint16_t & | sz | ) |
Read gesture object size.
| [out] | sz | size [0~900] |
| bool m5::unit::UnitPAJ7620U2::readProximity | ( | uint8_t & | brightness, |
| uint8_t & | approach ) |
Read proximity.
| [out] | brightness | 0:Out of bounds [1:far ... 255:near] |
| [out] | approach | Approach object |
| bool m5::unit::UnitPAJ7620U2::readVerticalFlip | ( | bool & | flip | ) |
Read the vertical flipping.
| [out] | flip | Vertical flip state |
|
inline |
|
inline |
|
inline |
Start periodic measurement.
| mode | Operation mode |
| freq | Frequency |
| intervalMs | Measurement Interval(ms) |
|
inline |
Start periodic measurement in the current settings.
| intervalMs | Measurement Interval(ms) |
|
inline |
Stop periodic measurement.
|
overridevirtual |
Update periodic measurement data.
| force | If true, force update regardless of interval |
| bool m5::unit::UnitPAJ7620U2::writeApproachThreshold | ( | const uint8_t | high, |
| const uint8_t | low ) |
Write the threshold for detect approach.
| high | High threshold |
| low | Low threshold |
| bool m5::unit::UnitPAJ7620U2::writeFrequency | ( | const paj7620u2::Frequency | f | ) |
Write the frequency.
| f | Frequency |
| bool m5::unit::UnitPAJ7620U2::writeFrequencyHz | ( | const float | hz | ) |
Write the frequency in Hz.
| hz | Frequency in Hz (must be > 0) |
| bool m5::unit::UnitPAJ7620U2::writeHorizontalFlip | ( | const bool | flip | ) |
Write the horizontal flipping.
| flip | Horizontal flip state |
| bool m5::unit::UnitPAJ7620U2::writeMode | ( | const paj7620u2::Mode | mode | ) |
Write the detection mode.
| mode | detection mode |
| bool m5::unit::UnitPAJ7620U2::writeVerticalFlip | ( | const bool | flip | ) |
Write the vertical flipping.
| flip | Vertical flip state |