xpcc
xpcc::Itg3200< I2cMaster > Class Template Reference

Basic ITG3200 digital gyroscope sensor driver. More...

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

Inheritance diagram for xpcc::Itg3200< I2cMaster >:
xpcc::itg3200 xpcc::I2cDevice< I2cMaster, 2 > xpcc::NestedResumable< NestingLevels+1 >

Public Member Functions

 Itg3200 (Data &data, uint8_t address=0x68)
 Constructor, requires an itg3200::Data object, sets address to default of 0x68 (AD0 low: 0x69)
 
xpcc::ResumableResult< bool > configure (LowPassFilter filter=LowPassFilter::Hz20, uint8_t divider=0)
 
xpcc::ResumableResult< bool > readRotation ()
 reads the temperature and gyro registers and buffer the results
 
xpcc::ResumableResult< bool > setLowPassFilter (LowPassFilter filter)
 
xpcc::ResumableResult< bool > setSampleRateDivider (uint8_t divider)
 
xpcc::ResumableResult< bool > updateInterrupt (Interrupt_t setMask, Interrupt_t clearMask=Interrupt_t(0xf5))
 
xpcc::ResumableResult< bool > updatePower (Power_t setMask, Power_t clearMask=Power_t(0xff))
 
LowPassFilter getLowPassFilter ()
 
Interrupt_t getInterrupt ()
 
Power_t getPower ()
 
Status_t getStatus ()
 
xpcc::ResumableResult< bool > readStatus ()
 
DatagetData ()
 Get the data object for this sensor.
 
- Public Member Functions inherited from xpcc::I2cDevice< I2cMaster, 2 >
 I2cDevice (uint8_t address)
 
void setAddress (uint8_t address)
 Sets a new address of the slave device. More...
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed. More...
 
xpcc::ResumableResult< bool > ping ()
 

Additional Inherited Members

- Public Types inherited from xpcc::itg3200
enum  LowPassFilter : uint8_t {
  Hz256,
  Hz188,
  Hz98,
  Hz42,
  Hz20,
  Hz10,
  Hz5
}
 
enum  Interrupt : uint8_t {
  Interrupt::ACTL,
  Interrupt::OPEN,
  Interrupt::LATCH_INT_EN,
  Interrupt::INT_ANYRD_2CLEAR,
  Interrupt::ITG_RDY_EN,
  Interrupt::RAW_RDY_EN
}
 The bit masks of the INT_CFG register. More...
 
enum  Status : uint8_t {
  Status::ITG_RDY,
  Status::RAW_DATA_RDY
}
 The bit masks of the INT_STATUS register. More...
 
enum  Power : uint8_t {
  Power::H_RESET,
  Power::SLEEP,
  Power::STBY_XG,
  Power::STBY_YG,
  Power::STBY_ZG,
  CLK_SEL2,
  CLK_SEL1,
  CLK_SEL0,
  CLK_SEL_Mask
}
 The bit masks of the PWR_MGM register. More...
 
enum  ClockSource : uint8_t {
  ClockSource::Internal,
  ClockSource::PllX,
  ClockSource::PllY,
  ClockSource::PllZ,
  ClockSource::PllExternal32kHz,
  ClockSource::PllExternal19MHz
}
 
typedef xpcc::Flags8< InterruptInterrupt_t
 
typedef xpcc::Flags8< StatusStatus_t
 
typedef xpcc::Flags8< PowerPower_t
 
typedef Configuration< Power_t, ClockSource,(Bit2|Bit1|Bit0) > ClockSource_t
 
- Protected Member Functions inherited from xpcc::I2cDevice< I2cMaster, 2 >
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.
 
bool startWrite (const uint8_t *buffer, std::size_t size)
 Configures the transaction with a write operation and starts it.
 
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 (xpcc::I2cTransaction *transaction)
 Starts the transaction with a seperate transaction object.
 
bool isTransactionRunning ()
 
bool wasTransactionSuccessful ()
 
xpcc::ResumableResult< bool > runTransaction ()
 Starts our own transaction and waits until finished.
 
- Protected Member Functions inherited from xpcc::NestedResumable< NestingLevels+1 >
 NestedResumable ()
 Construct a new class with nested resumable functions.
 
void stopResumable ()
 Force all resumable functions to stop running at the current nesting level.
 
bool isResumableRunning () const
 
int8_t getResumableDepth () const
 
- Protected Attributes inherited from xpcc::I2cDevice< I2cMaster, 2 >
I2cWriteReadTransaction transaction
 

Detailed Description

template<typename I2cMaster>
class xpcc::Itg3200< I2cMaster >

For further information on the special sensing functions, consult the datasheet.

Author
Niklas Hauser

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