modm API documentation
modm::Lis3dsh< Transport > Class Template Reference

#include <modm/driver/inertial/lis3dsh.hpp>

Inheritance diagram for modm::Lis3dsh< Transport >:

Classes

struct  Data
 

Public Typedefs

typedef FlagsGroup< SmControl_t, Control3_t, Control4_t, Control5_t, Control6_t > Control_t
 

Public Types

enum  Register : uint8_t
 
enum  Control3 : uint8_t
 CTRL_REG3 default value is 0x00.
 
enum  Control4 : uint8_t
 CTRL_REG4 default value is 0x07.
 
enum  Control5 : uint8_t
 CTRL_REG5 default value is 0x00.
 
enum  Control6 : uint8_t
 CTRL_REG6 default value is 0x00.
 
enum  Status : uint8_t
 STATUS is read-only.
 
enum  IntStatus : uint8_t
 STAT is read-only.
 
enum  FifoControl : uint8_t
 FIFO_CTRL default value is 0x00.
 
enum  FifoSource : uint8_t
 FIFO_SRC is read-only.
 
enum  AxisSign : uint8_t
 MASK1_A, MASK1_B, MASK2_A, MASK2_B, OUTS1, OUTS2.
 
enum  SmControl : uint8_t
 CTRL_REG1, CTRL_REG2.
 
enum  Sett : uint8_t
 SETT1, SETT2.
 
enum  NR : uint8_t {
  NOP = 0x0, TI1 = 0x1, TI2 = 0x2, TI3 = 0x3,
  TI4 = 0x4, GNTH1 = 0x5, GNTH2 = 0x6, LNTH1 = 0x7,
  LNTH2 = 0x8, GRTH1 = 0xB, GRTH2 = 0xD, LRTH1 = 0xC,
  LRTH2 = 0xE, GTTH1 = 0x9, LLTH2 = 0xA, NZERO = 0xF
}
 
enum  CMD : uint8_t {
  STOP = 0x00, CONT = 0x11, JMP = 0x22, SRP = 0x33,
  CRP = 0x44, SETP = 0x55, SETS1 = 0x66, STHR1 = 0x77,
  OUTC = 0x88, OUTW = 0x99, STHR2 = 0xAA, DEC = 0xBB,
  SISW = 0xCC, REL = 0xDD, STHR3 = 0xEE, SSYNC = 0xFF,
  SABS0 = 0x12, SABS1 = 0x13, SELMA = 0x14, SRADI0 = 0x21,
  SRADI1 = 0x23, SELSA = 0x24, SCS0 = 0x31, SCS1 = 0x32,
  SRTAM0 = 0x34, STIM3 = 0x41, STIM4 = 0x42, SRTAM1 = 0x43
}
 
enum  FifoMode : uint8_t
 
enum  MeasurementRate : uint8_t
 
enum  Scale : uint8_t
 
enum  Interrupt : uint8_t
 
enum  Axis : uint8_t
 

Public Member Functions

 MODM_FLAGS8 (Control3)
 
 MODM_FLAGS8 (Control4)
 
 MODM_FLAGS8 (Control5)
 
 MODM_FLAGS8 (Control6)
 
 MODM_FLAGS8 (Status)
 
 MODM_FLAGS8 (IntStatus)
 
 MODM_FLAGS8 (FifoControl)
 
 MODM_FLAGS8 (FifoSource)
 
 MODM_FLAGS8 (AxisSign)
 
 MODM_FLAGS8 (SmControl)
 
 MODM_FLAGS8 (Sett)
 
 Lis3dsh (Data &data, uint8_t address=0x1D)
 
bool configureBlocking (Scale scale, MeasurementRate rate=MeasurementRate::Hz100)
 
modm::ResumableResult< bool > configure (Scale scale, MeasurementRate rate=MeasurementRate::Hz100)
 
modm::ResumableResult< bool > updateSmControl1 (SmControl_t setMask, SmControl_t clearMask=SmControl_t (0xff))
 
modm::ResumableResult< bool > updateSmControl2 (SmControl_t setMask, SmControl_t clearMask=SmControl_t (0xff))
 
modm::ResumableResult< bool > updateControl (Control3_t setMask, Control3_t clearMask=Control3_t (0xff))
 
modm::ResumableResult< bool > updateControl (Control4_t setMask, Control4_t clearMask=Control4_t (0xff))
 
