Device driver for the LIS3MDL 3-axis magnetometer.
More...
Device driver for the LIS3MDL 3-axis magnetometer.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
|
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...
|
|
◆ lis3mdl_odr_t
Output data rate [Hz] for LIS3MDL.
Enumerator |
---|
LIS3MDL_ODR_0_625Hz | 0.625Hz
|
LIS3MDL_ODR_1_25Hz | 1.250Hz
|
LIS3MDL_ODR_2_5Hz | 5.000Hz
|
LIS3MDL_ODR_10Hz | 10.000Hz
|
LIS3DML_ODR_20HZ | 20.000Hz
|
LIS3DML_ODR_40HZ | 40.000Hz
|
LIS3MDL_ODR_80HZ | 80.000Hz
|
Definition at line 67 of file lis3mdl.h.
◆ lis3mdl_op_t
Operating modes.
Enumerator |
---|
LIS3MDL_OP_CONT_CONV | Continous-conversion mode.
|
LIS3MDL_OP_SNGL_CONV | Single-conversion mode.
|
LIS3MDL_OP_PDOWN | Power-down mode.
|
Definition at line 90 of file lis3mdl.h.
◆ lis3mdl_scale_t
Scale [gauss] for LIS3MDL.
Enumerator |
---|
LIS3MDL_SCALE_4G | +- 4 gauss
|
LIS3MDL_SCALE_8G | +- 8 gauss
|
LIS3MDL_SCALE_12G | +- 12 gauss
|
LIS3MDL_SCALE_16G | +- 16 gauss
|
Definition at line 80 of file lis3mdl.h.
◆ lis3mdl_xy_mode_t
Operating mode of x- and y-axis for LIS3MDL.
Enumerator |
---|
LIS3MDL_XY_MODE_LOW | Low-power mode.
|
LIS3MDL_XY_MODE_MEDIUM | Medium-performance mode.
|
LIS3MDL_XY_MODE_HIGH | High-performance mode.
|
LIS3MDL_XY_MODE_ULTRA | Ultra-High-performance mode.
|
Definition at line 47 of file lis3mdl.h.
◆ lis3mdl_z_mode_t
Operating mode of z-axis for LIS3MDL.
Enumerator |
---|
LIS3MDL_Z_MODE_LOW | Low-power mode.
|
LIS3MDL_Z_MODE_MEDIUM | Medium-performance mode.
|
LIS3MDL_Z_MODE_HIGH | High-performance mode.
|
LIS3MDL_Z_MODE_ULTRA | Ultra-High-performance mode.
|
Definition at line 57 of file lis3mdl.h.
◆ lis3mdl_disable()
void lis3mdl_disable |
( |
const lis3mdl_t * |
dev | ) |
|
Disable the LIS3MDL device.
- Parameters
-
[in] | dev | device descriptor of LIS3MDL |
◆ lis3mdl_enable()
Enable the LIS3MDL device.
- Parameters
-
[in] | dev | device descriptor of LIS3MDL |
◆ lis3mdl_init()
Initialize a new LIS3DML device.
- Parameters
-
[in] | dev | device descriptor of LIS3MDL |
[in] | params | initialization parameters |
- Returns
- 0 on success
-
-1 on error
◆ lis3mdl_read_mag()
Reads the magnometer value of LIS3MDL.
- Parameters
-
[in] | dev | device descriptor of LIS3MDL |
[in] | data | measured magnetometer data |
◆ lis3mdl_read_temp()
void lis3mdl_read_temp |
( |
const lis3mdl_t * |
dev, |
|
|
int16_t * |
value |
|
) |
| |
Reads the temperature value of LIS3MDL.
- Parameters
-
[in] | dev | device descriptor of LIS3MDL |
[in] | value | measured temperature in degree celsius |