Source code for pyupm_hdc1000

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# 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
if 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_hdc1000', [dirname(__file__)])
        except ImportError:
            import _pyupm_hdc1000
            return _pyupm_hdc1000
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_hdc1000', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_hdc1000 = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_hdc1000
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.


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_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)


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

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0



def getVersion():
    return _pyupm_hdc1000.getVersion()
getVersion = _pyupm_hdc1000.getVersion

_pyupm_hdc1000.HDC1000_NAME_swigconstant(_pyupm_hdc1000)
HDC1000_NAME = _pyupm_hdc1000.HDC1000_NAME

_pyupm_hdc1000.HDC1000_i2C_ADDRESS_swigconstant(_pyupm_hdc1000)
HDC1000_i2C_ADDRESS = _pyupm_hdc1000.HDC1000_i2C_ADDRESS

_pyupm_hdc1000.HDC1000_MANUFACTURER_ID_swigconstant(_pyupm_hdc1000)
HDC1000_MANUFACTURER_ID = _pyupm_hdc1000.HDC1000_MANUFACTURER_ID

_pyupm_hdc1000.HDC1000_DEVICE_ID_swigconstant(_pyupm_hdc1000)
HDC1000_DEVICE_ID = _pyupm_hdc1000.HDC1000_DEVICE_ID

_pyupm_hdc1000.HDC1000_TEMPERATURE_swigconstant(_pyupm_hdc1000)
HDC1000_TEMPERATURE = _pyupm_hdc1000.HDC1000_TEMPERATURE

_pyupm_hdc1000.HDC1000_HUMIDITY_swigconstant(_pyupm_hdc1000)
HDC1000_HUMIDITY = _pyupm_hdc1000.HDC1000_HUMIDITY

_pyupm_hdc1000.HDC1000_CONFIGURATION_swigconstant(_pyupm_hdc1000)
HDC1000_CONFIGURATION = _pyupm_hdc1000.HDC1000_CONFIGURATION

_pyupm_hdc1000.HDC1000_MANUFACTURER_ID_REG_swigconstant(_pyupm_hdc1000)
HDC1000_MANUFACTURER_ID_REG = _pyupm_hdc1000.HDC1000_MANUFACTURER_ID_REG

_pyupm_hdc1000.HDC1000_DEVICE_ID_REG_swigconstant(_pyupm_hdc1000)
HDC1000_DEVICE_ID_REG = _pyupm_hdc1000.HDC1000_DEVICE_ID_REG

_pyupm_hdc1000.HDC1000_RST_SOFT_swigconstant(_pyupm_hdc1000)
HDC1000_RST_SOFT = _pyupm_hdc1000.HDC1000_RST_SOFT

_pyupm_hdc1000.HDC1000_HEAT_swigconstant(_pyupm_hdc1000)
HDC1000_HEAT = _pyupm_hdc1000.HDC1000_HEAT

_pyupm_hdc1000.HDC1000_SEQ_MODE_swigconstant(_pyupm_hdc1000)
HDC1000_SEQ_MODE = _pyupm_hdc1000.HDC1000_SEQ_MODE

_pyupm_hdc1000.HDC1000_BTST_LOW_swigconstant(_pyupm_hdc1000)
HDC1000_BTST_LOW = _pyupm_hdc1000.HDC1000_BTST_LOW

_pyupm_hdc1000.HDC1000_TRES_14_swigconstant(_pyupm_hdc1000)
HDC1000_TRES_14 = _pyupm_hdc1000.HDC1000_TRES_14

_pyupm_hdc1000.HDC1000_TRES_11_swigconstant(_pyupm_hdc1000)
HDC1000_TRES_11 = _pyupm_hdc1000.HDC1000_TRES_11

_pyupm_hdc1000.HDC1000_HRES_14_swigconstant(_pyupm_hdc1000)
HDC1000_HRES_14 = _pyupm_hdc1000.HDC1000_HRES_14

_pyupm_hdc1000.HDC1000_HRES_11_swigconstant(_pyupm_hdc1000)
HDC1000_HRES_11 = _pyupm_hdc1000.HDC1000_HRES_11

_pyupm_hdc1000.HDC1000_HRES_8_swigconstant(_pyupm_hdc1000)
HDC1000_HRES_8 = _pyupm_hdc1000.HDC1000_HRES_8

_pyupm_hdc1000.SLEEP_SEC_swigconstant(_pyupm_hdc1000)
SLEEP_SEC = _pyupm_hdc1000.SLEEP_SEC
[docs]class HDC1000(_object): """ API for the HDC1000 Temperature & Humidity Sensor. ID: hdc1000 Name: HDC1000 Temperature & Humidity Sensor Category: temp Manufacturer: ti Link:http://www.ti.com/lit/ds/symlink/hdc1000.pdf Connection: i2c Description in web-link above: The HDC1000 is a digital humidity sensor with integrated temperature sensor that provides excellent measurement accuracy at very low power. The device measures humidity based on a novel capacitive sensor. The humidity and temperature sensors are factory calibrated. The innovative WLCSP (Wafer Level Chip Scale Package) simplifies board design with the use of an ultra-compact package. The sensing element of the HDC1000 is placed on the bottom part of the device, which makes the HDC1000 more robust against dirt, dust, and other environmental contaminants. The HDC1000 is functional within the full -40 to +125 [degC] temperature range. C++ includes: hdc1000.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, HDC1000, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, HDC1000, name) __repr__ = _swig_repr def __init__(self, bus, devAddr=0x43): """ HDC1000(int bus, int devAddr=HDC1000_i2C_ADDRESS) Instantiates an HDC1000 object Parameters: ----------- bus: Number of the used bus devAddr: Address of the used I2C device """ this = _pyupm_hdc1000.new_HDC1000(bus, devAddr) try: self.this.append(this) except Exception: self.this = this
[docs] def checkID(self): """ int checkID(void) Check device_id of sensor 0 on succes -1 on error """ return _pyupm_hdc1000.HDC1000_checkID(self)
[docs] def resetSensor(self): """ void resetSensor(void) Performs a soft reset of the HDC1000 device to ensure it is in a known state. """ return _pyupm_hdc1000.HDC1000_resetSensor(self)
[docs] def sampleData(self): """ void sampleData(void) Initiates a temperature/pressure mesasurement and waits to complete. """ return _pyupm_hdc1000.HDC1000_sampleData(self)
[docs] def getHumidity(self, bSampleData=False): """ float getHumidity(int bSampleData=false) Get the current measured humidity [RH] Parameters: ----------- bSampleData: Flag to read sensor The humidity sensor temp in degC """ return _pyupm_hdc1000.HDC1000_getHumidity(self, bSampleData)
[docs] def getTemperature(self, bSampleData=False): """ float getTemperature(int bSampleData=false) Get the humidity cell temperature [degC] Parameters: ----------- bSampleData: Flag to read sensor The humidity sensor temp in degC """ return _pyupm_hdc1000.HDC1000_getTemperature(self, bSampleData)
__swig_destroy__ = _pyupm_hdc1000.delete_HDC1000 __del__ = lambda self: None
HDC1000_swigregister = _pyupm_hdc1000.HDC1000_swigregister HDC1000_swigregister(HDC1000) # This file is compatible with both classic and new-style classes.