Source code for pyupm_maxds3231m

# 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_maxds3231m', [dirname(__file__)])
        except ImportError:
            import _pyupm_maxds3231m
            return _pyupm_maxds3231m
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_maxds3231m', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_maxds3231m = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_maxds3231m
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_maxds3231m.getVersion()
getVersion = _pyupm_maxds3231m.getVersion

_pyupm_maxds3231m.ADDR_swigconstant(_pyupm_maxds3231m)
ADDR = _pyupm_maxds3231m.ADDR

_pyupm_maxds3231m.TIME_CAL_ADDR_swigconstant(_pyupm_maxds3231m)
TIME_CAL_ADDR = _pyupm_maxds3231m.TIME_CAL_ADDR

_pyupm_maxds3231m.ALARM1_ADDR_swigconstant(_pyupm_maxds3231m)
ALARM1_ADDR = _pyupm_maxds3231m.ALARM1_ADDR

_pyupm_maxds3231m.ALARM2_ADDR_swigconstant(_pyupm_maxds3231m)
ALARM2_ADDR = _pyupm_maxds3231m.ALARM2_ADDR

_pyupm_maxds3231m.CONTROL_ADDR_swigconstant(_pyupm_maxds3231m)
CONTROL_ADDR = _pyupm_maxds3231m.CONTROL_ADDR

_pyupm_maxds3231m.STATUS_ADDR_swigconstant(_pyupm_maxds3231m)
STATUS_ADDR = _pyupm_maxds3231m.STATUS_ADDR

_pyupm_maxds3231m.AGING_OFFSET_ADDR_swigconstant(_pyupm_maxds3231m)
AGING_OFFSET_ADDR = _pyupm_maxds3231m.AGING_OFFSET_ADDR

_pyupm_maxds3231m.TEMPERATURE_ADDR_swigconstant(_pyupm_maxds3231m)
TEMPERATURE_ADDR = _pyupm_maxds3231m.TEMPERATURE_ADDR

_pyupm_maxds3231m.A1IE_swigconstant(_pyupm_maxds3231m)
A1IE = _pyupm_maxds3231m.A1IE

_pyupm_maxds3231m.A2IE_swigconstant(_pyupm_maxds3231m)
A2IE = _pyupm_maxds3231m.A2IE

_pyupm_maxds3231m.INTCN_swigconstant(_pyupm_maxds3231m)
INTCN = _pyupm_maxds3231m.INTCN

_pyupm_maxds3231m.A1F_swigconstant(_pyupm_maxds3231m)
A1F = _pyupm_maxds3231m.A1F

_pyupm_maxds3231m.A2F_swigconstant(_pyupm_maxds3231m)
A2F = _pyupm_maxds3231m.A2F

_pyupm_maxds3231m.OSF_swigconstant(_pyupm_maxds3231m)
OSF = _pyupm_maxds3231m.OSF

_pyupm_maxds3231m.HIGH_swigconstant(_pyupm_maxds3231m)
HIGH = _pyupm_maxds3231m.HIGH

