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

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

Inheritance diagram for modm::Bno055< I2cMaster >:
modm::I2cDevice< I2cMaster, 4 > modm::NestedResumable< 10+1 >

Classes

struct  Data
 

Public Typedefs

using Registers_t = FlagsGroup< SelfTestResult_t, InterruptStatus_t, SystemClockStatus_t, UnitSelection_t, SystemTrigger_t, AccConfig_t, MagConfig_t, GyrConfig0_t, GyrConfig1_t, Interrupt_t, modm::Flags8< TemperatureSource >, modm::Flags8< OperationMode >, modm::Flags8< PowerMode >, modm::Flags8< StatusCode >, modm::Flags8< StatusError > >
 

Public Types

enum  Identifier : uint8_t
 
enum  Register : uint8_t
 
enum  SelfTestResult : uint8_t
 
enum  InterruptStatus : uint8_t
 
enum  SystemClockStatus : uint8_t
 SYS_CLK_STATUS reset value is 0x00.
 
enum  UnitSelection : uint8_t
 UNIT_SEL reset value is 0x00.
 
enum  SystemTrigger : uint8_t
 SYS_TRIGGER reset value is 0x00.
 
enum  AccConfig : uint8_t
 ACC_Config reset value is 0x0D.
 
enum  AccPowerMode : uint8_t
 ACC_PWR_Mode reset value is 0x00.
 
enum  AccBandwidth : uint8_t
 ACC_BW reset value is 0x03.
 
enum  AccRange : uint8_t
 ACC_Range reset value is 0x01.
 
enum  MagConfig : uint8_t
 MAG_Config reset value is 0x0B.
 
enum  MagPowerMode : uint8_t
 MAG_Power_mode reset value is 0x00.
 
enum  MagOperationMode : uint8_t
 MAG_OPR_Mode reset value is 0x01.
 
enum  MagDataOutputRate : uint8_t
 MAG_Data_output _rate reset value is 0x03.
 
enum  GyrConfig0 : uint8_t
 GYR_Config_0 reset value is 0x38.
 
enum  GyrBandwidth : uint8_t
 GYR_Bandwidth _rate reset value is 0x07.
 
enum  GyrRange : uint8_t
 GYR_Range reset value is 0x00.
 
enum  GyrConfig1 : uint8_t
 GYR_Config_1 reset value is 0x00.
 
enum  GyrPowerMode : uint8_t
 GYR_Range reset value is 0x00.
 
enum  Interrupt : uint8_t
 
enum  TemperatureSource : uint8_t
 
enum  OperationMode : uint8_t
 
enum  PowerMode : uint8_t
 
enum  StatusCode : uint8_t
 
enum  StatusError : uint8_t
 

Public Member Functions

 MODM_FLAGS8 (SelfTestResult)
 
 MODM_FLAGS8 (InterruptStatus)
 
 MODM_FLAGS8 (SystemClockStatus)
 
 MODM_FLAGS8 (UnitSelection)
 
 MODM_FLAGS8 (SystemTrigger)
 
 MODM_FLAGS8 (AccConfig)
 
 MODM_FLAGS_CONFIG (AccConfig, AccPowerMode)
 
 MODM_FLAGS_CONFIG (AccConfig, AccBandwidth)
 
 MODM_FLAGS_CONFIG (AccConfig, AccRange)
 
 MODM_FLAGS8 (MagConfig)
 
 MODM_FLAGS_CONFIG (MagConfig, MagPowerMode)
 
 MODM_FLAGS_CONFIG (MagConfig, MagOperationMode)
 
 MODM_FLAGS_CONFIG (MagConfig, MagDataOutputRate)
 
 MODM_FLAGS8 (GyrConfig0)
 
 MODM_FLAGS_CONFIG (GyrConfig0, GyrBandwidth)
 
 MODM_FLAGS_CONFIG (GyrConfig0, GyrRange)
 
 MODM_FLAGS8 (GyrConfig1)
 
 MODM_FLAGS_CONFIG (GyrConfig1, GyrPowerMode)
 
 MODM_FLAGS8 (Interrupt)
 
 Bno055 (Data &data, uint8_t address=addr ())
 Constructor, requires a bno055::Data object.
 
modm::ResumableResult< bool > configure (OperationMode mode=OperationMode::NDOF)
 
modm::ResumableResult< bool > readData ()
 
modm::ResumableResult< bool > enableExternalClock ()
 
modm::ResumableResult< bool > updateRegister (Register reg, Registers_t setMask, Registers_t clearMask=Registers_t (0xff))
 
modm::ResumableResult< bool > readRegister (Register reg, uint8_t *output, size_t length=1)
 
DatagetData ()
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 
modm::ResumableResult< bool > ping ()
 
void setAddress (uint8_t address)
 

Static Public Member Functions

static constexpr uint8_t addr (uint8_t offset=1)
 Available I2C addresses.
 

Protected Member Functions

modm::ResumableResult< bool > setPageId (Register regi)
 
modm::ResumableResult< ReturnType > resumable function (...)
 
int8_t getResumableDepth () const
 
bool isResumableRunning () const
 
bool isTransactionRunning ()
 
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 seperate 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 ()
 Force all resumable functions to stop running at the current nesting level.
 
bool wasTransactionSuccessful ()
 

Protected Attributes

I2cWriteReadTransaction transaction
 

Detailed Description

template<class I2cMaster>
class modm::Bno055< I2cMaster >

Author
Niklas Hauser

Member Enumeration Documentation

template<class I2cMaster >
enum modm::Bno055::Interrupt : uint8_t
strong

ACC_Sleep_Config reset value is 0x00 GYR_Sleep_Config reset value is 0x00

INT_MSK reset value is 0x00 INT_EN reset value is 0x00 Masking of interrupts, when enabled the interrupt will update the INT_STA register and trigger a change on the INT pin, when disabled only the INT_STA register will be updated.

template<class I2cMaster >
enum modm::Bno055::InterruptStatus : uint8_t
strong

INT_STA reset value is 0x00 Read: 1 indicates interrupt triggered; 0 indicates no interrupt triggered

template<class I2cMaster >
enum modm::Bno055::SelfTestResult : uint8_t
strong

ST_RESULT reset value is 0x00 Read: 1 indicated test passed; 0 indicates test failed

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.

modm::ResumableResult< ReturnType > resumable modm::NestedResumable< 1 >::function (   ...)
inherited

Run the resumable function.

You need to implement this method in you subclass yourself.

Returns
>NestingError if still running, <=NestingError if it has finished.
int8_t modm::NestedResumable< 1 >::getResumableDepth ( ) const
inheritedinline
Returns
the nesting depth in the current resumable function, or -1 if called outside any resumable function
bool modm::NestedResumable< 1 >::isResumableRunning ( ) const
inheritedinline
Returns
true if a resumable function is running at the current nesting level, else false
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::isTransactionRunning ( )
inheritedinlineprotected
Returns
true when transaction is busy.
modm::ResumableResult<bool> modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::ping ( )
inheritedinline
Return Values
truedevice responds to address
falseno device with address found
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.

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