Source code for pyupm_mma7455

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

_pyupm_mma7455.ADDR_swigconstant(_pyupm_mma7455)
ADDR = _pyupm_mma7455.ADDR

_pyupm_mma7455.MMA7455_XOUTL_swigconstant(_pyupm_mma7455)
MMA7455_XOUTL = _pyupm_mma7455.MMA7455_XOUTL

_pyupm_mma7455.MMA7455_XOUTH_swigconstant(_pyupm_mma7455)
MMA7455_XOUTH = _pyupm_mma7455.MMA7455_XOUTH

_pyupm_mma7455.MMA7455_YOUTL_swigconstant(_pyupm_mma7455)
MMA7455_YOUTL = _pyupm_mma7455.MMA7455_YOUTL

_pyupm_mma7455.MMA7455_YOUTH_swigconstant(_pyupm_mma7455)
MMA7455_YOUTH = _pyupm_mma7455.MMA7455_YOUTH

_pyupm_mma7455.MMA7455_ZOUTL_swigconstant(_pyupm_mma7455)
MMA7455_ZOUTL = _pyupm_mma7455.MMA7455_ZOUTL

_pyupm_mma7455.MMA7455_ZOUTH_swigconstant(_pyupm_mma7455)
MMA7455_ZOUTH = _pyupm_mma7455.MMA7455_ZOUTH

_pyupm_mma7455.MMA7455_XOUT8_swigconstant(_pyupm_mma7455)
MMA7455_XOUT8 = _pyupm_mma7455.MMA7455_XOUT8

_pyupm_mma7455.MMA7455_YOUT8_swigconstant(_pyupm_mma7455)
MMA7455_YOUT8 = _pyupm_mma7455.MMA7455_YOUT8

_pyupm_mma7455.MMA7455_ZOUT8_swigconstant(_pyupm_mma7455)
MMA7455_ZOUT8 = _pyupm_mma7455.MMA7455_ZOUT8

_pyupm_mma7455.MMA7455_STATUS_swigconstant(_pyupm_mma7455)
MMA7455_STATUS = _pyupm_mma7455.MMA7455_STATUS

_pyupm_mma7455.MMA7455_DETSRC_swigconstant(_pyupm_mma7455)
MMA7455_DETSRC = _pyupm_mma7455.MMA7455_DETSRC

_pyupm_mma7455.MMA7455_TOUT_swigconstant(_pyupm_mma7455)
MMA7455_TOUT = _pyupm_mma7455.MMA7455_TOUT

_pyupm_mma7455.MMA7455_RESERVED1_swigconstant(_pyupm_mma7455)
MMA7455_RESERVED1 = _pyupm_mma7455.MMA7455_RESERVED1

_pyupm_mma7455.MMA7455_I2CAD_swigconstant(_pyupm_mma7455)
MMA7455_I2CAD = _pyupm_mma7455.MMA7455_I2CAD

_pyupm_mma7455.MMA7455_USRINF_swigconstant(_pyupm_mma7455)
MMA7455_USRINF = _pyupm_mma7455.MMA7455_USRINF

_pyupm_mma7455.MMA7455_WHOAMI_swigconstant(_pyupm_mma7455)
MMA7455_WHOAMI = _pyupm_mma7455.MMA7455_WHOAMI

_pyupm_mma7455.MMA7455_XOFFL_swigconstant(_pyupm_mma7455)
MMA7455_XOFFL = _pyupm_mma7455.MMA7455_XOFFL

_pyupm_mma7455.MMA7455_XOFFH_swigconstant(_pyupm_mma7455)
MMA7455_XOFFH = _pyupm_mma7455.MMA7455_XOFFH

_pyupm_mma7455.MMA7455_YOFFL_swigconstant(_pyupm_mma7455)
MMA7455_YOFFL = _pyupm_mma7455.MMA7455_YOFFL

_pyupm_mma7455.MMA7455_YOFFH_swigconstant(_pyupm_mma7455)
MMA7455_YOFFH = _pyupm_mma7455.MMA7455_YOFFH

_pyupm_mma7455.MMA7455_ZOFFL_swigconstant(_pyupm_mma7455)
MMA7455_ZOFFL = _pyupm_mma7455.MMA7455_ZOFFL

