Loading...
Searching...
No Matches
lis3mdl.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 HAW Hamburg
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
24#ifndef LIS3MDL_H
25#define LIS3MDL_H
26
27#include <stdint.h>
28#include "periph/i2c.h"
29#include "periph/gpio.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38typedef struct {
39 int16_t x_axis;
40 int16_t y_axis;
41 int16_t z_axis;
43
53
63
76
86
95
108
112typedef struct {
114} lis3mdl_t;
115
125int lis3mdl_init(lis3mdl_t *dev, const lis3mdl_params_t *params);
126
134
141void lis3mdl_read_temp(const lis3mdl_t *dev, int16_t *value);
142
148void lis3mdl_enable(const lis3mdl_t *dev);
149
155void lis3mdl_disable(const lis3mdl_t *dev);
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif /* LIS3MDL_H */
Low-level GPIO peripheral driver interface definitions.
lis3mdl_odr_t
Output data rate [Hz] for LIS3MDL.
Definition lis3mdl.h:67
void lis3mdl_read_temp(const lis3mdl_t *dev, int16_t *value)
Reads the temperature value of LIS3MDL.
lis3mdl_op_t
Operating modes.
Definition lis3mdl.h:90
void lis3mdl_read_mag(const lis3mdl_t *dev, lis3mdl_3d_data_t *data)
Reads the magnometer value of LIS3MDL.
void lis3mdl_disable(const lis3mdl_t *dev)
Disable the LIS3MDL device.
void lis3mdl_enable(const lis3mdl_t *dev)
Enable the LIS3MDL device.
lis3mdl_z_mode_t
Operating mode of z-axis for LIS3MDL.
Definition lis3mdl.h:57
int lis3mdl_init(lis3mdl_t *dev, const lis3mdl_params_t *params)
Initialize a new LIS3DML device.
lis3mdl_xy_mode_t
Operating mode of x- and y-axis for LIS3MDL.
Definition lis3mdl.h:47
lis3mdl_scale_t
Scale [gauss] for LIS3MDL.
Definition lis3mdl.h:80
@ LIS3MDL_ODR_10Hz
10.000Hz
Definition lis3mdl.h:71
@ LIS3DML_ODR_20HZ
20.000Hz
Definition lis3mdl.h:72
@ LIS3MDL_ODR_2_5Hz
5.000Hz
Definition lis3mdl.h:70
@ LIS3DML_ODR_40HZ
40.000Hz
Definition lis3mdl.h:73
@ LIS3MDL_ODR_80HZ
80.000Hz
Definition lis3mdl.h:74
@ LIS3MDL_ODR_0_625Hz
0.625Hz
Definition lis3mdl.h:68
@ LIS3MDL_ODR_1_25Hz
1.250Hz
Definition lis3mdl.h:69
@ LIS3MDL_OP_CONT_CONV
Continous-conversion mode.
Definition lis3mdl.h:91
@ LIS3MDL_OP_SNGL_CONV
Single-conversion mode.
Definition lis3mdl.h:92
@ LIS3MDL_OP_PDOWN
Power-down mode.
Definition lis3mdl.h:93
@ LIS3MDL_Z_MODE_ULTRA
Ultra-High-performance mode.
Definition lis3mdl.h:61
@ LIS3MDL_Z_MODE_HIGH
High-performance mode.
Definition lis3mdl.h:60
@ LIS3MDL_Z_MODE_MEDIUM
Medium-performance mode.
Definition lis3mdl.h:59
@ LIS3MDL_Z_MODE_LOW
Low-power mode.
Definition lis3mdl.h:58
@ LIS3MDL_XY_MODE_HIGH
High-performance mode.
Definition lis3mdl.h:50
@ LIS3MDL_XY_MODE_ULTRA
Ultra-High-performance mode.
Definition lis3mdl.h:51
@ LIS3MDL_XY_MODE_LOW
Low-power mode.
Definition lis3mdl.h:48
@ LIS3MDL_XY_MODE_MEDIUM
Medium-performance mode.
Definition lis3mdl.h:49
@ LIS3MDL_SCALE_8G
+- 8 gauss
Definition lis3mdl.h:82
@ LIS3MDL_SCALE_12G
+- 12 gauss
Definition lis3mdl.h:83
@ LIS3MDL_SCALE_4G
+- 4 gauss
Definition lis3mdl.h:81
@ LIS3MDL_SCALE_16G
+- 16 gauss
Definition lis3mdl.h:84
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:151
Low-level I2C peripheral driver interface definition.
3d data container of the LIS3MDL sensor
Definition lis3mdl.h:38
int16_t y_axis
Magnometer data from y_axis.
Definition lis3mdl.h:40
int16_t z_axis
Magnometer data from z_axis.
Definition lis3mdl.h:41
int16_t x_axis
Magnometer data from x-axis.
Definition lis3mdl.h:39
Device initialization parameters.
Definition lis3mdl.h:99
lis3mdl_odr_t odr
Output data rate.
Definition lis3mdl.h:104
lis3mdl_scale_t scale
Scale factor.
Definition lis3mdl.h:105
uint8_t addr
Magnometer I2C address.
Definition lis3mdl.h:101
lis3mdl_z_mode_t z_mode
Power mode of z-axis.
Definition lis3mdl.h:103
lis3mdl_op_t op_mode
Operation mode.
Definition lis3mdl.h:106
i2c_t i2c
I2C device.
Definition lis3mdl.h:100
lis3mdl_xy_mode_t xy_mode
Power mode of x- and y-axis.
Definition lis3mdl.h:102
Device descriptor for LIS3MDL sensor.
Definition lis3mdl.h:112
lis3mdl_params_t params
Initialization parameters.
Definition lis3mdl.h:113