Interface definition for the MAG3110 magnetometer driver. More...

Detailed Description

Interface definition for the MAG3110 magnetometer driver.

Author
Johann Fischer j.fis.nosp@m.cher.nosp@m.@phyt.nosp@m.ec.d.nosp@m.e
Sebastian Meiling s@mln.nosp@m.g.ne.nosp@m.t

Definition in file mag3110.h.

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

Go to the source code of this file.

Data Structures

struct  mag3110_params_t
 Configuration parameters. More...
 
struct  mag3110_t
 Device descriptor for MAG3110 magnetometer. More...
 
struct  mag3110_data_t
 Data type for the result data. More...
 

Macros

#define CONFIG_MAG3110_I2C_ADDRESS   0x0E
 Magnetometer default address. More...
 

Enumerations

enum  { MAG3110_OK, MAG3110_ERROR_I2C, MAG3110_ERROR_DEV, MAG3110_ERROR_CNF }
 Named return values. More...
 

Functions

int mag3110_init (mag3110_t *dev, const mag3110_params_t *params)
 Initialise the MAG3110 magnetometer driver. More...
 
int mag3110_set_user_offset (const mag3110_t *dev, int16_t x, int16_t y, int16_t z)
 Set user offset correction. More...
 
int mag3110_set_active (const mag3110_t *dev)
 Set active mode, this enables periodic measurements. More...
 
int mag3110_set_standby (const mag3110_t *dev)
 Set standby mode. More...
 
int mag3110_is_ready (const mag3110_t *dev)
 Check for new set of measurement data. More...
 
int mag3110_read (const mag3110_t *dev, mag3110_data_t *data)
 Read magnetometer's data. More...
 
int mag3110_read_dtemp (const mag3110_t *dev, int8_t *dtemp)
 Read die temperature. More...
 

Output data rate macros

#define MAG3110_DROS_8000_16   0
 Output Rate 80 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_4000_32   1
 Output Rate 40 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_2000_64   2
 Output Rate 20 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_1000_128   3
 Output Rate 10 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_4000_16   4
 Output Rate 40 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_2000_32   5
 Output Rate 20 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_1000_64   6
 Output Rate 10 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0500_128   7
 Output Rate 5 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_2000_16   8
 Output Rate 20 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_1000_32   9
 Output Rate 10 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0500_64   10
 Output Rate 5 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0250_128   11
 Output Rate 2.5 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_1000_16   12
 Output Rate 10 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_0500_32   13
 Output Rate 5 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0250_64   14
 Output Rate 2.5 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0125_128   15
 Output Rate 1.25 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_0500_16   16
 Output Rate 5 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_0250_32   17
 Output Rate 2.5 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0125_64   18
 Output Rate 1.25 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0063_128   19
 Output Rate 0.63 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_0250_16   20
 Output Rate 2.5 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_0125_32   21
 Output Rate 1.25 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0063_64   22
 Output Rate 0.63 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0031_128   23
 Output Rate 0.31 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_0125_16   24
 Output Rate 1.25 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_0063_32   25
 Output Rate 0.63 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0031_64   26
 Output Rate 0.31 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0016_128   27
 Output Rate 0.16 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_0063_16   28
 Output Rate 0.63 Hz, Over Sample Ratio 16.
 
#define MAG3110_DROS_0031_32   29
 Output Rate 0.31 Hz, Over Sample Ratio 32.
 
#define MAG3110_DROS_0016_64   30
 Output Rate 0.16 Hz, Over Sample Ratio 64.
 
#define MAG3110_DROS_0008_128   31
 Output Rate 0.08 Hz, Over Sample Ratio 128.
 
#define MAG3110_DROS_DEFAULT   MAG3110_DROS_0125_128
 Default Setting for testing.