_pyupm_maxds3231m.LOW_swigconstant(_pyupm_maxds3231m)
LOW = _pyupm_maxds3231m.LOW
[docs]class Time3231(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, Time3231, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, Time3231, name) __repr__ = _swig_repr __swig_setmethods__["second"] = _pyupm_maxds3231m.Time3231_second_set __swig_getmethods__["second"] = _pyupm_maxds3231m.Time3231_second_get if _newclass: second = _swig_property(_pyupm_maxds3231m.Time3231_second_get, _pyupm_maxds3231m.Time3231_second_set) __swig_setmethods__["minute"] = _pyupm_maxds3231m.Time3231_minute_set __swig_getmethods__["minute"] = _pyupm_maxds3231m.Time3231_minute_get if _newclass: minute = _swig_property(_pyupm_maxds3231m.Time3231_minute_get, _pyupm_maxds3231m.Time3231_minute_set) __swig_setmethods__["hour"] = _pyupm_maxds3231m.Time3231_hour_set __swig_getmethods__["hour"] = _pyupm_maxds3231m.Time3231_hour_get if _newclass: hour = _swig_property(_pyupm_maxds3231m.Time3231_hour_get, _pyupm_maxds3231m.Time3231_hour_set) __swig_setmethods__["day"] = _pyupm_maxds3231m.Time3231_day_set __swig_getmethods__["day"] = _pyupm_maxds3231m.Time3231_day_get if _newclass: day = _swig_property(_pyupm_maxds3231m.Time3231_day_get, _pyupm_maxds3231m.Time3231_day_set) __swig_setmethods__["month"] = _pyupm_maxds3231m.Time3231_month_set __swig_getmethods__["month"] = _pyupm_maxds3231m.Time3231_month_get if _newclass: month = _swig_property(_pyupm_maxds3231m.Time3231_month_get, _pyupm_maxds3231m.Time3231_month_set) __swig_setmethods__["year"] = _pyupm_maxds3231m.Time3231_year_set __swig_getmethods__["year"] = _pyupm_maxds3231m.Time3231_year_get if _newclass: year = _swig_property(_pyupm_maxds3231m.Time3231_year_get, _pyupm_maxds3231m.Time3231_year_set) __swig_setmethods__["weekDay"] = _pyupm_maxds3231m.Time3231_weekDay_set __swig_getmethods__["weekDay"] = _pyupm_maxds3231m.Time3231_weekDay_get if _newclass: weekDay = _swig_property(_pyupm_maxds3231m.Time3231_weekDay_get, _pyupm_maxds3231m.Time3231_weekDay_set) def __init__(self): this = _pyupm_maxds3231m.new_Time3231() try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_maxds3231m.delete_Time3231 __del__ = lambda self: None
Time3231_swigregister = _pyupm_maxds3231m.Time3231_swigregister Time3231_swigregister(Time3231)
[docs]class MAXDS3231M(_object): """ API for the MAXDS3231M I2C Real-Time Clock. ID: maxds3231m Name: Realtime Clock (RTC) Sensor Library Category: light Manufacturer: maxim Connection: i2c Link:https://www.maximintegrated.com/en/products/digital/real-time- clocks/DS3231.html This module defines the API for MAXDS3231M C++ includes: maxds3231m.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, MAXDS3231M, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, MAXDS3231M, name) __repr__ = _swig_repr def __init__(self, bus=0, devAddr=0x68): """ MAXDS3231M(int bus=0, int devAddr=0x68) Instantiates an MAXDS3231M object Parameters: ----------- bus: Number of the used bus devAddr: Address of the used I2C device """ this = _pyupm_maxds3231m.new_MAXDS3231M(bus, devAddr) try: self.this.append(this) except Exception: self.this = this
[docs] def setDate(self, time): """ void setDate(Time3231 &time) Sets the date and time on the chip. Parameters: ----------- time: Time structure """ return _pyupm_maxds3231m.MAXDS3231M_setDate(self, time)
[docs] def getDate(self, time): """ bool getDate(Time3231 &time) Gets the date and time from the chip. Parameters: ----------- time: Time structure """ return _pyupm_maxds3231m.MAXDS3231M_getDate(self, time)
[docs] def getTemperature(self): """ uint16_t getTemperature() Gets the on-board temperature. """ return _pyupm_maxds3231m.MAXDS3231M_getTemperature(self)
[docs] def name(self): """ std::string name() Returns the name of the component """ return _pyupm_maxds3231m.MAXDS3231M_name(self)
__swig_destroy__ = _pyupm_maxds3231m.delete_MAXDS3231M __del__ = lambda self: None
MAXDS3231M_swigregister = _pyupm_maxds3231m.MAXDS3231M_swigregister MAXDS3231M_swigregister(MAXDS3231M) # This file is compatible with both classic and new-style classes.