# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# 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):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pyupm_hp20x
else:
    import _pyupm_hp20x

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

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,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import upm.pyupm_interfaces

def getVersion():
    return _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):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __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):
        _pyupm_hp20x.HP20X_swiginit(self, _pyupm_hp20x.new_HP20X(bus, address))
    __swig_destroy__ = _pyupm_hp20x.delete_HP20X

    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)

# Register HP20X in _pyupm_hp20x:
_pyupm_hp20x.HP20X_swigregister(HP20X)



