modm API documentation
modm::lsm6ds33< I2cMaster > Class Template Reference

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

Inheritance diagram for modm::lsm6ds33< I2cMaster >:
modm::Lis3TransportI2c< I2cMaster > modm::I2cDevice< I2cMaster, 2 > modm::NestedResumable< 10+1 >

Public Typedefs

typedef modm::Configuration< Control1_t, AccDataRate, Bit7|Bit6|Bit5|Bit4 > AccDataRate_t
 
typedef modm::Configuration< Control1_t, AccScale, Bit3|Bit2 > AccScale_t
 
typedef modm::Configuration< Control1_t, AccAABandwith, Bit3|Bit2 > AccAABandwith_t
 
typedef modm::Configuration< Control2_t, GyroDataRate, Bit7|Bit6|Bit5|Bit4 > GyroDataRate_t
 
typedef modm::Configuration< Control2_t, GyroScale, Bit3|Bit2|Bit1 > GyroScale_t
 
typedef modm::Configuration< Control7_t, GyroHPCutoff, Bit5|Bit4 > GyroHPCutoff_t
 
typedef modm::Configuration< Control8_t, AccHPCutoff, Bit5|Bit4 > AccHPCutoff_t
 

Public Types

enum  Register : uint8_t {
  Register::FIFO_CTRL1 = 0x06, Register::FIFO_CTRL2 = 0x07, Register::FIFO_CTRL3 = 0x08, Register::FIFO_CTRL4 = 0x09,
  Register::FIFO_CTRL5 = 0x0A, Register::ORIENT_CFG_G = 0x0B, Register::INT1_CTRL = 0x0D, Register::INT2_CTRL = 0x0E,
  Register::WHO_AM_I = 0x0F, Register::CTRL1 = 0x10, Register::CTRL2 = 0x11, Register::CTRL3 = 0x12,
  Register::CTRL4 = 0x13, Register::CTRL5 = 0x14, Register::CTRL6 = 0x15, Register::CTRL7 = 0x16,
  Register::CTRL8 = 0x17, Register::CTRL9 = 0x18, Register::CTRL10 = 0x19, Register::STATUS = 0x1E,
  Register::OUT_TEMP_L = 0x20, Register::OUT_TEMP_H = 0x21, Register::OUT_X_L_G = 0x22, Register::OUT_X_H_G = 0x23,
  Register::OUT_Y_L_G = 0x24, Register::OUT_Y_H_G = 0x25, Register::OUT_Z_L_G = 0x26, Register::OUT_Z_H_G = 0x27,
  Register::OUT_X_L_XL = 0x28, Register::OUT_X_H_XL = 0x29, Register::OUT_Y_L_XL = 0x2A, Register::OUT_Y_H_XL = 0x2B,
  Register::OUT_Z_L_XL = 0x2C, Register::OUT_Z_H_XL = 0x2D, Register::FIFO_STATUS1 = 0x3A, Register::FIFO_STATUS2 = 0x3B,
  Register::FIFO_STATUS3 = 0x3C, Register::FIFO_STATUS4 = 0x3D, Register::FIFO_DATA_OUT_L = 0x3E, Register::FIFO_DATA_OUT_H = 0x3F
}
 
enum  Control1 : uint8_t {
  Control1::ODR3_XL = Bit7, Control1::ODR2_XL = Bit6, Control1::ODR1_XL = Bit5, Control1::ODR0_XL = Bit4,
  Control1::FS1_XL = Bit3, Control1::FS0_XL = Bit2, Control1::BW1_XL = Bit1, Control1::BW0_XL = Bit0
}
 Control register for the acceleration sensor. More...
 
