APM:Libraries
AP_InertialSensor_BMI160.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Intel Corporation. All rights reserved.
3  *
4  * This file is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This file is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #pragma once
18 
19 #include <AP_HAL/AP_HAL.h>
20 
21 #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
22 
23 #include "AP_InertialSensor.h"
25 
27 public:
30 
34  void start() override;
35 
36  bool update() override;
37 
38 private:
41 
47  void _check_err_reg();
48 
56  bool _hardware_init();
57 
65  bool _init();
66 
73  bool _configure_accel();
74 
81  bool _configure_gyro();
82 
89  bool _configure_int1_pin();
90 
96  bool _configure_fifo();
97 
101  void _poll_data();
102 
106  void _read_fifo();
107 
109 
112 
113  uint8_t _gyro_instance;
114  float _gyro_scale;
115 
117 };
118 
119 #endif
AP_HAL::OwnPtr< AP_HAL::Device > _dev
AP_HAL::DigitalSource * _int1_pin
static AP_HAL::OwnPtr< AP_HAL::Device > dev
Definition: ICM20789.cpp:16
AP_InertialSensor_BMI160(AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::Device > dev)
static AP_InertialSensor_Backend * probe(AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::SPIDevice > dev)