_pyupm_mma7455.MMA7455_ZOFFH_swigconstant(_pyupm_mma7455)
MMA7455_ZOFFH = _pyupm_mma7455.MMA7455_ZOFFH

_pyupm_mma7455.MMA7455_MCTL_swigconstant(_pyupm_mma7455)
MMA7455_MCTL = _pyupm_mma7455.MMA7455_MCTL

_pyupm_mma7455.MMA7455_INTRST_swigconstant(_pyupm_mma7455)
MMA7455_INTRST = _pyupm_mma7455.MMA7455_INTRST

_pyupm_mma7455.MMA7455_CTL1_swigconstant(_pyupm_mma7455)
MMA7455_CTL1 = _pyupm_mma7455.MMA7455_CTL1

_pyupm_mma7455.MMA7455_CTL2_swigconstant(_pyupm_mma7455)
MMA7455_CTL2 = _pyupm_mma7455.MMA7455_CTL2

_pyupm_mma7455.MMA7455_LDTH_swigconstant(_pyupm_mma7455)
MMA7455_LDTH = _pyupm_mma7455.MMA7455_LDTH

_pyupm_mma7455.MMA7455_PDTH_swigconstant(_pyupm_mma7455)
MMA7455_PDTH = _pyupm_mma7455.MMA7455_PDTH

_pyupm_mma7455.MMA7455_PD_swigconstant(_pyupm_mma7455)
MMA7455_PD = _pyupm_mma7455.MMA7455_PD

_pyupm_mma7455.MMA7455_LT_swigconstant(_pyupm_mma7455)
MMA7455_LT = _pyupm_mma7455.MMA7455_LT

_pyupm_mma7455.MMA7455_TW_swigconstant(_pyupm_mma7455)
MMA7455_TW = _pyupm_mma7455.MMA7455_TW

_pyupm_mma7455.MMA7455_RESERVED2_swigconstant(_pyupm_mma7455)
MMA7455_RESERVED2 = _pyupm_mma7455.MMA7455_RESERVED2

_pyupm_mma7455.MMA7455_D0_swigconstant(_pyupm_mma7455)
MMA7455_D0 = _pyupm_mma7455.MMA7455_D0

_pyupm_mma7455.MMA7455_D1_swigconstant(_pyupm_mma7455)
MMA7455_D1 = _pyupm_mma7455.MMA7455_D1

_pyupm_mma7455.MMA7455_D2_swigconstant(_pyupm_mma7455)
MMA7455_D2 = _pyupm_mma7455.MMA7455_D2

_pyupm_mma7455.MMA7455_D3_swigconstant(_pyupm_mma7455)
MMA7455_D3 = _pyupm_mma7455.MMA7455_D3

_pyupm_mma7455.MMA7455_D4_swigconstant(_pyupm_mma7455)
MMA7455_D4 = _pyupm_mma7455.MMA7455_D4

_pyupm_mma7455.MMA7455_D5_swigconstant(_pyupm_mma7455)
MMA7455_D5 = _pyupm_mma7455.MMA7455_D5

_pyupm_mma7455.MMA7455_D6_swigconstant(_pyupm_mma7455)
MMA7455_D6 = _pyupm_mma7455.MMA7455_D6

_pyupm_mma7455.MMA7455_D7_swigconstant(_pyupm_mma7455)
MMA7455_D7 = _pyupm_mma7455.MMA7455_D7

_pyupm_mma7455.MMA7455_DRDY_swigconstant(_pyupm_mma7455)
MMA7455_DRDY = _pyupm_mma7455.MMA7455_DRDY

_pyupm_mma7455.MMA7455_DOVR_swigconstant(_pyupm_mma7455)
MMA7455_DOVR = _pyupm_mma7455.MMA7455_DOVR

_pyupm_mma7455.MMA7455_PERR_swigconstant(_pyupm_mma7455)
MMA7455_PERR = _pyupm_mma7455.MMA7455_PERR

_pyupm_mma7455.MMA7455_MODE0_swigconstant(_pyupm_mma7455)
MMA7455_MODE0 = _pyupm_mma7455.MMA7455_MODE0

