Adafruit LIS3MDL Arduino Library
Classes | Macros | Enumerations
Adafruit_LIS3MDL.h File Reference
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_SPIDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

class  Adafruit_LIS3MDL
 

Macros

#define LIS3MDL_I2CADDR_DEFAULT   (0x1C)
 Default breakout addres.
 
#define LIS3MDL_REG_WHO_AM_I   0x0F
 Register that contains the part ID.
 
#define LIS3MDL_REG_CTRL_REG1   0x20
 Register address for control 1.
 
#define LIS3MDL_REG_CTRL_REG2   0x21
 Register address for control 2.
 
#define LIS3MDL_REG_CTRL_REG3   0x22
 Register address for control 3.
 
#define LIS3MDL_REG_CTRL_REG4   0x23
 Register address for control 3.
 
#define LIS3MDL_REG_STATUS   0x27
 Register address for status.
 
#define LIS3MDL_REG_OUT_X_L   0x28
 Register address for X axis lower byte.
 
#define LIS3MDL_REG_INT_CFG   0x30
 Interrupt configuration register.
 
#define LIS3MDL_REG_INT_THS_L   0x32
 Low byte of the irq threshold.
 

Enumerations

enum  lis3mdl_range_t { LIS3MDL_RANGE_4_GAUSS = 0b00, LIS3MDL_RANGE_8_GAUSS = 0b01, LIS3MDL_RANGE_12_GAUSS = 0b10, LIS3MDL_RANGE_16_GAUSS = 0b11 }
 
enum  lis3mdl_dataRate_t {
  LIS3MDL_DATARATE_0_625_HZ = 0b0000, LIS3MDL_DATARATE_1_25_HZ = 0b0010, LIS3MDL_DATARATE_2_5_HZ = 0b0100, LIS3MDL_DATARATE_5_HZ = 0b0110,
  LIS3MDL_DATARATE_10_HZ = 0b1000, LIS3MDL_DATARATE_20_HZ = 0b1010, LIS3MDL_DATARATE_40_HZ = 0b1100, LIS3MDL_DATARATE_80_HZ = 0b1110,
  LIS3MDL_DATARATE_155_HZ = 0b0001, LIS3MDL_DATARATE_300_HZ = 0b0011, LIS3MDL_DATARATE_560_HZ = 0b0101, LIS3MDL_DATARATE_1000_HZ = 0b0111
}
 
enum  lis3mdl_performancemode_t { LIS3MDL_LOWPOWERMODE = 0b00, LIS3MDL_MEDIUMMODE = 0b01, LIS3MDL_HIGHMODE = 0b10, LIS3MDL_ULTRAHIGHMODE = 0b11 }
 
enum  lis3mdl_operationmode_t { LIS3MDL_CONTINUOUSMODE = 0b00, LIS3MDL_SINGLEMODE = 0b01, LIS3MDL_POWERDOWNMODE = 0b11 }
 

Enumeration Type Documentation

◆ lis3mdl_range_t

The magnetometer ranges

Enumerator
LIS3MDL_RANGE_4_GAUSS 

+/- 4g (default value)

LIS3MDL_RANGE_8_GAUSS 

+/- 8g

LIS3MDL_RANGE_12_GAUSS 

+/- 12g

LIS3MDL_RANGE_16_GAUSS 

+/- 16g

◆ lis3mdl_dataRate_t

The magnetometer data rate, includes FAST_ODR bit

Enumerator
LIS3MDL_DATARATE_0_625_HZ 

0.625 Hz

LIS3MDL_DATARATE_1_25_HZ 

1.25 Hz

LIS3MDL_DATARATE_2_5_HZ 

2.5 Hz

LIS3MDL_DATARATE_5_HZ 

5 Hz

LIS3MDL_DATARATE_10_HZ 

10 Hz

LIS3MDL_DATARATE_20_HZ 

20 Hz

LIS3MDL_DATARATE_40_HZ 

40 Hz

LIS3MDL_DATARATE_80_HZ 

80 Hz

LIS3MDL_DATARATE_155_HZ 

155 Hz (FAST_ODR + UHP)

LIS3MDL_DATARATE_300_HZ 

300 Hz (FAST_ODR + HP)

LIS3MDL_DATARATE_560_HZ 

560 Hz (FAST_ODR + MP)

LIS3MDL_DATARATE_1000_HZ 

1000 Hz (FAST_ODR + LP)

◆ lis3mdl_performancemode_t

The magnetometer performance mode

Enumerator
LIS3MDL_LOWPOWERMODE 

Low power mode.

LIS3MDL_MEDIUMMODE 

Medium performance mode.

LIS3MDL_HIGHMODE 

High performance mode.

LIS3MDL_ULTRAHIGHMODE 

Ultra-high performance mode.

◆ lis3mdl_operationmode_t

The magnetometer operation mode

Enumerator
LIS3MDL_CONTINUOUSMODE 

Continuous conversion.

LIS3MDL_SINGLEMODE 

Single-shot conversion.

LIS3MDL_POWERDOWNMODE 

Powered-down mode.