Loading files
66c1bda98This file is pinned to the selected release. Download the original to open it in your design tool.
#pragma once
#include "Device/BusAwareDevice.hpp"
#include "helper_3dmath.hpp"
namespace Espfc {
enum MagDeviceType : uint8_t
{
MAG_DEFAULT = 0,
MAG_NONE = 1,
MAG_HMC5883L = 2,
MAG_AK8975 = 3,
MAG_AK8963 = 4,
MAG_QMC5883L = 5,
MAG_QMC5883P = 6,
MAG_MAX
};
namespace Device {
class MagDevice : public BusAwareDevice
{
public:
using DeviceType = MagDeviceType;
virtual int begin(Hal::BusDevice* bus) = 0;
virtual int begin(Hal::BusDevice* bus, uint8_t addr) = 0;
virtual DeviceType getType() const = 0;
virtual int readMag(VectorInt16& v) = 0;
virtual const VectorFloat convert(const VectorInt16& v) const = 0;
virtual int getRate() const = 0;
virtual bool testConnection() = 0;
static const char** getNames();
static const char* getName(DeviceType type);
};
} // namespace Device
} // namespace Espfc