Embed: (wiki syntax)

« Back to documentation index

HMC6343 Class Reference

HMC6343 Class Reference

Honeywell HMC6343 digital compass. More...

#include <HMC6343.h>

Public Member Functions

 HMC6343 (PinName sda, PinName scl)
 Constructor.
void sampleHeading (Heading *p_heading)
 Sample the device and return the result.
void setReset (void)
 Update bridge offsets.
void setCalibrationMode (int enterOrExit)
 Enter into or exit from calibration mode.
void saveOpMode (void)
 Save the current operation mode byte to EEPROM.
int getSlaveAddress (void)
 Read the memory location on the device which contains the slave address.
int getOffset (int axis)
 Read the current offset for X or Y axis magnetometer.
int getSoftwareVersion (void)
 Get the software version on the device.
int getOpMode (void)
 Get the current operation mode.
void setOpMode (int opMode)
 Set the operation mode.

Detailed Description

Honeywell HMC6343 digital compass.

Definition at line 123 of file HMC6343.h.


Constructor & Destructor Documentation

HMC6343 ( PinName  sda,
PinName  scl 
)

Constructor.

Parameters:
sdambed pin to use for SDA line of I2C interface.
sclmbed pin to use for SCL line of I2C interface.

Definition at line 52 of file HMC6343.cpp.


Member Function Documentation

int getOffset ( int  axis )

Read the current offset for X or Y axis magnetometer.

Parameters:
axis0x01 -> X-axis 0x02 -> Y-axis 0x04 -> Z-axis
Returns:
The current offset for the axis as a 16-bit number.

Definition at line 111 of file HMC6343.cpp.

int getOpMode ( void   )

Get the current operation mode.

Returns:
0x00 -> Standby mode 0x01 -> Query mode 0x02 -> Continuous mode

Definition at line 142 of file HMC6343.cpp.

int getSlaveAddress ( void   )

Read the memory location on the device which contains the slave address.

Returns:
The slave address of the device.

Definition at line 107 of file HMC6343.cpp.

int getSoftwareVersion ( void   )

Get the software version on the device.

Returns:
The software version number.

Definition at line 138 of file HMC6343.cpp.

void sampleHeading ( Heading *  p_heading )

Sample the device and return the result.

Returns:
In heading output mode, the current heading as a number between 0-3599, representing 0-359.9 degrees. In raw magnetometer X output mode, the raw output of the X-axis magnetometer. In raw magnetometer Y mode, the raw output of the Y-axis magnetometer. In magnetometer X mode, the corrected output of the X-axis magnetometer. In magnetometer Y mode, the corrected output of the Y-axis magnetometer.

Definition at line 63 of file HMC6343.cpp.

void saveOpMode ( void   )

Save the current operation mode byte to EEPROM.

void setCalibrationMode ( int  enterOrExit )

Enter into or exit from calibration mode.

Parameters:
enterOrExit0x45 -> Exit 0x43 -> Enter

Definition at line 91 of file HMC6343.cpp.

void setOpMode ( int  opMode )

Set the operation mode.

Parameters:
periodicSetReset0x00 -> No periodic set/reset 0x01 -> Periodic set/reset

Definition at line 161 of file HMC6343.cpp.

void setReset ( void   )

Update bridge offsets.

Performs a set/reset immediately.

Definition at line 84 of file HMC6343.cpp.