dRonin
adbada4
dRonin firmware
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
pios_lis3mdl_priv.h
Go to the documentation of this file.
1
11
/*
12
* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 3 of the License, or
15
* (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful, but
18
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20
* for more details.
21
*
22
* You should have received a copy of the GNU General Public License along
23
* with this program; if not, see <http://www.gnu.org/licenses/>
24
*/
25
26
#ifndef PIOS_LIS3MDL_PRIV_H
27
#define PIOS_LIS3MDL_PRIV_H
28
29
#include "
pios_lis3mdl.h
"
30
31
enum
pios_lis3_regs
{
32
LIS_REG_MAG_WHO_AM_I
= 0x0f,
33
LIS_REG_MAG_CTRL1
= 0x20,
34
LIS_REG_MAG_CTRL2
,
35
LIS_REG_MAG_CTRL3
,
36
LIS_REG_MAG_CTRL4
,
37
LIS_REG_MAG_CTRL5
,
38
LIS_REG_MAG_STATUS
= 0x27,
39
LIS_REG_MAG_OUTX_L
,
40
LIS_REG_MAG_OUTX_H
,
41
LIS_REG_MAG_OUTY_L
,
42
LIS_REG_MAG_OUTY_H
,
43
LIS_REG_MAG_OUTZ_L
,
44
LIS_REG_MAG_OUTZ_H
,
45
LIS_REG_MAG_TEMPOUT_L
,
46
LIS_REG_MAG_TEMPOUT_H
,
47
LIS_REG_MAG_INT_CFG
,
48
LIS_REG_MAG_INT_SRC
,
49
LIS_REG_MAG_INT_THS_L
,
50
LIS_REG_MAG_INT_THS_H
51
};
52
53
#define LIS_ADDRESS_READ 0x80
54
#define LIS_ADDRESS_AUTOINCREMENT 0x40
55
56
#define LIS_WHO_AM_I_VAL 0x3d
57
58
#define LIS_CTRL1_TEMPEN 0x80
59
#define LIS_CTRL1_OPMODE_MASK 0x60
60
61
#define LIS_CTRL1_OPMODE_UHP 0x60
/* Ultra high perofrmance */
62
#define LIS_CTRL1_ODR_MASK 0x1c
63
#define LIS_CTRL1_ODR_80 0x1c
/* Mfr recommended */
64
#define LIS_CTRL1_ODR_40 0x18
65
#define LIS_CTRL1_ODR_20 0x14
66
67
#define LIS_CTRL1_FASTODR 0x02
/* generates 155Hz with UHP */
68
#define LIS_CTRL1_SELFTEST 0x01
69
70
#define LIS_CTRL2_FS_MASK 0x60
71
#define LIS_CTRL2_FS_16GAU 0x60
72
#define LIS_CTRL2_FS_12GAU 0x40
/* Mfr recommended; 2281
73
* counts/gauss. typ RMS
74
* noise seems to be about
75
* 3 milligauss or 7 counts
76
*/
77
#define LIS_RANGE_12GAU_COUNTS_PER_MGAU 2.281f
78
79
#define LIS_CTRL2_FS_8GAU 0x20
80
#define LIS_CTRL2_FS_4GAU 0x00
81
82
#define LIS_CTRL2_REBOOT 0x04
83
#define LIS_CTRL2_SOFTRST 0x02
84
85
#define LIS_CTRL3_LP 0x20
86
#define LIS_CTRL3_SPITHREEWIRE 0x04
87
#define LIS_CTRL3_MODE_MASK 0x03
88
89
#define LIS_CTRL3_MODE_CONTINUOUS 0x00
90
#define LIS_CTRL3_MODE_SINGLE 0x01
91
#define LIS_CTRL3_MODE_POWERDOWN 0x03
92
93
#define LIS_CTRL4_OPMODEZ_MASK 0x0c
94
#define LIS_CTRL4_OPMODEZ_UHP 0x0c
95
/* Endianness is also here, but default value here corresponds to register
96
* map and microarchitecture endianness (x86=LE, ARM as we use=LE, etc).
97
*/
98
99
#define LIS_CTRL5_FASTREAD 0x80
100
#define LIS_CTRL5_BDU 0x40
101
102
#define LIS_STATUS_ZYXOR 0x80
103
#define LIS_STATUS_ZOR 0x40
104
#define LIS_STATUS_YOR 0x20
105
#define LIS_STATUS_XOR 0x10
106
#define LIS_STATUS_ZYXDA 0x08
107
#define LIS_STATUS_ZDA 0x04
108
#define LIS_STATUS_YDA 0x02
109
#define LIS_STATUS_XDA 0x01
110
111
#endif
/* PIOS_LIS3MDL_PRIV_H */
112
LIS_REG_MAG_OUTZ_L
Definition:
pios_lis3mdl_priv.h:43
LIS_REG_MAG_OUTZ_H
Definition:
pios_lis3mdl_priv.h:44
pios_lis3_regs
pios_lis3_regs
Definition:
pios_lis3mdl_priv.h:31
LIS_REG_MAG_CTRL3
Definition:
pios_lis3mdl_priv.h:35
LIS_REG_MAG_CTRL4
Definition:
pios_lis3mdl_priv.h:36
LIS_REG_MAG_TEMPOUT_H
Definition:
pios_lis3mdl_priv.h:46
LIS_REG_MAG_OUTY_L
Definition:
pios_lis3mdl_priv.h:41
LIS_REG_MAG_STATUS
Definition:
pios_lis3mdl_priv.h:38
LIS_REG_MAG_INT_THS_H
Definition:
pios_lis3mdl_priv.h:50
LIS_REG_MAG_OUTX_H
Definition:
pios_lis3mdl_priv.h:40
LIS_REG_MAG_WHO_AM_I
Definition:
pios_lis3mdl_priv.h:32
LIS_REG_MAG_CTRL5
Definition:
pios_lis3mdl_priv.h:37
LIS_REG_MAG_OUTY_H
Definition:
pios_lis3mdl_priv.h:42
LIS_REG_MAG_TEMPOUT_L
Definition:
pios_lis3mdl_priv.h:45
pios_lis3mdl.h
LIS_REG_MAG_INT_THS_L
Definition:
pios_lis3mdl_priv.h:49
LIS_REG_MAG_INT_CFG
Definition:
pios_lis3mdl_priv.h:47
LIS_REG_MAG_CTRL2
Definition:
pios_lis3mdl_priv.h:34
LIS_REG_MAG_CTRL1
Definition:
pios_lis3mdl_priv.h:33
LIS_REG_MAG_OUTX_L
Definition:
pios_lis3mdl_priv.h:39
LIS_REG_MAG_INT_SRC
Definition:
pios_lis3mdl_priv.h:48
flight
PiOS
inc
pios_lis3mdl_priv.h
Generated by
1.8.6