enum  AccDataRate : uint8_t {
  AccDataRate::Off = 0x00, AccDataRate::Rate_13_Hz = 0x10, AccDataRate::Rate_26_Hz = 0x20, AccDataRate::Rate_52_Hz = 0x30,
  AccDataRate::Rate_104_Hz = 0x40, AccDataRate::Rate_208_Hz = 0x50, AccDataRate::Rate_416_Hz = 0x60, AccDataRate::Rate_833_Hz = 0x70,
  AccDataRate::Rate_1666_Hz = 0x80, AccDataRate::Rate_3332_Hz = 0x90, AccDataRate::Rate_6664_Hz = 0xA0
}
 Output Data Rates for the Acceleration sensor. More...
 
enum  AccScale : uint8_t { AccScale::Scale_2_G = 0x00, AccScale::Scale_4_G = 0x08, AccScale::Scale_8_G = 0x0C, AccScale::Scale_16_G = 0x04 }
 Full scale of the acceleration sensor data output. More...
 
enum  AccAABandwith : uint8_t { AccAABandwith::Bw_400_Hz = 0x00, AccAABandwith::Bw_200_Hz = 0x01, AccAABandwith::BW_100_Hz = 0x02, AccAABandwith::Bw_50_Hz = 0x03 }
 Anti aliasing filter bandwith for the acceleration sensor (only used when Control Register 4, Bit 7 is 1) More...
 
enum  Control2 : uint8_t {
  Control2::ODR3_G = Bit7, Control2::ODR2_G = Bit6, Control2::ODR1_G = Bit5, Control2::ODR0_G = Bit4,
  Control2::FS2_G = Bit3, Control2::FS1_G = Bit2, Control2::FS0_G = Bit1
}
 Control Register 2 for the Gyroscope. More...
 
enum  GyroDataRate : uint8_t {
  GyroDataRate::Off = 0x00, GyroDataRate::Rate_13_Hz = 0x10, GyroDataRate::Rate_26_Hz = 0x20, GyroDataRate::Rate_52_Hz = 0x30,
  GyroDataRate::Rate_104_Hz = 0x40, GyroDataRate::Rate_208_Hz = 0x50, GyroDataRate::Rate_416_Hz = 0x60, GyroDataRate::Rate_833_Hz = 0x70,
  GyroDataRate::Rate_1666_Hz = 0x80
}
 Output Data Rates for the gyroscope. More...
 
enum  GyroScale : uint8_t {
  GyroScale::Scale_125_dps = 0x02, GyroScale::Scale_245_dps = 0x00, GyroScale::Scale_500_dps = 0x04, GyroScale::Scale_1000_dps = 0x08,
  GyroScale::Scale_2000_dps = 0x0C
}
 Full scale of the gyroscope data output. More...
 
enum  Control3 : uint8_t {
  Control3::BOOT = Bit7, Control3::BDU = Bit6, Control3::H_LACTIVE = Bit5, Control3::PP_OD = Bit4,
  Control3::SIM = Bit3, Control3::IF_INC = Bit2, Control3::BLE = Bit1, Control3::SW_RESET = Bit0
}
 Control Register 3. More...
 
enum  Control4 : uint8_t { Control4::XL_BW_SCAL_ODR = Bit7, Control4::SLEEP_G = Bit6, Control4::INT2_on_INT1 = Bit5, Control4::FIFO_TEMP_EN = Bit4 }
 Control Register 4. More...
 
enum  Control6 : uint8_t { Control6::TRIG_EN = Bit7, Control6::LVL_EN = Bit6, Control6::LVL2_EN = Bit5, Control6::XL_HM_MODE = Bit4 }
 Control Register 6. More...
 
enum  Control7 : uint8_t {
  Control7::G_HM_MODE = Bit7, Control7::HP_G_EN = Bit6, Control7::HP_CF_G1 = Bit5, Control7::HP_CF_G0 = Bit4,
  Control7::HP_G_RST = Bit3
}
 Control Register 7. More...
 
enum  GyroHPCutoff : uint8_t { GyroHPCutoff::Cutoff_0_0081_Hz = 0x00, GyroHPCutoff::Cutoff_0_0324_Hz = 0x10, GyroHPCutoff::Cutoff_2_07_Hz = 0x20, GyroHPCutoff::Cutoff_16_32_Hz = 0x30 }
 High-pass cutoff frequency selection for the gyroscope. More...
 
