upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for hmc5883l.h:

Go to the source code of this file.

Data Structures

struct  _hmc5883l_context
 

Functions

hmc5883l_context hmc5883l_init (int bus)
 
void hmc5883l_close (hmc5883l_context dev)
 
upm_result_t hmc5883l_update (const hmc5883l_context dev)
 
float hmc5883l_direction (const hmc5883l_context dev)
 
float hmc5883l_heading (const hmc5883l_context dev)
 
const int16_t * hmc5883l_coordinates (const hmc5883l_context dev)
 
void hmc5883l_set_declination (const hmc5883l_context dev, float dec)
 
float hmc5883l_get_declination (const hmc5883l_context dev)
 

Typedefs

typedef struct _hmc5883l_contexthmc5883l_context
 

Function Documentation

hmc5883l_context hmc5883l_init ( int  bus)

Initialize an Hmc5883l device

Parameters
busNumber of the used I2C bus
Returns
Device context, or NULL on error

Here is the call graph for this function:

void hmc5883l_close ( hmc5883l_context  dev)

Close the device

Parameters
Devicecontext

Here is the caller graph for this function:

upm_result_t hmc5883l_update ( const hmc5883l_context  dev)

Updates the values by reading from I2C

Parameters
Devicecontext
Returns
UPM result

Here is the caller graph for this function:

const int16_t* hmc5883l_coordinates ( const hmc5883l_context  dev)

Returns a pointer to an int[3] that contains the coordinates as integers. hmc5883l_update() must have been called prior to calling this function.

Parameters
Devicecontext
Returns
*int to an int[3] (X, Y, Z)

Here is the caller graph for this function:

void hmc5883l_set_declination ( const hmc5883l_context  dev,
float  dec 
)

Sets the magnetic declination for better accuracy. hmc5883l_update() must have been called prior to calling this function.

Parameters
Devicecontext
decThe magnetic declination

Here is the caller graph for this function:

float hmc5883l_get_declination ( const hmc5883l_context  dev)

Gets the current magnetic declination value. hmc5883l_update() must have been called prior to calling this function.

Parameters
Devicecontext
Returns
Magnetic declination as a floating-point value

Here is the caller graph for this function:

Typedef Documentation

Device context