# 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_hp20x')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_pyupm_hp20x')
    _pyupm_hp20x = 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_hp20x', [dirname(__file__)])
        except ImportError:
            import _pyupm_hp20x
            return _pyupm_hp20x
        try:
            _mod = imp.load_module('_pyupm_hp20x', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _pyupm_hp20x = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_hp20x
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_hp20x.getVersion()
getVersion = _pyupm_hp20x.getVersion
HP20X_I2C_BUS = _pyupm_hp20x.HP20X_I2C_BUS
HP20X_DEFAULT_I2C_ADDR = _pyupm_hp20x.HP20X_DEFAULT_I2C_ADDR
class HP20X(upm.pyupm_interfaces.iPressure, upm.pyupm_interfaces.iTemperature):
    __swig_setmethods__ = {}
    for _s in [upm.pyupm_interfaces.iPressure, upm.pyupm_interfaces.iTemperature]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, HP20X, name, value)
    __swig_getmethods__ = {}
    for _s in [upm.pyupm_interfaces.iPressure, upm.pyupm_interfaces.iTemperature]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, HP20X, name)
    __repr__ = _swig_repr
    CMD_SOFT_RST = _pyupm_hp20x.HP20X_CMD_SOFT_RST
    CMD_ADC_CVT = _pyupm_hp20x.HP20X_CMD_ADC_CVT
    CMD_READ_PT = _pyupm_hp20x.HP20X_CMD_READ_PT
    CMD_READ_AT = _pyupm_hp20x.HP20X_CMD_READ_AT
    CMD_READ_P = _pyupm_hp20x.HP20X_CMD_READ_P
    CMD_READ_A = _pyupm_hp20x.HP20X_CMD_READ_A
    CMD_READ_T = _pyupm_hp20x.HP20X_CMD_READ_T
    CMD_ANA_CAL = _pyupm_hp20x.HP20X_CMD_ANA_CAL
    CMD_READ_REG = _pyupm_hp20x.HP20X_CMD_READ_REG
    CMD_WRITE_REG = _pyupm_hp20x.HP20X_CMD_WRITE_REG
    CHNL_PT = _pyupm_hp20x.HP20X_CHNL_PT
    CHNL_T = _pyupm_hp20x.HP20X_CHNL_T
    CHNL_SHIFT = _pyupm_hp20x.HP20X_CHNL_SHIFT
    DSR_4096 = _pyupm_hp20x.HP20X_DSR_4096
    DSR_2048 = _pyupm_hp20x.HP20X_DSR_2048
    DSR_1024 = _pyupm_hp20x.HP20X_DSR_1024
    DSR_512 = _pyupm_hp20x.HP20X_DSR_512
    DSR_256 = _pyupm_hp20x.HP20X_DSR_256
    DSR_128 = _pyupm_hp20x.HP20X_DSR_128
    DSR_SHIFT = _pyupm_hp20x.HP20X_DSR_SHIFT
    REG_ALT_OFF_LSB = _pyupm_hp20x.HP20X_REG_ALT_OFF_LSB
    REG_ALT_OFF_MSB = _pyupm_hp20x.HP20X_REG_ALT_OFF_MSB
    REG_PA_H_TH_LSB = _pyupm_hp20x.HP20X_REG_PA_H_TH_LSB
    REG_PA_H_TH_MSB = _pyupm_hp20x.HP20X_REG_PA_H_TH_MSB
    REG_PA_M_TH_LSB = _pyupm_hp20x.HP20X_REG_PA_M_TH_LSB
    REG_PA_M_TH_MSB = _pyupm_hp20x.HP20X_REG_PA_M_TH_MSB
    REG_PA_L_TH_LSB = _pyupm_hp20x.HP20X_REG_PA_L_TH_LSB
    REG_PA_L_TH_MSB = _pyupm_hp20x.HP20X_REG_PA_L_TH_MSB
    REG_T_H_TH = _pyupm_hp20x.HP20X_REG_T_H_TH
    REG_T_M_TH = _pyupm_hp20x.HP20X_REG_T_M_TH
    REG_T_L_TH = _pyupm_hp20x.HP20X_REG_T_L_TH
    REG_INT_EN = _pyupm_hp20x.HP20X_REG_INT_EN
    REG_INT_CFG = _pyupm_hp20x.HP20X_REG_INT_CFG
    REG_INT_SRC = _pyupm_hp20x.HP20X_REG_INT_SRC
    REG_PARA = _pyupm_hp20x.HP20X_REG_PARA
    INT_EN_T_WIN_EN = _pyupm_hp20x.HP20X_INT_EN_T_WIN_EN
    INT_EN_PA_WIN_EN = _pyupm_hp20x.HP20X_INT_EN_PA_WIN_EN
    INT_EN_T_TRAV_EN = _pyupm_hp20x.HP20X_INT_EN_T_TRAV_EN
    INT_EN_PA_TRAV_EN = _pyupm_hp20x.HP20X_INT_EN_PA_TRAV_EN
    INT_EN_T_RDY_EN = _pyupm_hp20x.HP20X_INT_EN_T_RDY_EN
    INT_EN_PA_RDY_EN = _pyupm_hp20x.HP20X_INT_EN_PA_RDY_EN
    INT_CFG_T_WIN_CFG = _pyupm_hp20x.HP20X_INT_CFG_T_WIN_CFG
    INT_CFG_PA_WIN_CFG = _pyupm_hp20x.HP20X_INT_CFG_PA_WIN_CFG
    INT_CFG_T_TRAV_CFG = _pyupm_hp20x.HP20X_INT_CFG_T_TRAV_CFG
    INT_CFG_PA_TRAV_CFG = _pyupm_hp20x.HP20X_INT_CFG_PA_TRAV_CFG
    INT_CFG_T_RDY_CFG = _pyupm_hp20x.HP20X_INT_CFG_T_RDY_CFG
    INT_CFG_PA_RDY_CFG = _pyupm_hp20x.HP20X_INT_CFG_PA_RDY_CFG
    INT_CFG_PA_MODE = _pyupm_hp20x.HP20X_INT_CFG_PA_MODE
    INT_SRC_T_WIN = _pyupm_hp20x.HP20X_INT_SRC_T_WIN
    INT_SRC_PA_WIN = _pyupm_hp20x.HP20X_INT_SRC_PA_WIN
    INT_SRC_T_TRAV = _pyupm_hp20x.HP20X_INT_SRC_T_TRAV
    INT_SRC_PA_TRAV = _pyupm_hp20x.HP20X_INT_SRC_PA_TRAV
    INT_SRC_T_RDY = _pyupm_hp20x.HP20X_INT_SRC_T_RDY
    INT_SRC_PA_RDY = _pyupm_hp20x.HP20X_INT_SRC_PA_RDY
    INT_SRC_DEV_RDY = _pyupm_hp20x.HP20X_INT_SRC_DEV_RDY
    INT_SRC_TH_ERR = _pyupm_hp20x.HP20X_INT_SRC_TH_ERR
    PARA_CMPS_EN = _pyupm_hp20x.HP20X_PARA_CMPS_EN

    def __init__(self, bus=0, address=0x76):
        this = _pyupm_hp20x.new_HP20X(bus, address)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _pyupm_hp20x.delete_HP20X
    __del__ = lambda self: None

    def init(self, *args):
        return _pyupm_hp20x.HP20X_init(self, *args)

    def writeCmd(self, cmd):
        return _pyupm_hp20x.HP20X_writeCmd(self, cmd)

    def writeReg(self, reg, data):
        return _pyupm_hp20x.HP20X_writeReg(self, reg, data)

    def readReg(self, reg):
        return _pyupm_hp20x.HP20X_readReg(self, reg)

    def readData(self):
        return _pyupm_hp20x.HP20X_readData(self)

    def isReady(self):
        return _pyupm_hp20x.HP20X_isReady(self)

    def waitforDeviceReady(self):
        return _pyupm_hp20x.HP20X_waitforDeviceReady(self)

    def getTemperature(self):
        return _pyupm_hp20x.HP20X_getTemperature(self)

    def getPressure(self):
        return _pyupm_hp20x.HP20X_getPressure(self)

    def getAltitude(self):
        return _pyupm_hp20x.HP20X_getAltitude(self)

    def compensationEnable(self, enable):
        return _pyupm_hp20x.HP20X_compensationEnable(self, enable)

    def setInterruptEnable(self, bits):
        return _pyupm_hp20x.HP20X_setInterruptEnable(self, bits)

    def setInterruptConfig(self, bits):
        return _pyupm_hp20x.HP20X_setInterruptConfig(self, bits)

    def getInterruptSource(self):
        return _pyupm_hp20x.HP20X_getInterruptSource(self)

    def setDSR(self, dsr):
        return _pyupm_hp20x.HP20X_setDSR(self, dsr)

    def recalibrateInternal(self):
        return _pyupm_hp20x.HP20X_recalibrateInternal(self)

    def softReset(self):
        return _pyupm_hp20x.HP20X_softReset(self)

    def setAltitudeOffset(self, off):
        return _pyupm_hp20x.HP20X_setAltitudeOffset(self, off)

    def setPAThreshholds(self, low, med, high):
        return _pyupm_hp20x.HP20X_setPAThreshholds(self, low, med, high)

    def setTemperatureThreshholds(self, low, med, high):
        return _pyupm_hp20x.HP20X_setTemperatureThreshholds(self, low, med, high)
HP20X_swigregister = _pyupm_hp20x.HP20X_swigregister
HP20X_swigregister(HP20X)

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


