Source code for pyupm_l3gd20

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

_pyupm_l3gd20.L3GD20_DEFAULT_I2C_BUS_swigconstant(_pyupm_l3gd20)
L3GD20_DEFAULT_I2C_BUS = _pyupm_l3gd20.L3GD20_DEFAULT_I2C_BUS

_pyupm_l3gd20.L3GD20_DEFAULT_I2C_ADDR_swigconstant(_pyupm_l3gd20)
L3GD20_DEFAULT_I2C_ADDR = _pyupm_l3gd20.L3GD20_DEFAULT_I2C_ADDR

_pyupm_l3gd20.L3GD20_DEFAULT_CHIP_ID_swigconstant(_pyupm_l3gd20)
L3GD20_DEFAULT_CHIP_ID = _pyupm_l3gd20.L3GD20_DEFAULT_CHIP_ID

_pyupm_l3gd20.L3GD20H_DEFAULT_CHIP_ID_swigconstant(_pyupm_l3gd20)
L3GD20H_DEFAULT_CHIP_ID = _pyupm_l3gd20.L3GD20H_DEFAULT_CHIP_ID
[docs]class L3GD20(_object): """ L3GD20 Tri-axis Digital Gyroscope API. ID: l3gd20 Name: Tri-axis Digital Gyroscope Category: gyroscope Manufacturer: stmicro Connection: iio i2c Link:http://www.st.com/en/mems-and-sensors/l3gd20.html The L3GD20 The L3GD20 is a low-power three-axis angular rate sensor. This driver supports IIO and I2C modes. Some methods will only work in one mode or the other. See the documentation on the methods to determine whether a given method is operation in a given mode. Both the I2C and IIO mechanisms make use of the calibration and denoise algorithms. For I2C mode, not all capabilities of the device are supported, but a complete register map and low level read/write methods are provided to add any missing functionality. Example using IIOExample using I2C C++ includes: l3gd20.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, L3GD20, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, L3GD20, name) __repr__ = _swig_repr REG_WHO_AM_I = _pyupm_l3gd20.L3GD20_REG_WHO_AM_I REG_CTRL_REG1 = _pyupm_l3gd20.L3GD20_REG_CTRL_REG1 REG_CTRL_REG2 = _pyupm_l3gd20.L3GD20_REG_CTRL_REG2 REG_CTRL_REG3 = _pyupm_l3gd20.L3GD20_REG_CTRL_REG3 REG_CTRL_REG4 = _pyupm_l3gd20.L3GD20_REG_CTRL_REG4 REG_CTRL_REG5 = _pyupm_l3gd20.L3GD20_REG_CTRL_REG5 REG_REFERENCE = _pyupm_l3gd20.L3GD20_REG_REFERENCE REG_OUT_TEMPERATURE = _pyupm_l3gd20.L3GD20_REG_OUT_TEMPERATURE REG_STATUS_REG = _pyupm_l3gd20.L3GD20_REG_STATUS_REG REG_OUT_X_L = _pyupm_l3gd20.L3GD20_REG_OUT_X_L REG_OUT_X_H = _pyupm_l3gd20.L3GD20_REG_OUT_X_H REG_OUT_Y_L = _pyupm_l3gd20.L3GD20_REG_OUT_Y_L REG_OUT_Y_H = _pyupm_l3gd20.L3GD20_REG_OUT_Y_H REG_OUT_Z_L = _pyupm_l3gd20.L3GD20_REG_OUT_Z_L REG_OUT_Z_H = _pyupm_l3gd20.L3GD20_REG_OUT_Z_H REG_FIFO_CTRL_REG = _pyupm_l3gd20.L3GD20_REG_FIFO_CTRL_REG REG_FIFO_SRC_REG = _pyupm_l3gd20.L3GD20_REG_FIFO_SRC_REG REG_INT1_CFG = _pyupm_l3gd20.L3GD20_REG_INT1_CFG REG_INT1_SRC = _pyupm_l3gd20.L3GD20_REG_INT1_SRC REG_INT1_TSH_XH = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_XH REG_INT1_TSH_XL = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_XL REG_INT1_TSH_YH = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_YH REG_INT1_TSH_YL = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_YL REG_INT1_TSH_ZH = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_ZH REG_INT1_TSH_ZL = _pyupm_l3gd20.L3GD20_REG_INT1_TSH_ZL REG_INT1_DURATION = _pyupm_l3gd20.L3GD20_REG_INT1_DURATION CTRL_REG1_YEN = _pyupm_l3gd20.L3GD20_CTRL_REG1_YEN CTRL_REG1_XEN = _pyupm_l3gd20.L3GD20_CTRL_REG1_XEN CTRL_REG1_ZEN = _pyupm_l3gd20.L3GD20_CTRL_REG1_ZEN CTRL_REG1_PD = _pyupm_l3gd20.L3GD20_CTRL_REG1_PD CTRL_REG1_BW0 = _pyupm_l3gd20.L3GD20_CTRL_REG1_BW0 CTRL_REG1_BW1 = _pyupm_l3gd20.L3GD20_CTRL_REG1_BW1 _CTRL_REG1_BW_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG1_BW_MASK _CTRL_REG1_BW_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG1_BW_SHIFT CTRL_REG1_DR0 = _pyupm_l3gd20.L3GD20_CTRL_REG1_DR0 CTRL_REG1_DR1 = _pyupm_l3gd20.L3GD20_CTRL_REG1_DR1 _CTRL_REG1_DR_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG1_DR_MASK _CTRL_REG1_DR_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG1_DR_SHIFT _CTRL_REG1_ODR_CUTOFF0 = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF0 _CTRL_REG1_ODR_CUTOFF1 = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF1 _CTRL_REG1_ODR_CUTOFF2 = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF2 _CTRL_REG1_ODR_CUTOFF3 = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF3 _CTRL_REG1_ODR_CUTOFF_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF_MASK _CTRL_REG1_ODR_CUTOFF_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG1_ODR_CUTOFF_SHIFT ODR_CUTOFF_95_12_5 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_95_12_5 ODR_CUTOFF_95_25 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_95_25 ODR_CUTOFF_190_12_5 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_190_12_5 ODR_CUTOFF_190_25 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_190_25 ODR_CUTOFF_190_50 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_190_50 ODR_CUTOFF_190_70 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_190_70 ODR_CUTOFF_380_20 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_380_20 ODR_CUTOFF_380_25 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_380_25 ODR_CUTOFF_380_50 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_380_50 ODR_CUTOFF_380_100 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_380_100 ODR_CUTOFF_760_30 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_760_30 ODR_CUTOFF_760_35 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_760_35 ODR_CUTOFF_760_50 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_760_50 ODR_CUTOFF_760_100 = _pyupm_l3gd20.L3GD20_ODR_CUTOFF_760_100 POWER_DOWN = _pyupm_l3gd20.L3GD20_POWER_DOWN POWER_SLEEP = _pyupm_l3gd20.L3GD20_POWER_SLEEP POWER_NORMAL = _pyupm_l3gd20.L3GD20_POWER_NORMAL _CTRL_REG2_RESERVED_BITS = _pyupm_l3gd20.L3GD20__CTRL_REG2_RESERVED_BITS CTRL_REG2_HPCF0 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPCF0 CTRL_REG2_HPCF1 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPCF1 CTRL_REG2_HPCF2 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPCF2 CTRL_REG2_HPCF3 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPCF3 _CTRL_REG2_HPCF_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG2_HPCF_MASK _CTRL_REG2_HPCF_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG2_HPCF_SHIFT CTRL_REG2_HPM0 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPM0 CTRL_REG2_HPM1 = _pyupm_l3gd20.L3GD20_CTRL_REG2_HPM1 _CTRL_REG2_HPM_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG2_HPM_MASK _CTRL_REG2_HPM_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG2_HPM_SHIFT HPCF_7_2 = _pyupm_l3gd20.L3GD20_HPCF_7_2 HPCF_3_5 = _pyupm_l3gd20.L3GD20_HPCF_3_5 HPCF_1_8 = _pyupm_l3gd20.L3GD20_HPCF_1_8 HPCF_0_9 = _pyupm_l3gd20.L3GD20_HPCF_0_9 HPCF_0_45 = _pyupm_l3gd20.L3GD20_HPCF_0_45 HPCF_0_18 = _pyupm_l3gd20.L3GD20_HPCF_0_18 HPCF_0_09 = _pyupm_l3gd20.L3GD20_HPCF_0_09 HPCF_0_045 = _pyupm_l3gd20.L3GD20_HPCF_0_045 HPCF_0_018 = _pyupm_l3gd20.L3GD20_HPCF_0_018 HPCF_0_009 = _pyupm_l3gd20.L3GD20_HPCF_0_009 HPM_NORMAL_RESET_FILTER = _pyupm_l3gd20.L3GD20_HPM_NORMAL_RESET_FILTER HPM_REFERENCE_SIGNAL = _pyupm_l3gd20.L3GD20_HPM_REFERENCE_SIGNAL HPM_NORMAL = _pyupm_l3gd20.L3GD20_HPM_NORMAL HPM_AUTORESET_ON_INT = _pyupm_l3gd20.L3GD20_HPM_AUTORESET_ON_INT CTRL_REG3_I2_EMPTY = _pyupm_l3gd20.L3GD20_CTRL_REG3_I2_EMPTY CTRL_REG3_I2_ORUN = _pyupm_l3gd20.L3GD20_CTRL_REG3_I2_ORUN CTRL_REG3_I2_WTM = _pyupm_l3gd20.L3GD20_CTRL_REG3_I2_WTM CTRL_REG3_I2_DRDY = _pyupm_l3gd20.L3GD20_CTRL_REG3_I2_DRDY CTRL_REG3_PP_OD = _pyupm_l3gd20.L3GD20_CTRL_REG3_PP_OD CTRL_REG3_H_LACTIVE = _pyupm_l3gd20.L3GD20_CTRL_REG3_H_LACTIVE CTRL_REG3_I1_BOOT = _pyupm_l3gd20.L3GD20_CTRL_REG3_I1_BOOT CTRL_REG3_I1_INT1 = _pyupm_l3gd20.L3GD20_CTRL_REG3_I1_INT1 _CTRL_REG4_RESERVED_BITS = _pyupm_l3gd20.L3GD20__CTRL_REG4_RESERVED_BITS CTRL_REG4_SIM = _pyupm_l3gd20.L3GD20_CTRL_REG4_SIM CTRL_REG4_FS0 = _pyupm_l3gd20.L3GD20_CTRL_REG4_FS0 CTRL_REG4_FS1 = _pyupm_l3gd20.L3GD20_CTRL_REG4_FS1 _CTRL_REG4_FS_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG4_FS_MASK _CTRL_REG4_FS_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG4_FS_SHIFT CTRL_REG4_BLE = _pyupm_l3gd20.L3GD20_CTRL_REG4_BLE CTRL_REG4_BDU = _pyupm_l3gd20.L3GD20_CTRL_REG4_BDU FS_250 = _pyupm_l3gd20.L3GD20_FS_250 FS_500 = _pyupm_l3gd20.L3GD20_FS_500 FS_2000 = _pyupm_l3gd20.L3GD20_FS_2000 _CTRL_REG5_RESERVED_BITS = _pyupm_l3gd20.L3GD20__CTRL_REG5_RESERVED_BITS CTRL_REG5_OUT_SEL0 = _pyupm_l3gd20.L3GD20_CTRL_REG5_OUT_SEL0 CTRL_REG5_OUT_SEL1 = _pyupm_l3gd20.L3GD20_CTRL_REG5_OUT_SEL1 _CTRL_REG5_OUT_SEL_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG5_OUT_SEL_MASK _CTRL_REG5_OUT_SEL_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG5_OUT_SEL_SHIFT CTRL_REG5_INT1_SEL0 = _pyupm_l3gd20.L3GD20_CTRL_REG5_INT1_SEL0 CTRL_REG5_INT1_SEL1 = _pyupm_l3gd20.L3GD20_CTRL_REG5_INT1_SEL1 _CTRL_REG5_INT1_SEL_MASK = _pyupm_l3gd20.L3GD20__CTRL_REG5_INT1_SEL_MASK _CTRL_REG5_INT1_SEL_SHIFT = _pyupm_l3gd20.L3GD20__CTRL_REG5_INT1_SEL_SHIFT CTRL_REG5_HPEN = _pyupm_l3gd20.L3GD20_CTRL_REG5_HPEN CTRL_REG5_FIFO_EN = _pyupm_l3gd20.L3GD20_CTRL_REG5_FIFO_EN CTRL_REG5_BOOT = _pyupm_l3gd20.L3GD20_CTRL_REG5_BOOT STATUS_REG_XDA = _pyupm_l3gd20.L3GD20_STATUS_REG_XDA STATUS_REG_YDA = _pyupm_l3gd20.L3GD20_STATUS_REG_YDA STATUS_REG_ZDA = _pyupm_l3gd20.L3GD20_STATUS_REG_ZDA STATUS_REG_ZYXDA = _pyupm_l3gd20.L3GD20_STATUS_REG_ZYXDA STATUS_REG_XOR = _pyupm_l3gd20.L3GD20_STATUS_REG_XOR STATUS_REG_YOR = _pyupm_l3gd20.L3GD20_STATUS_REG_YOR STATUS_REG_ZOR = _pyupm_l3gd20.L3GD20_STATUS_REG_ZOR STATUS_REG_ZYXOR = _pyupm_l3gd20.L3GD20_STATUS_REG_ZYXOR FIFO_CTRL_REG_WTM0 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_WTM0 FIFO_CTRL_REG_WTM1 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_WTM1 FIFO_CTRL_REG_WTM2 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_WTM2 FIFO_CTRL_REG_WTM3 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_WTM3 FIFO_CTRL_REG_WTM4 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_WTM4 _FIFO_CTRL_REG_WTM_MASK = _pyupm_l3gd20.L3GD20__FIFO_CTRL_REG_WTM_MASK _FIFO_CTRL_REG_WTM_SHIFT = _pyupm_l3gd20.L3GD20__FIFO_CTRL_REG_WTM_SHIFT FIFO_CTRL_REG_FM0 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_FM0 FIFO_CTRL_REG_FM1 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_FM1 FIFO_CTRL_REG_FM2 = _pyupm_l3gd20.L3GD20_FIFO_CTRL_REG_FM2 _FIFO_CTRL_REG_FM_MASK = _pyupm_l3gd20.L3GD20__FIFO_CTRL_REG_FM_MASK _FIFO_CTRL_REG_FM_SHIFT = _pyupm_l3gd20.L3GD20__FIFO_CTRL_REG_FM_SHIFT FIFO_MODE_BYPASS = _pyupm_l3gd20.L3GD20_FIFO_MODE_BYPASS FIFO_MODE_FIFO = _pyupm_l3gd20.L3GD20_FIFO_MODE_FIFO FIFO_MODE_STREAM = _pyupm_l3gd20.L3GD20_FIFO_MODE_STREAM FIFO_MODE_STREAM_TO_FIFO = _pyupm_l3gd20.L3GD20_FIFO_MODE_STREAM_TO_FIFO FIFO_MODE_BYPASS_TO_STREAM = _pyupm_l3gd20.L3GD20_FIFO_MODE_BYPASS_TO_STREAM FIFO_SRC_REG_FSS0 = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_FSS0 FIFO_SRC_REG_FSS1 = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_FSS1 FIFO_SRC_REG_FSS2 = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_FSS2 FIFO_SRC_REG_FSS3 = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_FSS3 FIFO_SRC_REG_FSS4 = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_FSS4 _FIFO_SRC_REG_FSS_MASK = _pyupm_l3gd20.L3GD20__FIFO_SRC_REG_FSS_MASK _FIFO_SRC_REG_FSS_SHIFT = _pyupm_l3gd20.L3GD20__FIFO_SRC_REG_FSS_SHIFT FIFO_SRC_REG_EMPTY = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_EMPTY FIFO_SRC_REG_OVRN = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_OVRN FIFO_SRC_REG_WTM = _pyupm_l3gd20.L3GD20_FIFO_SRC_REG_WTM INT1_CFG_XLIE = _pyupm_l3gd20.L3GD20_INT1_CFG_XLIE INT1_CFG_XHIE = _pyupm_l3gd20.L3GD20_INT1_CFG_XHIE INT1_CFG_YLIE = _pyupm_l3gd20.L3GD20_INT1_CFG_YLIE INT1_CFG_YHIE = _pyupm_l3gd20.L3GD20_INT1_CFG_YHIE INT1_CFG_ZLIE = _pyupm_l3gd20.L3GD20_INT1_CFG_ZLIE INT1_CFG_ZHIE = _pyupm_l3gd20.L3GD20_INT1_CFG_ZHIE INT1_CFG_LIR = _pyupm_l3gd20.L3GD20_INT1_CFG_LIR INT1_CFG_AND_OR = _pyupm_l3gd20.L3GD20_INT1_CFG_AND_OR _INT1_SRC_RESERVED_BITS = _pyupm_l3gd20.L3GD20__INT1_SRC_RESERVED_BITS INT1_SRC_XL = _pyupm_l3gd20.L3GD20_INT1_SRC_XL INT1_SRC_XH = _pyupm_l3gd20.L3GD20_INT1_SRC_XH INT1_SRC_YL = _pyupm_l3gd20.L3GD20_INT1_SRC_YL INT1_SRC_YH = _pyupm_l3gd20.L3GD20_INT1_SRC_YH INT1_SRC_ZL = _pyupm_l3gd20.L3GD20_INT1_SRC_ZL INT1_SRC_ZH = _pyupm_l3gd20.L3GD20_INT1_SRC_ZH INT1_SRC_IA = _pyupm_l3gd20.L3GD20_INT1_SRC_IA INT1_DURATION_D0 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D0 INT1_DURATION_D1 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D1 INT1_DURATION_D2 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D2 INT1_DURATION_D3 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D3 INT1_DURATION_D4 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D4 INT1_DURATION_D5 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D5 INT1_DURATION_D6 = _pyupm_l3gd20.L3GD20_INT1_DURATION_D6 INT1_DURATION_WAIT = _pyupm_l3gd20.L3GD20_INT1_DURATION_WAIT def __init__(self, *args): """ L3GD20(int bus, int addr) L3GD20 Tri-axis Digital Gyroscope Contructor for I2C operation Parameters: ----------- bus: i2c bus addr: I2C address """ this = _pyupm_l3gd20.new_L3GD20(*args) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_l3gd20.delete_L3GD20 __del__ = lambda self: None
[docs] def getChipID(self): """ uint8_t getChipID() Return the chip ID. I2C only. The chip ID (L3GD20_DEFAULT_CHIP_ID). """ return _pyupm_l3gd20.L3GD20_getChipID(self)
[docs] def getGyroscope(self, x, y, z): """ void getGyroscope(float *x, float *y, float *z) Return gyroscope data in radians per second. update() must have been called prior to calling this method. I2C only. Parameters: ----------- x: Pointer to a floating point value that will have the current x component placed into it. y: Pointer to a floating point value that will have the current y component placed into it. z: Pointer to a floating point value that will have the current z component placed into it. """ return _pyupm_l3gd20.L3GD20_getGyroscope(self, x, y, z)
[docs] def setPowerMode(self, mode): """ void setPowerMode(POWER_MODES_T mode) Set the power mode of the device. I2C only. Parameters: ----------- mode: One of the POWER_MODES_T values. """ return _pyupm_l3gd20.L3GD20_setPowerMode(self, mode)
[docs] def setRange(self, range): """ void setRange(FS_T range) Set the gyroscope detection scaling range. This device supports 250, 500 and 2000 degree/s ranges. I2C only. Parameters: ----------- range: One of the FS_T values. """ return _pyupm_l3gd20.L3GD20_setRange(self, range)
[docs] def update(self): """ void update() Update the internal stored values from sensor data. This method must be called before querying any data ( getTemperature() and getGyroscope()). I2C only. """ return _pyupm_l3gd20.L3GD20_update(self)
[docs] def getTemperature(self, fahrenheit=False): """ float getTemperature(bool fahrenheit=false) Return the current measured temperature. Note, this is not ambient temperature. update() must have been called prior to calling this method. I2C only. Parameters: ----------- fahrenheit: true to return data in Fahrenheit, false for Celicus. Celsius is the default. The temperature in degrees Celsius or Fahrenheit. """ return _pyupm_l3gd20.L3GD20_getTemperature(self, fahrenheit)
[docs] def setODR(self, odr): """ void setODR(ODR_CUTOFF_T odr) Set the output data rate and cut off frequency of the device. I2C only. Parameters: ----------- odr: One of the ODR_CUTOFF_T values. """ return _pyupm_l3gd20.L3GD20_setODR(self, odr)
[docs] def enableBDU(self, enable): """ void enableBDU(bool enable) Enable or disable Block Data Update. When enabled, this ensures that LSB's or MSB's of a given axis are not being updated while the other is being read. This is enabled by default. I2C only. Parameters: ----------- enable: true to enable, false to disable """ return _pyupm_l3gd20.L3GD20_enableBDU(self, enable)
[docs] def getStatusBits(self): """ uint8_t getStatusBits() Return the bitfields of the Status register. This register provides information on the status of data gathering. I2C only. The contents of the REG_STATUS_REG register. """ return _pyupm_l3gd20.L3GD20_getStatusBits(self)
[docs] def installISR(self, isr, arg): """ void installISR(void(*isr)(char *, void *), void *arg) Installs an interrupt service routine (ISR) to be called when an interrupt occurs. IIO only. Parameters: ----------- isr: Pointer to a function to be called on interrupt arg: Pointer to an object to be supplied as an argument to the ISR. """ return _pyupm_l3gd20.L3GD20_installISR(self, isr, arg)
[docs] def getChannelValue(self, input, chan): """ int64_t getChannelValue(unsigned char *input, mraa_iio_channel *chan) Extract the channel value based on channel type. IIO only. Parameters: ----------- input: Channel data chan: MRAA iio-layer channel info """ return _pyupm_l3gd20.L3GD20_getChannelValue(self, input, chan)
[docs] def enableBuffer(self, length): """ bool enableBuffer(int length) Enable trigger buffer. IIO only. Parameters: ----------- length: buffer length in integer """ return _pyupm_l3gd20.L3GD20_enableBuffer(self, length)
[docs] def disableBuffer(self): """ bool disableBuffer() Disable trigger buffer. IIO only. """ return _pyupm_l3gd20.L3GD20_disableBuffer(self)
[docs] def setScale(self, scale): """ bool setScale(const float scale) Set scale. IIO only. For I2C operation, use setRange() with the appropriate FS_T value. Parameters: ----------- scale: in float Available scales are 0.000153(250dps), 0.000305(500dps), and 0.001222(2000dps) Default scale is 0.000153 """ return _pyupm_l3gd20.L3GD20_setScale(self, scale)
[docs] def setSamplingFrequency(self, sampling_frequency): """ bool setSamplingFrequency(const float sampling_frequency) Set sampling frequency. IIO only. For I2C operation, use the setODR() method with the appropriate ODR_CUTOFF_T value. Parameters: ----------- sampling_frequency: sampling frequency in float Available sampling frequency are 95, 190, 380, and 760 Default sampling frequency is 95 """ return _pyupm_l3gd20.L3GD20_setSamplingFrequency(self, sampling_frequency)
[docs] def enable3AxisChannel(self): """ bool enable3AxisChannel() Enable 3 axis scan element. IIO only. """ return _pyupm_l3gd20.L3GD20_enable3AxisChannel(self)
[docs] def extract3Axis(self, data, x, y, z): """ bool extract3Axis(char *data, float *x, float *y, float *z) Process enabled channel buffer and return x, y, z axis. IIO only. Parameters: ----------- data: Enabled channel data, 6 bytes, each axis 2 bytes x: X-Axis y: Y-Axis z: Z-Axis """ return _pyupm_l3gd20.L3GD20_extract3Axis(self, data, x, y, z)
[docs] def initCalibrate(self): """ void initCalibrate() Reset calibration data and start collect calibration data again """ return _pyupm_l3gd20.L3GD20_initCalibrate(self)
[docs] def getCalibratedStatus(self): """ bool getCalibratedStatus() Get calibrated status, return true if calibrate successfully """ return _pyupm_l3gd20.L3GD20_getCalibratedStatus(self)
[docs] def getCalibratedData(self, bias_x, bias_y, bias_z): """ void getCalibratedData(float *bias_x, float *bias_y, float *bias_z) Get calibrated data """ return _pyupm_l3gd20.L3GD20_getCalibratedData(self, bias_x, bias_y, bias_z)
[docs] def loadCalibratedData(self, bias_x, bias_y, bias_z): """ void loadCalibratedData(float bias_x, float bias_y, float bias_z) Load calibrated data """ return _pyupm_l3gd20.L3GD20_loadCalibratedData(self, bias_x, bias_y, bias_z)
[docs] def readReg(self, reg): """ uint8_t readReg(uint8_t reg) Read a register. I2C mode only. Parameters: ----------- reg: The register to read. The value of the register. """ return _pyupm_l3gd20.L3GD20_readReg(self, reg)
[docs] def readRegs(self, reg, buffer, len): """ int readRegs(uint8_t reg, uint8_t *buffer, int len) Read contiguous registers into a buffer. I2C mode only. Parameters: ----------- buffer: The buffer to store the results. len: The number of registers to read. The number of bytes read. """ return _pyupm_l3gd20.L3GD20_readRegs(self, reg, buffer, len)
[docs] def writeReg(self, reg, val): """ void writeReg(uint8_t reg, uint8_t val) Write to a register. I2C mode only. Parameters: ----------- reg: The register to write to. val: The value to write. """ return _pyupm_l3gd20.L3GD20_writeReg(self, reg, val)
[docs] def gyroCollect(self, x, y, z): """ bool gyroCollect(float x, float y, float z) Calibrate gyro Parameters: ----------- x: X-Axis y: Y-Axis z: Z-Axis """ return _pyupm_l3gd20.L3GD20_gyroCollect(self, x, y, z)
[docs] def gyroDenoiseMedian(self, x, y, z): """ void gyroDenoiseMedian(float *x, float *y, float *z) Denoise gyro Parameters: ----------- x: X-Axis y: Y-Axis z: Z-Axis """ return _pyupm_l3gd20.L3GD20_gyroDenoiseMedian(self, x, y, z)
[docs] def median(self, queue, size): """ float median(float *queue, unsigned int size) median algorithm Parameters: ----------- queue: size: """ return _pyupm_l3gd20.L3GD20_median(self, queue, size)
[docs] def partition(self, list, left, right, pivot_index): """ unsigned int partition(float *list, unsigned int left, unsigned int right, unsigned int pivot_index) partition algorithm Parameters: ----------- list: left: right: pivot_index: """ return _pyupm_l3gd20.L3GD20_partition(self, list, left, right, pivot_index)
[docs] def clampGyroReadingsToZero(self, x, y, z): """ void clampGyroReadingsToZero(float *x, float *y, float *z) Clamp Gyro Readings to Zero Parameters: ----------- x: X-Axis y: Y-Axis z: Z-Axis """ return _pyupm_l3gd20.L3GD20_clampGyroReadingsToZero(self, x, y, z)
L3GD20_swigregister = _pyupm_l3gd20.L3GD20_swigregister L3GD20_swigregister(L3GD20) # This file is compatible with both classic and new-style classes.