modm API documentation
modm::pat9125el< Transport, IntPin > Class Template Reference

#include <modm/driver/motion/pat9125el.hpp>

Inheritance diagram for modm::pat9125el< Transport, IntPin >:

Public Typedefs

using Motion2D = modm::Vector< int16_t, 2 >
 

Public Types

enum  Register : uint8_t {
  ProductId1 = 0x00, ProductId2 = 0x01, MotionStatus = 0x02, DeltaXLow = 0x03,
  DeltaYLow = 0x04, OperationMode = 0x05, Configuration = 0x06, WriteProtect = 0x09,
  Sleep1 = 0x0A, Sleep2 = 0x0B, ResolutionX = 0x0D, ResolutionY = 0x0E,
  DeltaXYHigh = 0x12, ShutterTime = 0x14, AvgBrightness = 0x17, Orientation = 0x19
}
 
enum  MotionStatus : uint8_t { DataAvailable = (1 << 7) }
 
enum  WriteProtect : uint8_t { Enabled = 0, Disabled = 0x5A }
 

Public Member Functions

 MODM_FLAGS8 (MotionStatus)
 
 MODM_FLAGS8 (WriteProtect)
 
template<typename... TransportArgs>
 Pat9125el (TransportArgs &&...args)
 
modm::ResumableResult< bool > configure (uint8_t xResolution=0x14, uint8_t yResolution=0x14)
 
modm::ResumableResult< bool > ping ()
 
Motion2D getData () const
 
modm::ResumableResult< bool > readData ()
 
bool hasMoved () const
 
void resetMoved ()
 

Static Public Attributes

static constexpr uint8_t ProductId1 = 0x31
 
static constexpr bool UseInterruptPin = !std::is_void_v<IntPin>
 

Detailed Description

template<typename Transport, typename IntPin = void>
class modm::pat9125el< Transport, IntPin >

Driver for PAT9125EL motion sensor. Currently only the I2C version is supported.

Template Parameters
TransportEither I2C or SPi transport layer
See also
Pat9125elI2cTransport
Template Parameters
IntPinOptional interrupt pin. If pin is not connected, set to void.
Author
Christopher Durand

Member Function Documentation

template<typename Transport , typename IntPin = void>
modm::ResumableResult<bool> modm::pat9125el< Transport, IntPin >::configure ( uint8_t  xResolution = 0x14,
uint8_t  yResolution = 0x14 
)

Configure sensor resolution

Parameters
xResolutionx resolution in unit of 5 counts per inch
yResolutiony resolution in unit of 5 counts per inch
template<typename Transport , typename IntPin = void>
Motion2D modm::pat9125el< Transport, IntPin >::getData ( ) const

Returns the last measured movement data read from the device

template<typename Transport , typename IntPin = void>
bool modm::pat9125el< Transport, IntPin >::hasMoved ( ) const

Check if non-zero movement data has been read form the device

template<typename Transport , typename IntPin = void>
template<typename... TransportArgs>
modm::pat9125el< Transport, IntPin >::Pat9125el ( TransportArgs &&...  args)
Template Parameters
TransportArgsArguments forwarded to transport layer
See also
Pat9125elI2cTransport
template<typename Transport , typename IntPin = void>
modm::ResumableResult<bool> modm::pat9125el< Transport, IntPin >::ping ( )

Check if the device is available

template<typename Transport , typename IntPin = void>
modm::ResumableResult<bool> modm::pat9125el< Transport, IntPin >::readData ( )

Read movement measurement from the device


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