Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Compass/AP_Compass_RM3100.h
Views: 1798
/*1* This file is free software: you can redistribute it and/or modify it2* under the terms of the GNU General Public License as published by the3* Free Software Foundation, either version 3 of the License, or4* (at your option) any later version.5*6* This file is distributed in the hope that it will be useful, but7* WITHOUT ANY WARRANTY; without even the implied warranty of8* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.9* See the GNU General Public License for more details.10*11* You should have received a copy of the GNU General Public License along12* with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#pragma once1516#include "AP_Compass_config.h"1718#if AP_COMPASS_RM3100_ENABLED1920#include <AP_Common/AP_Common.h>21#include <AP_HAL/AP_HAL.h>22#include <AP_HAL/Device.h>23#include <AP_Math/AP_Math.h>2425#include "AP_Compass.h"26#include "AP_Compass_Backend.h"2728#ifndef HAL_COMPASS_RM3100_I2C_ADDR29# define HAL_COMPASS_RM3100_I2C_ADDR1 0x2030# define HAL_COMPASS_RM3100_I2C_ADDR2 0x2131# define HAL_COMPASS_RM3100_I2C_ADDR3 0x2232# define HAL_COMPASS_RM3100_I2C_ADDR4 0x2333#endif3435class AP_Compass_RM3100 : public AP_Compass_Backend36{37public:38static AP_Compass_Backend *probe(AP_HAL::OwnPtr<AP_HAL::Device> dev,39bool force_external,40enum Rotation rotation);4142void read() override;4344static constexpr const char *name = "RM3100";4546private:47AP_Compass_RM3100(AP_HAL::OwnPtr<AP_HAL::Device> dev,48bool force_external,49enum Rotation rotation);5051AP_HAL::OwnPtr<AP_HAL::Device> dev;5253/**54* Device periodic callback to read data from the sensor.55*/56bool init();57void timer();5859uint8_t compass_instance;60bool force_external;61enum Rotation rotation;62float _scaler = 1.0;63};6465#endif // AP_COMPASS_RM3100_ENABLED666768