22 #include <Adafruit_BusIO_Register.h> 24 #include <Adafruit_I2CDevice.h> 25 #include <Adafruit_SPIDevice.h> 26 #include <Adafruit_Sensor.h> 32 #define _ADDRESS_MAG 0x1E 34 #define LIS2MDL_MAG_LSB 1.5 35 #define LIS2MDL_MILLIGAUSS_TO_MICROTESLA \ 43 LIS2MDL_OFFSET_X_REG_L = 0x45,
44 LIS2MDL_OFFSET_X_REG_H = 0x46,
45 LIS2MDL_OFFSET_Y_REG_L = 0x47,
46 LIS2MDL_OFFSET_Y_REG_H = 0x48,
47 LIS2MDL_OFFSET_Z_REG_L = 0x49,
48 LIS2MDL_OFFSET_Z_REG_H = 0x4A,
49 LIS2MDL_WHO_AM_I = 0x4F,
50 LIS2MDL_CFG_REG_A = 0x60,
51 LIS2MDL_CFG_REG_B = 0x61,
52 LIS2MDL_CFG_REG_C = 0x62,
53 LIS2MDL_INT_CRTL_REG = 0x63,
54 LIS2MDL_INT_SOURCE_REG = 0x64,
55 LIS2MDL_INT_THS_L_REG = 0x65,
56 LIS2MDL_STATUS_REG = 0x67,
57 LIS2MDL_OUTX_L_REG = 0x68,
58 LIS2MDL_OUTX_H_REG = 0x69,
59 LIS2MDL_OUTY_L_REG = 0x6A,
60 LIS2MDL_OUTY_H_REG = 0x6B,
61 LIS2MDL_OUTZ_L_REG = 0x6C,
62 LIS2MDL_OUTZ_H_REG = 0x6D,
98 bool begin(uint8_t i2c_addr =
_ADDRESS_MAG, TwoWire *wire = &Wire);
99 bool begin_SPI(uint8_t cs_pin, SPIClass *theSPI = &SPI);
100 bool begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin,
105 bool getEvent(sensors_event_t *);
106 void getSensor(sensor_t *);
109 void enableInterrupts(
bool);
110 void interruptsActiveHigh(
bool);
117 Adafruit_BusIO_Register *config_a;
121 Adafruit_I2CDevice *i2c_dev = NULL;
122 Adafruit_SPIDevice *spi_dev = NULL;
10 Hz
Definition: Adafruit_LIS2MDL.h:70
lis2mdl_register_t
LIS2MDL I2C register address bits.
Definition: Adafruit_LIS2MDL.h:42
lis2mdl_data_t raw
struct instance to hold raw data
Definition: Adafruit_LIS2MDL.h:111
a data thing
Definition: Adafruit_LIS2MDL.h:82
int16_t y
y-axis raw data
Definition: Adafruit_LIS2MDL.h:84
int16_t z
z-axis raw data
Definition: Adafruit_LIS2MDL.h:85
struct lis2mdl_data lis2mdl_data_t
a data thing
int16_t x
x-axis raw data
Definition: Adafruit_LIS2MDL.h:83
100 Hz
Definition: Adafruit_LIS2MDL.h:73
Unified sensor driver for the magnetometer.
Definition: Adafruit_LIS2MDL.h:94
50 Hz
Definition: Adafruit_LIS2MDL.h:72
lis2mdl_rate_t
Magnetometer update rate settings.
Definition: Adafruit_LIS2MDL.h:69
20 Hz
Definition: Adafruit_LIS2MDL.h:71
#define _ADDRESS_MAG
Default address.
Definition: Adafruit_LIS2MDL.h:32