API definition for the QMC5883L device driver. More...

Detailed Description

API definition for the QMC5883L device driver.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file qmc5883l.h.

#include <stdint.h>
#include "periph/gpio.h"
#include "periph/i2c.h"
+ Include dependency graph for qmc5883l.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  qmc5883l_params_t
 QMC5883L initialization parameters. More...
 
struct  qmc5883l_t
 QMC5883L device descriptor. More...
 

Macros

#define QMC5883L_ADDR   (0x0d)
 Static QMC5883L I2C address (can not be changed)
 

Enumerations

enum  {
  QMC5883L_OK, QMC5883L_NODATA, QMC5883L_OVERFLOW, QMC5883L_BUSERR,
  QMC5883L_NOCFG
}
 Error codes used by the QMC5883L driver. More...
 
enum  qmc5883l_odr_t { QMC5883L_ODR_10HZ = (0u << 2), QMC5883L_ODR_50HZ = (1u << 2), QMC5883L_ODR_100HZ = (2u << 2), QMC5883L_ODR_200HZ = (3u << 2) }
 Output data rate. More...
 
enum  qmc5883l_rng_t { QMC5883L_RNG_2G = (0u << 4), QMC5883L_RNG_8G = (1u << 4) }
 Output value range. More...
 
enum  qmc5883l_osr_t { QMC5883L_OSR_512 = (0u << 6), QMC5883L_OSR_256 = (1u << 6), QMC5883L_OSR_128 = (2u << 6), QMC5883L_OSR_64 = (3u << 6) }
 Over sample rate (bandwidth of internal digital filter) More...
 

Functions

int qmc5883l_init (qmc5883l_t *dev, const qmc5883l_params_t *params)
 Initialize the given QMC5883L magnetic sensor. More...
 
int qmc5883l_data_ready (const qmc5883l_t *dev)
 Check if new data is available. More...
 
int qmc5883l_read (const qmc5883l_t *dev, int16_t *data_out)
 Read sampled data from the device [converted to milli-Gauss]. More...
 
int qmc5883l_read_raw (const qmc5883l_t *dev, int16_t *data_out)
 Read RAW data from the device. More...
 
int qmc5883l_poweron (const qmc5883l_t *dev)
 Power on the sensor (put it into continuous sampling mode) More...
 
int qmc5883l_poweroff (const qmc5883l_t *dev)
 Power off the sensor (put it into standby mode) More...
 
int qmc5883l_init_int (const qmc5883l_t *dev, gpio_cb_t cb, void *arg)
 Initialize data ready (DRDY) interrupt notifications. More...
 
int qmc5883l_irq_enable (const qmc5883l_t *dev)
 Enable the data ready (DRDY) interrupt. More...
 
int qmc5883l_irq_disable (const qmc5883l_t *dev)
 Disable the data ready (DRDY) interrupt. More...