roverSTM  UM2 2013
Projet M1 Navarro Benjamin
 All Classes Files Functions Groups Pages
Public Member Functions | List of all members
HMC5883L Class Reference
Inheritance diagram for HMC5883L:
I2CDevice

Public Member Functions

 HMC5883L (I2C_TypeDef *I2C_Port, uint8_t address=0x3C, uint32_t speed=100000)
 Initialize a HMC5883L. More...
 
int16x3 getRawData ()
 Get raw data. More...
 
floatx3 getScaledValues ()
 Get scaled values in gauss. More...
 
float getHeading ()
 Get the heading of the device. More...
 
float getTiltCompensatedHeading (rollpitch angles)
 Get the tilt compensated heading of the device. More...
 
string getID ()
 Get the ID string of the magnetometer. More...
 
void setScale (CompasScale s)
 Set the magnetometer scale. More...
 
void setMode (CompasMesMode m, CompasAverageSamples avg=AvgSamples_1, CompasDataRate rate=DataRate_15)
 Set the functionning mode of the magnetometer. More...
 
- Public Member Functions inherited from I2CDevice
 I2CDevice (I2C_TypeDef *I2C_Port, uint8_t address, uint32_t speed=100000)
 Configure and enable the I2C device. More...
 
virtual ~I2CDevice ()
 Deinitialize the device. More...
 

Additional Inherited Members

- Protected Member Functions inherited from I2CDevice
void WriteRegister (uint8_t reg, uint8_t value)
 Write some data into a register. More...
 
void WriteBuffer (uint8_t reg, uint8_t *buffer, uint8_t length)
 Send a buffer of data to the device. More...
 
uint8_t ReadRegister (uint8_t reg)
 Read some data from a register. More...
 
void ReadBuffer (uint8_t reg, uint8_t *buffer, uint8_t length)
 Read a buffer of data from the device. More...
 

Constructor & Destructor Documentation

HMC5883L::HMC5883L ( I2C_TypeDef *  I2C_Port,
uint8_t  address = 0x3C,
uint32_t  speed = 100000 
)

Initialize a HMC5883L.

Parameters
I2CPort
Slaveaddress
Busspeed (Hz)
Return values
None

Member Function Documentation

float HMC5883L::getHeading ( )

Get the heading of the device.

Parameters
None
Return values
Heading(degres)
string HMC5883L::getID ( )

Get the ID string of the magnetometer.

Parameters
None
Return values
IDstring
int16x3 HMC5883L::getRawData ( )

Get raw data.

Parameters
None
Return values
rawvalues (3xint16_t structure)
floatx3 HMC5883L::getScaledValues ( )

Get scaled values in gauss.

Parameters
None
Return values
scaledvalues (3xfloat structure)
float HMC5883L::getTiltCompensatedHeading ( rollpitch  angles)

Get the tilt compensated heading of the device.

Parameters
rolland pitch angles (use de ones in radians)
Return values
Heading(degres)
void HMC5883L::setMode ( CompasMesMode  m,
CompasAverageSamples  avg = AvgSamples_1,
CompasDataRate  rate = DataRate_15 
)

Set the functionning mode of the magnetometer.

Parameters
Mode(CampasMesMode)
Averagedsamples (CompasAverageSamples)
Outputdata rate (CompasDataRate)
Return values
None
void HMC5883L::setScale ( CompasScale  s)

Set the magnetometer scale.

Parameters
scalevalue (from CompasScale structure)
Return values
None

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