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_bmi160.h
Go to the documentation of this file.
1
15
/*
16
* This program is free software; you can redistribute it and/or modify
17
* it under the terms of the GNU General Public License as published by
18
* the Free Software Foundation; either version 3 of the License, or
19
* (at your option) any later version.
20
*
21
* This program is distributed in the hope that it will be useful, but
22
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24
* for more details.
25
*
26
* You should have received a copy of the GNU General Public License along
27
* with this program; if not, see <http://www.gnu.org/licenses/>
28
*
29
* Additional note on redistribution: The copyright and license notices above
30
* must be maintained in each individual source file that is a derivative work
31
* of this source file; otherwise redistribution is prohibited.
32
*/
33
34
35
#ifndef PIOS_BMI160_H
36
#define PIOS_BMI160_H
37
38
enum
pios_bmi160_orientation
{
// clockwise rotation from board forward
39
PIOS_BMI160_TOP_0DEG
,
40
PIOS_BMI160_TOP_90DEG
,
41
PIOS_BMI160_TOP_180DEG
,
42
PIOS_BMI160_TOP_270DEG
,
43
PIOS_BMI160_BOTTOM_0DEG
,
44
PIOS_BMI160_BOTTOM_90DEG
,
45
PIOS_BMI160_BOTTOM_180DEG
,
46
PIOS_BMI160_BOTTOM_270DEG
,
47
};
48
49
enum
pios_bmi160_odr
{
50
PIOS_BMI160_ODR_800_Hz
= 0x0B,
51
PIOS_BMI160_ODR_1600_Hz
= 0x0C,
52
};
53
54
enum
pios_bmi160_acc_range
{
55
PIOS_BMI160_RANGE_2G
= 0x03,
56
PIOS_BMI160_RANGE_4G
= 0x05,
57
PIOS_BMI160_RANGE_8G
= 0x08,
58
PIOS_BMI160_RANGE_16G
= 0x0C,
59
};
60
61
enum
pios_bmi160_gyro_range
{
62
PIOS_BMI160_RANGE_125DPS
= 0x04,
63
PIOS_BMI160_RANGE_250DPS
= 0x03,
64
PIOS_BMI160_RANGE_500DPS
= 0x02,
65
PIOS_BMI160_RANGE_1000DPS
= 0x01,
66
PIOS_BMI160_RANGE_2000DPS
= 0x00,
67
};
68
69
struct
pios_bmi160_cfg
{
70
const
struct
pios_exti_cfg
*
exti_cfg
;
/* Pointer to the EXTI configuration */
71
enum
pios_bmi160_orientation
orientation
;
72
enum
pios_bmi160_odr
odr
;
73
enum
pios_bmi160_acc_range
acc_range
;
74
enum
pios_bmi160_gyro_range
gyro_range
;
75
uint8_t
temperature_interleaving
;
76
};
77
78
/* Public Functions */
79
extern
int32_t
PIOS_BMI160_Init
(
pios_spi_t
spi_id, uint32_t slave_num,
const
struct
pios_bmi160_cfg
*
cfg
,
bool
do_foc);
80
extern
bool
PIOS_BMI160_IRQHandler
(
void
);
81
82
#endif
/* PIOS_BMI160_H */
PIOS_BMI160_ODR_800_Hz
Definition:
pios_bmi160.h:50
PIOS_BMI160_TOP_180DEG
Definition:
pios_bmi160.h:41
PIOS_BMI160_BOTTOM_0DEG
Definition:
pios_bmi160.h:43
PIOS_BMI160_Init
int32_t PIOS_BMI160_Init(pios_spi_t spi_id, uint32_t slave_num, const struct pios_bmi160_cfg *cfg, bool do_foc)
PIOS_BMI160_ODR_1600_Hz
Definition:
pios_bmi160.h:51
PIOS_BMI160_RANGE_8G
Definition:
pios_bmi160.h:57
PIOS_BMI160_RANGE_2000DPS
Definition:
pios_bmi160.h:66
pios_spi_dev
Definition:
pios_spi_priv.h:38
pios_bmi160_cfg
Definition:
pios_bmi160.h:69
PIOS_BMI160_TOP_270DEG
Definition:
pios_bmi160.h:42
pios_exti_cfg
Definition:
pios_exti.h:37
PIOS_BMI160_BOTTOM_270DEG
Definition:
pios_bmi160.h:46
cfg
static struct flyingpicmd_cfg_fa cfg
Definition:
main.c:49
PIOS_BMI160_RANGE_1000DPS
Definition:
pios_bmi160.h:65
pios_bmi160_orientation
pios_bmi160_orientation
Definition:
pios_bmi160.h:38
pios_bmi160_acc_range
pios_bmi160_acc_range
Definition:
pios_bmi160.h:54
pios_bmi160_cfg::orientation
enum pios_bmi160_orientation orientation
Definition:
pios_bmi160.h:71
PIOS_BMI160_IRQHandler
bool PIOS_BMI160_IRQHandler(void)
pios_bmi160_cfg::temperature_interleaving
uint8_t temperature_interleaving
Definition:
pios_bmi160.h:75
PIOS_BMI160_TOP_90DEG
Definition:
pios_bmi160.h:40
PIOS_BMI160_BOTTOM_180DEG
Definition:
pios_bmi160.h:45
pios_bmi160_cfg::acc_range
enum pios_bmi160_acc_range acc_range
Definition:
pios_bmi160.h:73
pios_bmi160_cfg::odr
enum pios_bmi160_odr odr
Definition:
pios_bmi160.h:72
PIOS_BMI160_RANGE_2G
Definition:
pios_bmi160.h:55
PIOS_BMI160_RANGE_16G
Definition:
pios_bmi160.h:58
pios_bmi160_odr
pios_bmi160_odr
Definition:
pios_bmi160.h:49
pios_bmi160_cfg::exti_cfg
const struct pios_exti_cfg * exti_cfg
Definition:
pios_bmi160.h:70
PIOS_BMI160_RANGE_4G
Definition:
pios_bmi160.h:56
pios_bmi160_cfg::gyro_range
enum pios_bmi160_gyro_range gyro_range
Definition:
pios_bmi160.h:74
PIOS_BMI160_RANGE_250DPS
Definition:
pios_bmi160.h:63
pios_bmi160_gyro_range
pios_bmi160_gyro_range
Definition:
pios_bmi160.h:61
PIOS_BMI160_TOP_0DEG
Definition:
pios_bmi160.h:39
PIOS_BMI160_RANGE_125DPS
Definition:
pios_bmi160.h:62
PIOS_BMI160_RANGE_500DPS
Definition:
pios_bmi160.h:64
PIOS_BMI160_BOTTOM_90DEG
Definition:
pios_bmi160.h:44
flight
PiOS
inc
pios_bmi160.h
Generated by
1.8.6