_pyupm_mma7455.MMA7455_MODE1_swigconstant(_pyupm_mma7455)
MMA7455_MODE1 = _pyupm_mma7455.MMA7455_MODE1

_pyupm_mma7455.MMA7455_GLVL0_swigconstant(_pyupm_mma7455)
MMA7455_GLVL0 = _pyupm_mma7455.MMA7455_GLVL0

_pyupm_mma7455.MMA7455_GLVL1_swigconstant(_pyupm_mma7455)
MMA7455_GLVL1 = _pyupm_mma7455.MMA7455_GLVL1

_pyupm_mma7455.MMA7455_STON_swigconstant(_pyupm_mma7455)
MMA7455_STON = _pyupm_mma7455.MMA7455_STON

_pyupm_mma7455.MMA7455_SPI3W_swigconstant(_pyupm_mma7455)
MMA7455_SPI3W = _pyupm_mma7455.MMA7455_SPI3W

_pyupm_mma7455.MMA7455_DRPD_swigconstant(_pyupm_mma7455)
MMA7455_DRPD = _pyupm_mma7455.MMA7455_DRPD

_pyupm_mma7455.MMA7455_INTPIN_swigconstant(_pyupm_mma7455)
MMA7455_INTPIN = _pyupm_mma7455.MMA7455_INTPIN

_pyupm_mma7455.MMA7455_INTREG0_swigconstant(_pyupm_mma7455)
MMA7455_INTREG0 = _pyupm_mma7455.MMA7455_INTREG0

_pyupm_mma7455.MMA7455_INTREG1_swigconstant(_pyupm_mma7455)
MMA7455_INTREG1 = _pyupm_mma7455.MMA7455_INTREG1

_pyupm_mma7455.MMA7455_XDA_swigconstant(_pyupm_mma7455)
MMA7455_XDA = _pyupm_mma7455.MMA7455_XDA

_pyupm_mma7455.MMA7455_YDA_swigconstant(_pyupm_mma7455)
MMA7455_YDA = _pyupm_mma7455.MMA7455_YDA

_pyupm_mma7455.MMA7455_ZDA_swigconstant(_pyupm_mma7455)
MMA7455_ZDA = _pyupm_mma7455.MMA7455_ZDA

_pyupm_mma7455.MMA7455_THOPT_swigconstant(_pyupm_mma7455)
MMA7455_THOPT = _pyupm_mma7455.MMA7455_THOPT

_pyupm_mma7455.MMA7455_DFBW_swigconstant(_pyupm_mma7455)
MMA7455_DFBW = _pyupm_mma7455.MMA7455_DFBW

_pyupm_mma7455.MMA7455_LDPL_swigconstant(_pyupm_mma7455)
MMA7455_LDPL = _pyupm_mma7455.MMA7455_LDPL

_pyupm_mma7455.MMA7455_PDPL_swigconstant(_pyupm_mma7455)
MMA7455_PDPL = _pyupm_mma7455.MMA7455_PDPL

_pyupm_mma7455.MMA7455_DRVO_swigconstant(_pyupm_mma7455)
MMA7455_DRVO = _pyupm_mma7455.MMA7455_DRVO

_pyupm_mma7455.MMA7455_CLR_INT1_swigconstant(_pyupm_mma7455)
MMA7455_CLR_INT1 = _pyupm_mma7455.MMA7455_CLR_INT1

_pyupm_mma7455.MMA7455_CLR_INT2_swigconstant(_pyupm_mma7455)
MMA7455_CLR_INT2 = _pyupm_mma7455.MMA7455_CLR_INT2

_pyupm_mma7455.MMA7455_INT1_swigconstant(_pyupm_mma7455)
MMA7455_INT1 = _pyupm_mma7455.MMA7455_INT1

_pyupm_mma7455.MMA7455_INT2_swigconstant(_pyupm_mma7455)
MMA7455_INT2 = _pyupm_mma7455.MMA7455_INT2

_pyupm_mma7455.MMA7455_PDZ_swigconstant(_pyupm_mma7455)
MMA7455_PDZ = _pyupm_mma7455.MMA7455_PDZ