enum  Control8 : uint8_t { Control8::LPF_XL_EN = Bit7, Control8::HP_CF_XL1 = Bit6, Control8::HP_CF_XL0 = Bit5, Control8::HP_SLOPE_XL_EN = Bit3 }
 Control Register 8. More...
 
enum  AccHPCutoff : uint8_t { AccHPCutoff::Cutoff_DIV_50 = 0x00, AccHPCutoff::Cutoff_DIV_100 = 0x10, AccHPCutoff::Cutoff_DIV_9 = 0x20, AccHPCutoff::Cutoff_DIV_400 = 0x30 }
 High-pass cutoff frequency selection for the gyroscope. More...
 
enum  Control9 : uint8_t { Control9::Z_EN_XL = Bit5, Control9::X_EN_XL = Bit4, Control9::Y_EN_XL = Bit3 }
 Control Register 9. More...
 
enum  Control10 : uint8_t { Control10::Z_EN_G = Bit5, Control10::X_EN_G = Bit4, Control10::Y_EN_G = Bit3 }
 Control Register 10. More...
 
enum  Status : uint8_t { Status::EV_BOOT = Bit3, Status::TDA = Bit2, Status::GDA = Bit1, Status::XLDA = Bit0 }
 STATUS is read-only. More...
 

Public Member Functions

 MODM_FLAGS8 (Control1)
 
 MODM_FLAGS8 (Control2)
 
 MODM_FLAGS8 (Control3)
 
 MODM_FLAGS8 (Control4)
 
 MODM_FLAGS8 (Control6)
 
 MODM_FLAGS8 (Control7)
 
 MODM_FLAGS8 (Control8)
 
 MODM_FLAGS8 (Control9)
 
 MODM_FLAGS8 (Control10)
 
 MODM_FLAGS8 (Status)
 
 Lsm6ds33 (uint8_t address=0x6A)
 Construct a driver object for the LSM6DS33 chip. More...
 
modm::ResumableResult< bool > configureAccelerationSensor (AccDataRate accRate, AccScale accScale)
 Configures the acceleration sensor This method will setup the data rate and the scale with which the sensor will sample the acceleration data. A sample rate has to be set in order to turn on the sensor. More...
 
modm::ResumableResult< bool > configureGyroscope (GyroDataRate gyroRate, GyroScale gyroScale)
 Configures the gyroscope This method will setup the data rate and the scale with which the sensor will sample the spin rates. A sample rate has to be set in order to turn on the sensor. More...
 
modm::ResumableResult< bool > readAccelerationRaw (Vector3i &acceleration)
 Reads out the raw acceleration data into a given vector object. More...
 
modm::ResumableResult< bool > readGyroscopeRaw (Vector3i &spinRates)
 Reads out the raw gyroscope data into a given vector object. More...
 
AccScale getAccelerationScale ()
 Get the currently configured scale for the acceleration sensor. More...
 
GyroScale getGyroscopeScale ()
 Get the currently configured scale for the gyroscope. More...
 
modm::ResumableResult< bool > readAcceleration (Vector3f &acceleration)
 Reads out the scaled acceleration data in g. More...
 
modm::ResumableResult< bool > readGyroscope (Vector3f &spinRates)
 Reads out the scaled spin rates from the gyroscope in degrees per second. More...
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 
modm::ResumableResult< bool > ping ()
 
modm::ResumableResult< bool > read (uint8_t *buffer, std::size_t size)
 Starts a write transaction and waits until finished.
 
void setAddress (uint8_t address)
 
modm::ResumableResult< bool > write (const uint8_t *buffer, std::size_t size)
 Starts a write transaction and waits until finished.
 
modm::ResumableResult< bool > writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize)
 Starts a write-read transaction and waits until finished.
 

Protected Member Functions

