Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
mag3110_reg.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014 PHYTEC Messtechnik GmbH
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
*/
9
10
#pragma once
11
23
#ifdef __cplusplus
24
extern
"C"
25
{
26
#endif
27
28
#define MAG3110_DR_STATUS 0x00
29
#define MAG3110_OUT_X_MSB 0x01
30
#define MAG3110_OUT_X_LSB 0x02
31
#define MAG3110_OUT_Y_MSB 0x03
32
#define MAG3110_OUT_Y_LSB 0x04
33
#define MAG3110_OUT_Z_MSB 0x05
34
#define MAG3110_OUT_Z_LSB 0x06
35
#define MAG3110_WHO_AM_I 0x07
36
#define MAG3110_SYSMOD 0x08
37
#define MAG3110_OFF_X_MSB 0x09
38
#define MAG3110_OFF_X_LSB 0x0A
39
#define MAG3110_OFF_Y_MSB 0x0B
40
#define MAG3110_OFF_Y_LSB 0x0C
41
#define MAG3110_OFF_Z_MSB 0x0D
42
#define MAG3110_OFF_Z_LSB 0x0E
43
#define MAG3110_DIE_TEMP 0x0F
44
#define MAG3110_CTRL_REG1 0x10
45
#define MAG3110_CTRL_REG2 0x11
47
#define MAG3110_DR_STATUS_ZYXOW (1 << 7)
48
#define MAG3110_DR_STATUS_ZOW (1 << 6)
49
#define MAG3110_DR_STATUS_YOW (1 << 5)
50
#define MAG3110_DR_STATUS_XOW (1 << 4)
51
#define MAG3110_DR_STATUS_ZYXDR (1 << 3)
52
#define MAG3110_DR_STATUS_ZDR (1 << 2)
53
#define MAG3110_DR_STATUS_YDR (1 << 1)
54
#define MAG3110_DR_STATUS_XDR (1 << 0)
55
56
#define MAG3110_ID 0xC4
58
#define MAG3110_SYSMOD_STANDBY 0
59
#define MAG3110_SYSMOD_ACTIVE_RAW 1
60
#define MAG3110_SYSMOD_ACTIVE 2
61
62
#define MAG3110_CTRL_REG1_DROS_SHIFT 3
63
#define MAG3110_CTRL_REG1_DROS_MASK 0xF8
64
#define MAG3110_CTRL_REG1_DROS(x) (((uint8_t)(((uint8_t)(x))<<MAG3110_CTRL_REG1_DROS_SHIFT))\
65
&MAG3110_CTRL_REG1_DROS_MASK)
66
#define MAG3110_CTRL_REG1_FR (1 << 2)
67
#define MAG3110_CTRL_REG1_TM (1 << 1)
68
#define MAG3110_CTRL_REG1_AC (1 << 0)
69
70
#define MAG3110_CTRL_REG2_AUTO_MRST_EN (1 << 7)
71
#define MAG3110_CTRL_REG2_RAW (1 << 5)
72
#define MAG3110_CTRL_REG2_MAG_RST (1 << 4)
73
74
#ifdef __cplusplus
75
}
76
#endif
77
Generated on Mon Jun 30 2025 18:46:45 by
1.9.1