xpcc
xpcc::Lis302dl< Transport > Class Template Reference

LIS302DL 3-Axis accelerometer. More...

#include <xpcc/driver/inertial/lis302dl.hpp>

Inheritance diagram for xpcc::Lis302dl< Transport >:
xpcc::lis302dl

Public Member Functions

 Lis302dl (Data &data, uint8_t address=0x1D)
 Constructor, requires a lis302dl::Data object. More...
 
bool configureBlocking (Scale scale, MeasurementRate rate=MeasurementRate::Hz100)
 
xpcc::ResumableResult< bool > configure (Scale scale, MeasurementRate rate=MeasurementRate::Hz100)
 
xpcc::ResumableResult< bool > updateControlRegister (Control1_t setMask, Control1_t clearMask=Control1_t(0xff))
 
xpcc::ResumableResult< bool > updateControlRegister (Control2_t setMask, Control2_t clearMask=Control2_t(0xff))
 
xpcc::ResumableResult< bool > updateControlRegister (Control3_t setMask, Control3_t clearMask=Control3_t(0xff))
 
xpcc::ResumableResult< bool > writeInterruptSource (Interrupt interrupt, InterruptSource source)
 
xpcc::ResumableResult< bool > updateFreeFallConfiguration (Interrupt interrupt, FreeFallConfig_t setMask, FreeFallConfig_t clearMask=FreeFallConfig_t(0xff))
 
xpcc::ResumableResult< bool > readFreeFallSource (Interrupt interrupt, FreeFallSource_t &source)
 
xpcc::ResumableResult< bool > setFreeFallThreshold (Interrupt interrupt, uint8_t threshold)
 
xpcc::ResumableResult< bool > setFreeFallDuration (Interrupt interrupt, uint8_t duration)
 
xpcc::ResumableResult< bool > updateClickConfiguration (ClickConfig_t setMask, ClickConfig_t clearMask)
 
xpcc::ResumableResult< bool > readClickSource (ClickSource_t &source)
 
xpcc::ResumableResult< bool > setClickThreshold (Axis axis, uint8_t threshold)
 
xpcc::ResumableResult< bool > setClickTimeLimit (uint8_t limit)
 
xpcc::ResumableResult< bool > setClickLatency (uint8_t latency)
 
xpcc::ResumableResult< bool > setClickWindow (uint8_t window)
 
xpcc::ResumableResult< bool > readAcceleration ()
 
Status_t getStatus ()
 
Control1_t getControl1 ()
 
Control2_t getControl2 ()
 
Control3_t getControl3 ()
 
DatagetData ()
 Get the data object for this sensor.
 

Additional Inherited Members

- Public Types inherited from xpcc::lis302dl
enum  Control1 : uint8_t {
  Control1::DR,
  Control1::PD,
  Control1::FS,
  Control1::STP,
  Control1::STM,
  Control1::Zen,
  Control1::Yen,
  Control1::Xen
}
 CTRL_REG1 default value is 0x07. More...
 
enum  Control2 : uint8_t {
  Control2::SIM,
  Control2::BOOT,
  Control2::FDS,
  Control2::HP_FF_WU2,
  Control2::HP_FF_WU1,
  Control2::HP_COEFF2,
  Control2::HP_COEFF1
}
 CTRL_REG2 default value is 0x00. More...
 
enum  Control3 : uint8_t {
  Control3::IHL,
  Control3::PP_OD,
  Control3::I2CFG2,
  Control3::I2CFG1,
  Control3::I2CFG0,
  Control3::I1CFG2,
  Control3::I1CFG1,
  Control3::I1CFG0
}
 CTRL_REG3 default value is 0x00. More...
 
enum  Status : uint8_t {
  Status::ZYXOR,
  Status::ZOR,
  Status::YOR,
  Status::XOR,
  Status::ZYXDA,
  Status::ZDA,
  Status::YDA,
  Status::XDA
}
 STATUS_REG default value is 0x00. More...
 
enum  FreeFallConfig : uint8_t {
  FreeFallConfig::AOI,
  FreeFallConfig::LIR,
  FreeFallConfig::ZHIE,
  FreeFallConfig::ZLIE,
  FreeFallConfig::YHIE,
  FreeFallConfig::YLIE,
  FreeFallConfig::XHIE,
  FreeFallConfig::XLIE
}
 FF_WU_CFG default value is 0x00. More...
 
enum  FreeFallSource : uint8_t {
  FreeFallSource::IA,
  FreeFallSource::ZH,
  FreeFallSource::ZL,
  FreeFallSource::YH,
  FreeFallSource::YL,
  FreeFallSource::XH,
  FreeFallSource::XL
}
 FF_WU_SRC default value is 0x00. More...
 
enum  FreeFallThreshold : uint8_t {
  FreeFallThreshold::DRCM,
  FreeFallThreshold::THS_Mask
}
 FF_WU_THS default value is 0x00. More...
 
enum  ClickConfig : uint8_t {
  ClickConfig::LIR,
  DoubleZ,
  SingleZ,
  DoubleY,
  SingleY,
  DoubleX,
  SingleX
}
 CLOCK_CFG default value is 0x00. More...
 
enum  ClickSource : uint8_t {
  ClickSource::IA,
  DoubleZ,
  SingleZ,
  DoubleY,
  SingleY,
  DoubleX,
  SingleX
}
 CLOCK_SRC default value is 0x00. More...
 
enum  InterruptSource : uint8_t {
  GND,
  FF_WU_1,
  FF_WU_2,
  FF_WU_1_OR_2,
  DataReady,
  Click
}
 
enum  MeasurementRate : uint8_t {
  Hz100,
  Hz400
}
 
enum  Scale : uint8_t {
  G2,
  G8
}
 
enum  Interrupt : uint8_t {
  One,
  Two
}
 
enum  Axis : uint8_t {
  X,
  Y,
  Z
}
 
typedef xpcc::Flags8< Control1Control1_t
 
typedef xpcc::Flags8< Control2Control2_t
 
typedef xpcc::Flags8< Control3Control3_t
 
typedef FlagsGroup< Control1_t, Control2_t, Control3_tControl_t
 
typedef xpcc::Flags8< StatusStatus_t
 
typedef xpcc::Flags8< FreeFallConfigFreeFallConfig_t
 
typedef xpcc::Flags8< FreeFallSourceFreeFallSource_t
 
typedef xpcc::Flags8< FreeFallThresholdFreeFallThreshold_t
 
typedef xpcc::Flags8< ClickConfigClickConfig_t
 
typedef xpcc::Flags8< ClickSourceClickSource_t
 
typedef FlagsGroup< Control1_t, Control2_t, Control3_t, Status_t, FreeFallConfig_t, FreeFallSource_t, FreeFallThreshold_t, ClickConfig_t, ClickSource_tRegister_t
 

Detailed Description

template<class Transport>
class xpcc::Lis302dl< Transport >

The LIS302DL is an ultra compact low-power three axes linear accelerometer. It includes a sensing element and an IC interface able to provide the measured acceleration to the external world through an I2C/SPI serial interface.

Template Parameters
TransportEither the I2C or SPI Transport Layer.
See also
Lis3TransportI2c
Lis3TransportSpi
Author
Niklas Hauser

Constructor & Destructor Documentation

◆ Lis302dl()

template<class Transport >
xpcc::Lis302dl< Transport >::Lis302dl ( Data data,
uint8_t  address = 0x1D 
)

For I2c this also sets the address to 0x1D (alternative: 0x1C).


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