int8_t getResumableDepth () const
 
bool isResumableRunning () const
 
bool isTransactionRunning ()
 
modm::ResumableResult< bool > read (uint8_t reg, uint8_t &value)
 read a 8bit value
 
modm::ResumableResult< bool > read (uint8_t reg, uint8_t *buffer, uint8_t length)
 read multiple 8bit values from a start register
 
modm::ResumableResult< bool > runTransaction ()
 Starts our own transaction and waits until finished.
 
bool startRead (uint8_t *buffer, std::size_t size)
 Configures the transaction with a read operation and starts it.
 
bool startTransaction ()
 Starts the transaction with our own transaction object.
 
bool startTransaction (modm::I2cTransaction *transaction)
 Starts the transaction with a separate transaction object.
 
bool startWrite (const uint8_t *buffer, std::size_t size)
 Configures the transaction with a write operation and starts it.
 
bool startWriteRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize)
 Configures the transaction with a write/read operation and starts it.
 
void stopResumable ()
 
bool wasTransactionSuccessful ()
 
modm::ResumableResult< bool > write (uint8_t reg, uint8_t value)
 write a 8bit value
 

Protected Attributes

I2cWriteReadTransaction transaction
 

Static Protected Attributes

static constexpr float accConvTable [4]
 
static constexpr float gyroConvTable [4]
 

Detailed Description

template<class I2cMaster>
class modm::lsm6ds33< I2cMaster >

Template Parameters
I2cMasterI2cMaster interface
Author
Benjamin Carrick

Member Enumeration Documentation

template<class I2cMaster >
enum modm::lsm6ds33::AccAABandwith : uint8_t
strong

Anti aliasing filter bandwith for the acceleration sensor (only used when Control Register 4, Bit 7 is 1)

Enum ValuesDocumentation
Bw_400_Hz 

400 Hz

Bw_200_Hz 

200 Hz

BW_100_Hz 

100 Hz

Bw_50_Hz 

50 Hz

template<class I2cMaster >
enum modm::lsm6ds33::AccDataRate : uint8_t
strong

Output Data Rates for the Acceleration sensor.

Enum ValuesDocumentation
Off 

Turn off the acceleration sensor.

Rate_13_Hz 

13 Hz

Rate_26_Hz 

26 Hz

Rate_52_Hz 

52 Hz

Rate_104_Hz 

104 Hz

Rate_208_Hz 

208 Hz

Rate_416_Hz 

416 Hz

Rate_833_Hz 

833 Hz

Rate_1666_Hz 

1666 Hz

Rate_3332_Hz 

3332 Hz

Rate_6664_Hz 

6664 Hz

template<class I2cMaster >
enum modm::lsm6ds33::AccHPCutoff : uint8_t
strong

High-pass cutoff frequency selection for the gyroscope.

Enum ValuesDocumentation
Cutoff_DIV_50 

Acceleration Data Rate / 50.

Cutoff_DIV_100 

Acceleration Data Rate / 100.

Cutoff_DIV_9 

Acceleration Data Rate / 9.

Cutoff_DIV_400 

Acceleration Data Rate / 400.

template<class I2cMaster >
enum modm::lsm6ds33::AccScale : uint8_t
strong

Full scale of the acceleration sensor data output.

Enum ValuesDocumentation
Scale_2_G 

+- 2g

Scale_4_G 

+- 4g

Scale_8_G 

+- 8g

Scale_16_G 

+- 16g

template<class I2cMaster >
enum modm::lsm6ds33::Control1 : uint8_t
strong

Control register for the acceleration sensor.

Enum ValuesDocumentation
ODR3_XL 

Output data rate bit 3.

ODR2_XL 

Output data rate bit 2.

ODR1_XL 

Output data rate bit 1.

ODR0_XL 

Output data rate bit 0.

FS1_XL 

Full scale selection bit 1.

FS0_XL 

Full scale selection bit 0.

BW1_XL 

Anti-aliasing bandwidth bit 1.

