Loading...
Searching...
No Matches

Device driver interface for the LIS3MDL 3-axis magnetometer. More...

Detailed Description

Device driver interface for the LIS3MDL 3-axis magnetometer.

Author
René Herthel rene-.nosp@m.hert.nosp@m.hel@o.nosp@m.utlo.nosp@m.ok.de

Definition in file lis3mdl.h.

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

Go to the source code of this file.

Data Structures

struct  lis3mdl_3d_data_t
 3d data container of the LIS3MDL sensor More...
 
struct  lis3mdl_params_t
 Device initialization parameters. More...
 
struct  lis3mdl_t
 Device descriptor for LIS3MDL sensor. More...
 

Enumerations

enum  lis3mdl_xy_mode_t { LIS3MDL_XY_MODE_LOW = 0x00 , LIS3MDL_XY_MODE_MEDIUM = 0x20 , LIS3MDL_XY_MODE_HIGH = 0x40 , LIS3MDL_XY_MODE_ULTRA = 0x60 }
 Operating mode of x- and y-axis for LIS3MDL. More...
 
enum  lis3mdl_z_mode_t { LIS3MDL_Z_MODE_LOW = 0x00 , LIS3MDL_Z_MODE_MEDIUM = 0x04 , LIS3MDL_Z_MODE_HIGH = 0x08 , LIS3MDL_Z_MODE_ULTRA = 0x0C }
 Operating mode of z-axis for LIS3MDL. More...
 
enum  lis3mdl_odr_t {
  LIS3MDL_ODR_0_625Hz = 0x00 , LIS3MDL_ODR_1_25Hz = 0x04 , LIS3MDL_ODR_2_5Hz = 0x08 , LIS3MDL_ODR_10Hz = 0x10 ,
  LIS3DML_ODR_20HZ = 0x14 , LIS3DML_ODR_40HZ = 0x18 , LIS3MDL_ODR_80HZ = 0x1C
}
 Output data rate [Hz] for LIS3MDL. More...
 
enum  lis3mdl_scale_t { LIS3MDL_SCALE_4G = 0x00 , LIS3MDL_SCALE_8G = 0x20 , LIS3MDL_SCALE_12G = 0x40 , LIS3MDL_SCALE_16G = 0x60 }
 Scale [gauss] for LIS3MDL. More...
 
enum  lis3mdl_op_t { LIS3MDL_OP_CONT_CONV = 0x00 , LIS3MDL_OP_SNGL_CONV = 0x01 , LIS3MDL_OP_PDOWN = 0x11 }
 Operating modes. More...
 

Functions

int lis3mdl_init (lis3mdl_t *dev, const lis3mdl_params_t *params)
 Initialize a new LIS3DML device.
 
void lis3mdl_read_mag (const lis3mdl_t *dev, lis3mdl_3d_data_t *data)
 Reads the magnometer value of LIS3MDL.
 
void lis3mdl_read_temp (const lis3mdl_t *dev, int16_t *value)
 Reads the temperature value of LIS3MDL.
 
void lis3mdl_enable (const lis3mdl_t *dev)
 Enable the LIS3MDL device.
 
void lis3mdl_disable (const lis3mdl_t *dev)
 Disable the LIS3MDL device.