# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_pyupm_mag3110')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_pyupm_mag3110')
    _pyupm_mag3110 = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pyupm_mag3110', [dirname(__file__)])
        except ImportError:
            import _pyupm_mag3110
            return _pyupm_mag3110
        try:
            _mod = imp.load_module('_pyupm_mag3110', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _pyupm_mag3110 = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_mag3110
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass
    _newclass = 0

import upm.pyupm_interfaces

def getVersion():
    return _pyupm_mag3110.getVersion()
getVersion = _pyupm_mag3110.getVersion
MAG3110_NAME = _pyupm_mag3110.MAG3110_NAME
MAG3110_I2C_ADDRESS = _pyupm_mag3110.MAG3110_I2C_ADDRESS
MAG3110_DEVICE_ID = _pyupm_mag3110.MAG3110_DEVICE_ID
MAG3110_DEVICE_ID_REG = _pyupm_mag3110.MAG3110_DEVICE_ID_REG
MAG3110_DR_STATUS = _pyupm_mag3110.MAG3110_DR_STATUS
MAG3110_OUT_X_MSB = _pyupm_mag3110.MAG3110_OUT_X_MSB
MAG3110_OUT_X_LSB = _pyupm_mag3110.MAG3110_OUT_X_LSB
MAG3110_OUT_Y_MSB = _pyupm_mag3110.MAG3110_OUT_Y_MSB
MAG3110_OUT_Y_LSB = _pyupm_mag3110.MAG3110_OUT_Y_LSB
MAG3110_OUT_Z_MSB = _pyupm_mag3110.MAG3110_OUT_Z_MSB
MAG3110_OUT_Z_LSB = _pyupm_mag3110.MAG3110_OUT_Z_LSB
MAG3110_SYSMOD = _pyupm_mag3110.MAG3110_SYSMOD
MAG3110_OFF_X_MSB = _pyupm_mag3110.MAG3110_OFF_X_MSB
MAG3110_OFF_X_LSB = _pyupm_mag3110.MAG3110_OFF_X_LSB
MAG3110_OFF_Y_MSB = _pyupm_mag3110.MAG3110_OFF_Y_MSB
MAG3110_OFF_Y_LSB = _pyupm_mag3110.MAG3110_OFF_Y_LSB
MAG3110_OFF_Z_MSB = _pyupm_mag3110.MAG3110_OFF_Z_MSB
MAG3110_OFF_Z_LSB = _pyupm_mag3110.MAG3110_OFF_Z_LSB
MAG3110_DIE_TEMP = _pyupm_mag3110.MAG3110_DIE_TEMP
MAG3110_CTRL_REG1 = _pyupm_mag3110.MAG3110_CTRL_REG1
MAG3110_CTRL_REG2 = _pyupm_mag3110.MAG3110_CTRL_REG2
MAG3110_DR_STATUS_ZYXOW = _pyupm_mag3110.MAG3110_DR_STATUS_ZYXOW
MAG3110_DR_STATUS_ZOW = _pyupm_mag3110.MAG3110_DR_STATUS_ZOW
MAG3110_DR_STATUS_YOW = _pyupm_mag3110.MAG3110_DR_STATUS_YOW
MAG3110_DR_STATUS_XOW = _pyupm_mag3110.MAG3110_DR_STATUS_XOW
MAG3110_DR_STATUS_ZYXDR = _pyupm_mag3110.MAG3110_DR_STATUS_ZYXDR
MAG3110_DR_STATUS_ZDR = _pyupm_mag3110.MAG3110_DR_STATUS_ZDR
MAG3110_DR_STATUS_YDR = _pyupm_mag3110.MAG3110_DR_STATUS_YDR
MAG3110_DR_STATUS_XDR = _pyupm_mag3110.MAG3110_DR_STATUS_XDR
MAG3110_SYSMOD_STANDBY = _pyupm_mag3110.MAG3110_SYSMOD_STANDBY
MAG3110_SYSMOD_ACTIVE_RAW = _pyupm_mag3110.MAG3110_SYSMOD_ACTIVE_RAW
MAG3110_SYSMOD_ACTIVE = _pyupm_mag3110.MAG3110_SYSMOD_ACTIVE
MAG3110_CTRL_REG1_DROS_SHIFT = _pyupm_mag3110.MAG3110_CTRL_REG1_DROS_SHIFT
MAG3110_CTRL_REG1_DROS_MASK = _pyupm_mag3110.MAG3110_CTRL_REG1_DROS_MASK
MAG3110_CTRL_REG1_FR = _pyupm_mag3110.MAG3110_CTRL_REG1_FR
MAG3110_CTRL_REG1_TM = _pyupm_mag3110.MAG3110_CTRL_REG1_TM
MAG3110_CTRL_REG1_AC = _pyupm_mag3110.MAG3110_CTRL_REG1_AC
MAG3110_CTRL_REG2_AUTO_MRST_EN = _pyupm_mag3110.MAG3110_CTRL_REG2_AUTO_MRST_EN
MAG3110_CTRL_REG2_RAW = _pyupm_mag3110.MAG3110_CTRL_REG2_RAW
MAG3110_CTRL_REG2_MAG_RST = _pyupm_mag3110.MAG3110_CTRL_REG2_MAG_RST
MAG3110_DROS_8000_16 = _pyupm_mag3110.MAG3110_DROS_8000_16
MAG3110_DROS_4000_32 = _pyupm_mag3110.MAG3110_DROS_4000_32
MAG3110_DROS_2000_64 = _pyupm_mag3110.MAG3110_DROS_2000_64
MAG3110_DROS_1000_128 = _pyupm_mag3110.MAG3110_DROS_1000_128
MAG3110_DROS_4000_16 = _pyupm_mag3110.MAG3110_DROS_4000_16
MAG3110_DROS_2000_32 = _pyupm_mag3110.MAG3110_DROS_2000_32
MAG3110_DROS_1000_64 = _pyupm_mag3110.MAG3110_DROS_1000_64
MAG3110_DROS_0500_128 = _pyupm_mag3110.MAG3110_DROS_0500_128
MAG3110_DROS_2000_16 = _pyupm_mag3110.MAG3110_DROS_2000_16
MAG3110_DROS_1000_32 = _pyupm_mag3110.MAG3110_DROS_1000_32
MAG3110_DROS_0500_64 = _pyupm_mag3110.MAG3110_DROS_0500_64
MAG3110_DROS_0250_128 = _pyupm_mag3110.MAG3110_DROS_0250_128
MAG3110_DROS_1000_16 = _pyupm_mag3110.MAG3110_DROS_1000_16
MAG3110_DROS_0500_32 = _pyupm_mag3110.MAG3110_DROS_0500_32
MAG3110_DROS_0250_64 = _pyupm_mag3110.MAG3110_DROS_0250_64
MAG3110_DROS_0125_128 = _pyupm_mag3110.MAG3110_DROS_0125_128
MAG3110_DROS_0500_16 = _pyupm_mag3110.MAG3110_DROS_0500_16
MAG3110_DROS_0250_32 = _pyupm_mag3110.MAG3110_DROS_0250_32
MAG3110_DROS_0125_64 = _pyupm_mag3110.MAG3110_DROS_0125_64
MAG3110_DROS_0063_128 = _pyupm_mag3110.MAG3110_DROS_0063_128
MAG3110_DROS_0250_16 = _pyupm_mag3110.MAG3110_DROS_0250_16
MAG3110_DROS_0125_32 = _pyupm_mag3110.MAG3110_DROS_0125_32
MAG3110_DROS_0063_64 = _pyupm_mag3110.MAG3110_DROS_0063_64
MAG3110_DROS_0031_128 = _pyupm_mag3110.MAG3110_DROS_0031_128
MAG3110_DROS_0125_16 = _pyupm_mag3110.MAG3110_DROS_0125_16
MAG3110_DROS_0063_32 = _pyupm_mag3110.MAG3110_DROS_0063_32
MAG3110_DROS_0031_64 = _pyupm_mag3110.MAG3110_DROS_0031_64
MAG3110_DROS_0016_128 = _pyupm_mag3110.MAG3110_DROS_0016_128
MAG3110_DROS_0063_16 = _pyupm_mag3110.MAG3110_DROS_0063_16
MAG3110_DROS_0031_32 = _pyupm_mag3110.MAG3110_DROS_0031_32
MAG3110_DROS_0016_64 = _pyupm_mag3110.MAG3110_DROS_0016_64
MAG3110_DROS_0008_128 = _pyupm_mag3110.MAG3110_DROS_0008_128
MAG3110_DROS_DEFAULT = _pyupm_mag3110.MAG3110_DROS_DEFAULT
class mag3110_data_t(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, mag3110_data_t, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, mag3110_data_t, name)
    __repr__ = _swig_repr
    __swig_setmethods__["x"] = _pyupm_mag3110.mag3110_data_t_x_set
    __swig_getmethods__["x"] = _pyupm_mag3110.mag3110_data_t_x_get
    if _newclass:
        x = _swig_property(_pyupm_mag3110.mag3110_data_t_x_get, _pyupm_mag3110.mag3110_data_t_x_set)
    __swig_setmethods__["y"] = _pyupm_mag3110.mag3110_data_t_y_set
    __swig_getmethods__["y"] = _pyupm_mag3110.mag3110_data_t_y_get
    if _newclass:
        y = _swig_property(_pyupm_mag3110.mag3110_data_t_y_get, _pyupm_mag3110.mag3110_data_t_y_set)
    __swig_setmethods__["z"] = _pyupm_mag3110.mag3110_data_t_z_set
    __swig_getmethods__["z"] = _pyupm_mag3110.mag3110_data_t_z_get
    if _newclass:
        z = _swig_property(_pyupm_mag3110.mag3110_data_t_z_get, _pyupm_mag3110.mag3110_data_t_z_set)
    __swig_setmethods__["status"] = _pyupm_mag3110.mag3110_data_t_status_set
    __swig_getmethods__["status"] = _pyupm_mag3110.mag3110_data_t_status_get
    if _newclass:
        status = _swig_property(_pyupm_mag3110.mag3110_data_t_status_get, _pyupm_mag3110.mag3110_data_t_status_set)
    __swig_setmethods__["dtemp"] = _pyupm_mag3110.mag3110_data_t_dtemp_set
    __swig_getmethods__["dtemp"] = _pyupm_mag3110.mag3110_data_t_dtemp_get
    if _newclass:
        dtemp = _swig_property(_pyupm_mag3110.mag3110_data_t_dtemp_get, _pyupm_mag3110.mag3110_data_t_dtemp_set)

    def __init__(self):
        this = _pyupm_mag3110.new_mag3110_data_t()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _pyupm_mag3110.delete_mag3110_data_t
    __del__ = lambda self: None
mag3110_data_t_swigregister = _pyupm_mag3110.mag3110_data_t_swigregister
mag3110_data_t_swigregister(mag3110_data_t)

class MAG3110(upm.pyupm_interfaces.iMagnetometer):
    __swig_setmethods__ = {}
    for _s in [upm.pyupm_interfaces.iMagnetometer]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, MAG3110, name, value)
    __swig_getmethods__ = {}
    for _s in [upm.pyupm_interfaces.iMagnetometer]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, MAG3110, name)
    __repr__ = _swig_repr

    def __init__(self, bus, dros=15, devAddr=0x0E):
        this = _pyupm_mag3110.new_MAG3110(bus, dros, devAddr)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def checkID(self):
        return _pyupm_mag3110.MAG3110_checkID(self)

    def getMagnetometer(self):
        return _pyupm_mag3110.MAG3110_getMagnetometer(self)

    def setUserOffset(self, x, y, z):
        return _pyupm_mag3110.MAG3110_setUserOffset(self, x, y, z)

    def setActive(self):
        return _pyupm_mag3110.MAG3110_setActive(self)

    def setStandby(self):
        return _pyupm_mag3110.MAG3110_setStandby(self)

    def isReady(self):
        return _pyupm_mag3110.MAG3110_isReady(self)

    def sampleData(self):
        return _pyupm_mag3110.MAG3110_sampleData(self)

    def getX(self, bSampleData=0):
        return _pyupm_mag3110.MAG3110_getX(self, bSampleData)

    def getY(self, bSampleData=0):
        return _pyupm_mag3110.MAG3110_getY(self, bSampleData)

    def getZ(self, bSampleData=0):
        return _pyupm_mag3110.MAG3110_getZ(self, bSampleData)

    def getStatus(self):
        return _pyupm_mag3110.MAG3110_getStatus(self)

    def getDieTemperature(self):
        return _pyupm_mag3110.MAG3110_getDieTemperature(self)

    def getData(self, data, bSampleData=0):
        return _pyupm_mag3110.MAG3110_getData(self, data, bSampleData)
    __swig_destroy__ = _pyupm_mag3110.delete_MAG3110
    __del__ = lambda self: None
MAG3110_swigregister = _pyupm_mag3110.MAG3110_swigregister
MAG3110_swigregister(MAG3110)

# This file is compatible with both classic and new-style classes.