BW0_XL 

Anti-aliasing bandwidth bit 0.

template<class I2cMaster >
enum modm::lsm6ds33::Control10 : uint8_t
strong

Control Register 10.

Enum ValuesDocumentation
Z_EN_G 

Enable Z-Axis for the gyroscope (default 1)

X_EN_G 

Enable X-Axis for the gyroscope (default 1)

Y_EN_G 

Enable Y-Axis for the gyroscope (default 1)

template<class I2cMaster >
enum modm::lsm6ds33::Control2 : uint8_t
strong

Control Register 2 for the Gyroscope.

Enum ValuesDocumentation
ODR3_G 

Output data rate bit 3.

ODR2_G 

Output data rate bit 2.

ODR1_G 

Output data rate bit 1.

ODR0_G 

Output data rate bit 0.

FS2_G 

Full scale selection bit 2.

FS1_G 

Full scale selection bit 1.

FS0_G 

Full scale selection bit 0.

template<class I2cMaster >
enum modm::lsm6ds33::Control3 : uint8_t
strong

Control Register 3.

Enum ValuesDocumentation
BOOT 

Reboot memory content.

BDU 

Block data update (0 = continous (default), 1 = wait until registers read)

H_LACTIVE 

Interrupt activation level (0 = high active(default), 1= low active)

PP_OD 

Interrupt pin mode (0 = Push-Pull(default), 1 = Open-Drain)

SIM 

SPI Interface Mode (0 = 4 Wire(default), 1 = 3 Wire)

IF_INC 

I2C increment register on access (0 = disabled, 1= enabled(default))

BLE 