modm::ResumableResult< bool > updateControl (Control5_t setMask, Control5_t clearMask=Control5_t (0xff))
 
modm::ResumableResult< bool > updateControl (Control6_t setMask, Control6_t clearMask=Control6_t (0xff))
 
modm::ResumableResult< bool > readAcceleration ()
 
SmControl_t getControl1 ()
 
SmControl_t getControl2 ()
 
Control3_t getControl3 ()
 
Control4_t getControl4 ()
 
Control5_t getControl5 ()
 
Control6_t getControl6 ()
 
FifoControl_t getFifoControl ()
 
Status_t getStatus ()
 
FifoSource_t getFifoSource ()
 
DatagetData ()
 Get the data object for this sensor.
 

Static Public Member Functions

static constexpr NR next (NR cond)
 
static constexpr NR reset (NR cond)
 

Detailed Description

template<class Transport>
class modm::Lis3dsh< Transport >

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

Member Enumeration Documentation

template<class Transport >
enum modm::Lis3dsh::CMD : uint8_t
Enum ValuesDocumentation
STOP 

Stops execution, and resets RESET- POINT to start.

CONT 

Continues execution from RESET- POINT.

JMP 

Conditional jump.

SRP 

Sets RESET-POINT to next step address.

CRP 

Sets RESET-POINT to address 0 (start position)

SETP 

Sets parameter in register memory.

SETS1 

Sets new value (1st parameter) to SETTy register.

STHR1 

Sets new value (1st parameter) to THRS1y register.

OUTC 

Sets outputs to output registers.

OUTW 

Sets outputs to output registers and waits for host actions for output latch release.

STHR2 

Sets new value (1st parameter) to THRS2y register.

DEC 

Decreases long counter (LC) value and validate counter.

SISW 

Swaps temporary axis mask sign to opposite sign.

REL 

Releases temporary axis mask information.

STHR3 

Sets new value (1st parameter) to THRS3y register.

SSYNC 

Toggles execution from one state machine to the other one.

SABS0 

Sets ABS=0 in SETTy register (unsigned thrs)

SABS1 

Sets ABS=1 in SETTy register (signed thrs)

SELMA 

Sets mask pointer to MASKy_A.

SRADI0 

Sets RADI=0 in SETT2 register (raw data mode)

SRADI1 

Sets RADI=1 in SETT2 register (difference data mode)

SELSA 

Sets mask pointer to MASKy_B.

SCS0 

Sets D_CS=0 in SETT2 register (DIFF data form OFF for State Machine 2)

SCS1 

Sets D_CS=1 in SETT2 register (Constant Shift data form ON for State Machine 2)

SRTAM0 

Sets R_TAM=0 in SETTy register (Temporary Axis mask is kept intact)

STIM3 

Sets a new value (1st parameter) to TIM3y register.

STIM4 

Sets a new value (1st parameter) to TIM4y register.

SRTAM1 

Sets R_TAM=1 in SETTy register (Temporary Axis mask is released to default after every valid NEXT condition)

template<class Transport >
enum modm::Lis3dsh::NR : uint8_t
Enum ValuesDocumentation
NOP 

No operation.

TI1 

Timer 1 (16-bit value) valid.

TI2 

Timer 2 (16-bit value) valid.

TI3 

Timer 3 (8-bit value) valid.

TI4 

Timer 4 (8-bit value) valid.

GNTH1 

Any/triggered axis greater than THRS1.

GNTH2 

Any/triggered axis greater than THRS2.

LNTH1 

Any/triggered axis less than or equal to THRS1.

LNTH2 

Any/triggered axis less than or equal to THRS2.

GRTH1 

Any/triggered axis greater than reversed THRS1.

GRTH2 

Any/triggered axis greater than reversed THRS2.

LRTH1 

Any/triggered axis less than or equal to reversed THRS1.

LRTH2 

Any/triggered axis less than or equal to reversed THRS2.

GTTH1 

Any/triggered axis greater than THRS1 but using always standard axis mask (MASK1)

LLTH2 

All axis less than or equal to THRS2.

NZERO 

Any axis zero crossed.

Constructor & Destructor Documentation

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

Constructor, requires a lis3dsh::Data object. For I2c this also sets the address to 0x1D (alternative: 0x1C).


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