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.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
* Additional note on redistribution: The copyright and license notices above
26
* must be maintained in each individual source file that is a derivative work
27
* of this source file; otherwise redistribution is prohibited.
28
*/
29
30
#ifndef PIOS_LIS3MDL_H
31
#define PIOS_LIS3MDL_H
32
33
#include "
pios.h
"
34
35
enum
pios_lis3mdl_orientation
{
// clockwise rotation from board forward
36
PIOS_LIS_TOP_0DEG
= 0x00,
37
PIOS_LIS_TOP_90DEG
= 0x01,
38
PIOS_LIS_TOP_180DEG
= 0x02,
39
PIOS_LIS_TOP_270DEG
= 0x03,
40
PIOS_LIS_BOTTOM_0DEG
= 0x04,
41
PIOS_LIS_BOTTOM_90DEG
= 0x05,
42
PIOS_LIS_BOTTOM_180DEG
= 0x06,
43
PIOS_LIS_BOTTOM_270DEG
= 0x07,
44
};
45
46
struct
pios_lis3mdl_cfg
{
47
enum
pios_lis3mdl_orientation
orientation
;
48
};
49
50
typedef
struct
lis3mdl_dev *
lis3mdl_dev_t
;
51
56
int32_t
PIOS_LIS3MDL_SPI_Init
(
lis3mdl_dev_t
*dev,
pios_spi_t
spi_id, uint32_t slave_mag,
const
struct
pios_lis3mdl_cfg
*
cfg
);
57
58
#endif
/* PIOS_LIS3MDL_H */
59
pios.h
Main PiOS header to include all the compiled in PiOS options.
pios_lis3mdl_orientation
pios_lis3mdl_orientation
Definition:
pios_lis3mdl.h:35
pios_spi_dev
Definition:
pios_spi_priv.h:38
lis3mdl_dev_t
struct lis3mdl_dev * lis3mdl_dev_t
Definition:
pios_lis3mdl.h:50
pios_lis3mdl_cfg::orientation
enum pios_lis3mdl_orientation orientation
Definition:
pios_lis3mdl.h:47
PIOS_LIS_TOP_270DEG
Definition:
pios_lis3mdl.h:39
PIOS_LIS_TOP_0DEG
Definition:
pios_lis3mdl.h:36
cfg
static struct flyingpicmd_cfg_fa cfg
Definition:
main.c:49
PIOS_LIS_BOTTOM_0DEG
Definition:
pios_lis3mdl.h:40
PIOS_LIS_TOP_180DEG
Definition:
pios_lis3mdl.h:38
PIOS_LIS_BOTTOM_180DEG
Definition:
pios_lis3mdl.h:42
PIOS_LIS3MDL_SPI_Init
int32_t PIOS_LIS3MDL_SPI_Init(lis3mdl_dev_t *dev, pios_spi_t spi_id, uint32_t slave_mag, const struct pios_lis3mdl_cfg *cfg)
Initialize the LIS3MDL mag.
PIOS_LIS_BOTTOM_270DEG
Definition:
pios_lis3mdl.h:43
PIOS_LIS_BOTTOM_90DEG
Definition:
pios_lis3mdl.h:41
PIOS_LIS_TOP_90DEG
Definition:
pios_lis3mdl.h:37
pios_lis3mdl_cfg
Definition:
pios_lis3mdl.h:46
flight
PiOS
inc
pios_lis3mdl.h
Generated by
1.8.6