Path: blob/master/libraries/AP_Compass/AP_Compass_MAG3110.h
9645 views
#pragma once12#include "AP_Compass_config.h"34#if AP_COMPASS_MAG3110_ENABLED56#include <AP_Common/AP_Common.h>7#include <AP_HAL/AP_HAL.h>8#include <AP_HAL/Device.h>9#include <AP_Math/AP_Math.h>1011#include "AP_Compass.h"12#include "AP_Compass_Backend.h"131415#ifndef HAL_MAG3110_I2C_ADDR16#define HAL_MAG3110_I2C_ADDR 0x0E17#endif1819class AP_Compass_MAG3110 : public AP_Compass_Backend20{21public:22static AP_Compass_Backend *probe(AP_HAL::OwnPtr<AP_HAL::Device> dev,23enum Rotation rotation);2425static constexpr const char *name = "MAG3110";2627void read() override;2829~AP_Compass_MAG3110() { }3031private:32AP_Compass_MAG3110(AP_HAL::OwnPtr<AP_HAL::Device> dev);3334bool init(enum Rotation rotation);3536bool _read_sample();3738bool _hardware_init();39void _update();4041AP_HAL::OwnPtr<AP_HAL::Device> _dev;4243int32_t _mag_x;44int32_t _mag_y;45int32_t _mag_z;4647bool _initialised;48};4950#endif // AP_COMPASS_MAG3110_ENABLED515253