_pyupm_mma7455.MMA7455_PDY_swigconstant(_pyupm_mma7455)
MMA7455_PDY = _pyupm_mma7455.MMA7455_PDY

_pyupm_mma7455.MMA7455_PDX_swigconstant(_pyupm_mma7455)
MMA7455_PDX = _pyupm_mma7455.MMA7455_PDX

_pyupm_mma7455.MMA7455_LDZ_swigconstant(_pyupm_mma7455)
MMA7455_LDZ = _pyupm_mma7455.MMA7455_LDZ

_pyupm_mma7455.MMA7455_LDY_swigconstant(_pyupm_mma7455)
MMA7455_LDY = _pyupm_mma7455.MMA7455_LDY

_pyupm_mma7455.MMA7455_LDX_swigconstant(_pyupm_mma7455)
MMA7455_LDX = _pyupm_mma7455.MMA7455_LDX

_pyupm_mma7455.MMA7455_I2CDIS_swigconstant(_pyupm_mma7455)
MMA7455_I2CDIS = _pyupm_mma7455.MMA7455_I2CDIS

_pyupm_mma7455.HIGH_swigconstant(_pyupm_mma7455)
HIGH = _pyupm_mma7455.HIGH

_pyupm_mma7455.LOW_swigconstant(_pyupm_mma7455)
LOW = _pyupm_mma7455.LOW
[docs]class accelData(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, accelData, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, accelData, name) __repr__ = _swig_repr def __init__(self): this = _pyupm_mma7455.new_accelData() try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_mma7455.delete_accelData __del__ = lambda self: None
accelData_swigregister = _pyupm_mma7455.accelData_swigregister accelData_swigregister(accelData)
[docs]class MMA7455(_object): """ API for the MMA7455 Accelerometer. ID: mma7455 Name: Three Axis +/- 2/4/8 g Digital Accelerometer Category: accelerometer Manufacturer: generic Connection: i2c Link:http://www.nxp.com/products/sensors/accelerometers/3-axis- accelerometers/2g-4g-8g-low-g-digital-accelerometer:MMA745xL This module defines the MMA7455 interface for libmma7455 C++ includes: mma7455.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, MMA7455, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, MMA7455, name) __repr__ = _swig_repr def __init__(self, bus=0, devAddr=0x1D): """ MMA7455(int bus=0, int devAddr=0x1D) Instantiates an MMA7455 object Parameters: ----------- bus: Number of the used bus devAddr: Address of the used I2C device """ this = _pyupm_mma7455.new_MMA7455(bus, devAddr) try: self.this.append(this) except Exception: self.this = this
[docs] def name(self): """ std::string name() Returns the name of the component Name of the component """ return _pyupm_mma7455.MMA7455_name(self)
[docs] def calibrate(self): """ mraa::Result calibrate() Calibrates the sensor 0 (MRAA_SUCCESS) if successful; non-zero otherwise """ return _pyupm_mma7455.MMA7455_calibrate(self)
[docs] def readData(self, *args): """ std::vector< short > readData() Reads X-axis, Y-axis, and Z-axis acceleration data std::vector containing X, Y, Z acceleration data """ return _pyupm_mma7455.MMA7455_readData(self, *args)
[docs] def i2cReadReg(self, reg, buffer, len): """ int i2cReadReg(unsigned char reg, uint8_t *buffer, int len) Internal function for reading I2C data Parameters: ----------- reg: Register address buffer: Register data buffer len: Buffer size """ return _pyupm_mma7455.MMA7455_i2cReadReg(self, reg, buffer, len)
[docs] def i2cWriteReg(self, reg, buffer, len): """ mraa::Result i2cWriteReg(unsigned char reg, uint8_t *buffer, int len) Internal function for writing I2C data Parameters: ----------- reg: Register address buffer: Register data buffer len: Buffer size """ return _pyupm_mma7455.MMA7455_i2cWriteReg(self, reg, buffer, len)
__swig_destroy__ = _pyupm_mma7455.delete_MMA7455 __del__ = lambda self: None
MMA7455_swigregister = _pyupm_mma7455.MMA7455_swigregister MMA7455_swigregister(MMA7455) # This file is compatible with both classic and new-style classes.