Endianess selection (0 = Little endian(default), 1 = Big endian.

SW_RESET 

Software Reset.

template<class I2cMaster >
enum modm::lsm6ds33::Control4 : uint8_t
strong

Control Register 4.

Enum ValuesDocumentation
XL_BW_SCAL_ODR 

Manual selection of bandwidth for the acceleration sensor (0 = automatic, 1 = manual)

SLEEP_G 

Gyroscope sleep mode enable (default = 0)

INT2_on_INT1 

Interrupt 2 output on Interrupt 1 pad (default = 0)

FIFO_TEMP_EN 

Enable Temperature output as 4th fifo set.

template<class I2cMaster >
enum modm::lsm6ds33::Control6 : uint8_t
strong

Control Register 6.

Enum ValuesDocumentation
TRIG_EN 

Gyroscope data edge-sensitive trigger enable (default = 0)

LVL_EN 

Gyroscope data level-sensitive trigger enable (default = 0)

LVL2_EN 

Gyroscope level-sensitive latched enable.

XL_HM_MODE 

Disable high performance mode for acceleration sensor (default = 0)

template<class I2cMaster >
enum modm::lsm6ds33::Control7 : uint8_t
strong

Control Register 7.

Enum ValuesDocumentation
G_HM_MODE 

Disable high performance mode for gyroscope (default = 0)s.

HP_G_EN 

Enable high-pass filter for gyroscope (default = 0)

HP_CF_G1 

Gyroscope high-pass filter cutoff frequency bit 1.

HP_CF_G0 

Gyroscope high-pass filter cutoff frequuency bit 0.

HP_G_RST 

Reset high-pass filter for gyroscope.

template<class I2cMaster >
enum modm::lsm6ds33::Control8 : uint8_t
strong

Control Register 8.

Enum ValuesDocumentation
LPF_XL_EN 

Enable the low-pass filter for the acceleration sensor.

HP_CF_XL1 

Acceleration sensor high-pass filter cutoff frequency bit 1.

HP_CF_XL0 

Acceleration sensor high-pass filter cutoff frequency bit 0.

HP_SLOPE_XL_EN 

High-pass or slope filter selection.

template<class I2cMaster >
enum modm::lsm6ds33::Control9 : uint8_t
strong

Control Register 9.

Enum ValuesDocumentation
Z_EN_XL 

Enable Z-Axis for the acceleration sensor (default 1)

X_EN_XL 

Enable X-Axis for the acceleration sensor (default 1)

Y_EN_XL 

Enable Y-Axis for the acceleration sensor (default 1)

template<class I2cMaster >
enum modm::lsm6ds33::GyroDataRate : uint8_t
strong

Output Data Rates for the gyroscope.

Enum ValuesDocumentation
Off 

Turn off the gyroscope.

Rate_13_Hz 

13 Hz

Rate_26_Hz 

26 Hz

Rate_52_Hz 

52 Hz

Rate_104_Hz 

104 Hz

Rate_208_Hz 

208 Hz

Rate_416_Hz 

416 Hz

Rate_833_Hz 

833 Hz

Rate_1666_Hz 

1666 Hz

template<class I2cMaster >
enum modm::lsm6ds33::GyroHPCutoff : uint8_t
strong

High-pass cutoff frequency selection for the gyroscope.

Enum ValuesDocumentation
Cutoff_0_0081_Hz 

0.0081 Hz

Cutoff_0_0324_Hz 

0.0324 Hz

Cutoff_2_07_Hz 

2.07 Hz

Cutoff_16_32_Hz 

16.32 Hz

template<class I2cMaster >
enum modm::lsm6ds33::GyroScale : uint8_t
strong

Full scale of the gyroscope data output.

Enum ValuesDocumentation
Scale_125_dps 

125 degrees per second

Scale_245_dps 

245 degrees per second

Scale_500_dps 

500 degrees per second

Scale_1000_dps 

1000 degrees per second

Scale_2000_dps 

2000 degrees per secons

template<class I2cMaster >
enum modm::lsm6ds33::Register : uint8_t
strong
Enum ValuesDocumentation
FIFO_CTRL1 

FIFO control register 1.

FIFO_CTRL2 

FIFO control register 2.

FIFO_CTRL3 

FIFO control register 3.

FIFO_CTRL4 

FIFO control register 4.

FIFO_CTRL5 

FIFO control register 5.

ORIENT_CFG_G 

Orientation config register.

INT1_CTRL 

Interrrupt 1 Control register.

INT2_CTRL 

Interrrupt 1 Control register.

WHO_AM_I 

Contains 0x69.

CTRL1 

Control register 1: rw.

CTRL2 

Control register 2: rw.

CTRL3 

Control register 3: rw.

CTRL4 

Control register 4: rw.

CTRL5 

Control register 5: rw.

CTRL6 

Control register 6: rw.

CTRL7 

Control register 7: rw.

CTRL8 

Control register 8: rw.

CTRL9 

Control register 9: rw.

CTRL10 

Control register 10: rw.

STATUS 

Status Data Register.

OUT_TEMP_L 

Temperature output register low.

OUT_TEMP_H 

Temperature output register high.

OUT_X_L_G 

Angular rates output x-axis register low.

OUT_X_H_G 

Angular rates output x-axis register high.

OUT_Y_L_G 

Angular rates output y-axis register low.

OUT_Y_H_G 

Angular rates output y-axis register high.

OUT_Z_L_G 

Angular rates output z-axis register low.

OUT_Z_H_G 

Angular rates output z-axis register high.

OUT_X_L_XL 

Acceleration output x-axis register low.

OUT_X_H_XL 

Acceleration output x-axis register high.

OUT_Y_L_XL 

Acceleration output y-axis register low.

OUT_Y_H_XL 

Acceleration output y-axis register high.

OUT_Z_L_XL 

Acceleration output z-axis register low.

OUT_Z_H_XL 

Acceleration output z-axis register high.

FIFO_STATUS1 

Fifo status register 1.

FIFO_STATUS2 

Fifo status register 2.

FIFO_STATUS3 

Fifo status register 3.

FIFO_STATUS4 

Fifo status register 4.

FIFO_DATA_OUT_L 

Fifo data output register low.

FIFO_DATA_OUT_H 

Fifo data output register high.

template<class I2cMaster >
enum modm::lsm6ds33::Status : uint8_t
strong

STATUS is read-only.

Enum ValuesDocumentation
EV_BOOT 

Bootup is running.

TDA 

New temperature data available.

GDA 

New gyroscope data available.

XLDA 

New acceleration sensor data available.

Member Function Documentation

void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::attachConfigurationHandler ( I2c::ConfigurationHandler  handler)
inheritedinline

Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.

template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::configureAccelerationSensor ( AccDataRate  accRate,
AccScale  accScale 
)

Configures the acceleration sensor This method will setup the data rate and the scale with which the sensor will sample the acceleration data. A sample rate has to be set in order to turn on the sensor.

Parameters
accRateThe sample rate for the acceleration sensor
accScaleThe full scale of the acceleration data
Returns
Whether the configuration was successful
template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::configureGyroscope ( GyroDataRate  gyroRate,
GyroScale  gyroScale 
)

Configures the gyroscope This method will setup the data rate and the scale with which the sensor will sample the spin rates. A sample rate has to be set in order to turn on the sensor.

Parameters
accRateThe sample rate for the gyroscope
accScaleThe full scale of the spin rate data
Returns
Whether the configuration was successful
template<class I2cMaster >
AccScale modm::lsm6ds33< I2cMaster >::getAccelerationScale ( )

Get the currently configured scale for the acceleration sensor.

Returns
AccScale The currently config acceleration data scale
template<class I2cMaster >
GyroScale modm::lsm6ds33< I2cMaster >::getGyroscopeScale ( )

Get the currently configured scale for the gyroscope.

Returns
AccScale The currently config gyroscope data scale
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::isTransactionRunning ( )
inheritedinlineprotected
Returns
true when transaction is busy.
template<class I2cMaster >
modm::lsm6ds33< I2cMaster >::Lsm6ds33 ( uint8_t  address = 0x6A)

Construct a driver object for the LSM6DS33 chip.

Parameters
addressThe I2C device address of the sensor
modm::ResumableResult<bool> modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::ping ( )
inheritedinline
Return Values
truedevice responds to address
falseno device with address found
template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::readAcceleration ( Vector3f acceleration)

Reads out the scaled acceleration data in g.

Parameters
accelerationA reference to a Vector3f object the data will be written to
Returns
Whether the sensor data have been read
template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::readAccelerationRaw ( Vector3i acceleration)

Reads out the raw acceleration data into a given vector object.

Parameters
accelerationA reference to a Vector3i object the data will be written to
Returns
Whether the sensor data have been read
template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::readGyroscope ( Vector3f spinRates)

Reads out the scaled spin rates from the gyroscope in degrees per second.

Parameters
spinRatesA reference to a Vector3f object the data will be written to
Returns
Whether the sensor data have been read
template<class I2cMaster >
modm::ResumableResult<bool> modm::lsm6ds33< I2cMaster >::readGyroscopeRaw ( Vector3i spinRates)

Reads out the raw gyroscope data into a given vector object.

Parameters
spinRatesA reference to a Vector3i object the data will be written to
Returns
Whether the sensor data have been read
void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::setAddress ( uint8_t  address)
inheritedinline

Sets a new address of the slave device.

Parameters
addressthe slave address not yet shifted left (address < 128).
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::wasTransactionSuccessful ( )
inheritedinlineprotected
Returns
true when transaction did not return an error.

Member Data Documentation

template<class I2cMaster >
constexpr float modm::lsm6ds33< I2cMaster >::accConvTable[4]
staticprotectedconstexpr
Initial value:
{
0.000061035f,
0.000488281f,
0.00012207f,
0.000244141f
}
template<class I2cMaster >
constexpr float modm::lsm6ds33< I2cMaster >::gyroConvTable[4]
staticprotectedconstexpr
Initial value:
{
0.007476807f,
0.015258789f,
0.030517578f,
0.061035156f
}

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