Source code for pyupm_bma220

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

def new_floatp():
    return _pyupm_bma220.new_floatp()
new_floatp = _pyupm_bma220.new_floatp

def copy_floatp(value):
    return _pyupm_bma220.copy_floatp(value)
copy_floatp = _pyupm_bma220.copy_floatp

def delete_floatp(obj):
    return _pyupm_bma220.delete_floatp(obj)
delete_floatp = _pyupm_bma220.delete_floatp

def floatp_assign(obj, value):
    return _pyupm_bma220.floatp_assign(obj, value)
floatp_assign = _pyupm_bma220.floatp_assign

def floatp_value(obj):
    return _pyupm_bma220.floatp_value(obj)
floatp_value = _pyupm_bma220.floatp_value

_pyupm_bma220.BMA220_I2C_BUS_swigconstant(_pyupm_bma220)
BMA220_I2C_BUS = _pyupm_bma220.BMA220_I2C_BUS

_pyupm_bma220.BMA220_DEFAULT_ADDR_swigconstant(_pyupm_bma220)
BMA220_DEFAULT_ADDR = _pyupm_bma220.BMA220_DEFAULT_ADDR
[docs]class BMA220(_object): """ API for the BMA220 3-axis Accelerometer. ID: bma220 Name: Digital Triaxial Acceleration Sensor Category: accelerometer Manufacturer: bosch dfrobot Connection: i2c gpio Link:http://www.dfrobot.com/index.php?route=product/product&product_id=1085 The BMA220 is a low cost, very small 3-axis accelerometer with 6 bits of resolution. It can also detect orientation and tap events. The BMA220 has a linear acceleration full scale of 2g/4g/8g/16g. While not all of the functionality of this device is supported initially, methods and register definitions are provided that should allow an end user to implement whatever features are required. This driver was developed on a DFRobot BMA (Tiny). C++ includes: bma220.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, BMA220, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, BMA220, name) __repr__ = _swig_repr REG_CHIPID = _pyupm_bma220.BMA220_REG_CHIPID REG_REVISIONID = _pyupm_bma220.BMA220_REG_REVISIONID REG_ACC_X = _pyupm_bma220.BMA220_REG_ACC_X REG_ACC_Y = _pyupm_bma220.BMA220_REG_ACC_Y REG_ACC_Z = _pyupm_bma220.BMA220_REG_ACC_Z REG_H_HYST_DUR = _pyupm_bma220.BMA220_REG_H_HYST_DUR REG_THRESHOLD = _pyupm_bma220.BMA220_REG_THRESHOLD REG_L_HYST_DUR = _pyupm_bma220.BMA220_REG_L_HYST_DUR REG_TAP_CONFIG = _pyupm_bma220.BMA220_REG_TAP_CONFIG REG_SLOPE_CONFIG = _pyupm_bma220.BMA220_REG_SLOPE_CONFIG REG_TAP_CONFIG2 = _pyupm_bma220.BMA220_REG_TAP_CONFIG2 REG_INT_STATUS1 = _pyupm_bma220.BMA220_REG_INT_STATUS1 REG_INT_STATUS2 = _pyupm_bma220.BMA220_REG_INT_STATUS2 REG_ENABLE_CONFIG = _pyupm_bma220.BMA220_REG_ENABLE_CONFIG REG_ENABLE_CONFIG2 = _pyupm_bma220.BMA220_REG_ENABLE_CONFIG2 REG_ENABLE_CONFIG3 = _pyupm_bma220.BMA220_REG_ENABLE_CONFIG3 REG_FILTER_CONFIG = _pyupm_bma220.BMA220_REG_FILTER_CONFIG REG_SBIST_FSL_CONFIG = _pyupm_bma220.BMA220_REG_SBIST_FSL_CONFIG REG_I2C_WATCHDOG = _pyupm_bma220.BMA220_REG_I2C_WATCHDOG REG_SUSPEND = _pyupm_bma220.BMA220_REG_SUSPEND REG_SOFTRESET = _pyupm_bma220.BMA220_REG_SOFTRESET H_HYST_DUR_HIGH_DUR0 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR0 H_HYST_DUR_HIGH_DUR1 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR1 H_HYST_DUR_HIGH_DUR2 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR2 H_HYST_DUR_HIGH_DUR3 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR3 H_HYST_DUR_HIGH_DUR4 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR4 H_HYST_DUR_HIGH_DUR5 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_DUR5 _H_HYST_DUR_HIGH_DUR_MASK = _pyupm_bma220.BMA220__H_HYST_DUR_HIGH_DUR_MASK _H_HYST_DUR_HIGH_DUR_SHIFT = _pyupm_bma220.BMA220__H_HYST_DUR_HIGH_DUR_SHIFT H_HYST_DUR_HIGH_HY1 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_HY1 H_HYST_DUR_HIGH_HY2 = _pyupm_bma220.BMA220_H_HYST_DUR_HIGH_HY2 _H_HYST_DUR_HIGH_HY_MASK = _pyupm_bma220.BMA220__H_HYST_DUR_HIGH_HY_MASK _H_HYST_DUR_HIGH_HY_SHIFT = _pyupm_bma220.BMA220__H_HYST_DUR_HIGH_HY_SHIFT THRESHOLD_HIGH0 = _pyupm_bma220.BMA220_THRESHOLD_HIGH0 THRESHOLD_HIGH1 = _pyupm_bma220.BMA220_THRESHOLD_HIGH1 THRESHOLD_HIGH2 = _pyupm_bma220.BMA220_THRESHOLD_HIGH2 THRESHOLD_HIGH3 = _pyupm_bma220.BMA220_THRESHOLD_HIGH3 _THRESHOLD_HIGH_MASK = _pyupm_bma220.BMA220__THRESHOLD_HIGH_MASK _THRESHOLD_HIGH_SHIFT = _pyupm_bma220.BMA220__THRESHOLD_HIGH_SHIFT THRESHOLD_LOW0 = _pyupm_bma220.BMA220_THRESHOLD_LOW0 THRESHOLD_LOW1 = _pyupm_bma220.BMA220_THRESHOLD_LOW1 THRESHOLD_LOW2 = _pyupm_bma220.BMA220_THRESHOLD_LOW2 THRESHOLD_LOW3 = _pyupm_bma220.BMA220_THRESHOLD_LOW3 _THRESHOLD_LOW_MASK = _pyupm_bma220.BMA220__THRESHOLD_LOW_MASK _THRESHOLD_LOW_SHIFT = _pyupm_bma220.BMA220__THRESHOLD_LOW_SHIFT L_HYST_DUR_LOW_DUR0 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR0 L_HYST_DUR_LOW_DUR1 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR1 L_HYST_DUR_LOW_DUR2 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR2 L_HYST_DUR_LOW_DUR3 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR3 L_HYST_DUR_LOW_DUR4 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR4 L_HYST_DUR_LOW_DUR5 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_DUR5 _L_HYST_DUR_LOW_DUR_MASK = _pyupm_bma220.BMA220__L_HYST_DUR_LOW_DUR_MASK _L_HYST_DUR_LOW_DUR_SHIFT = _pyupm_bma220.BMA220__L_HYST_DUR_LOW_DUR_SHIFT L_HYST_DUR_LOW_HY1 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_HY1 L_HYST_DUR_LOW_HY2 = _pyupm_bma220.BMA220_L_HYST_DUR_LOW_HY2 _L_HYST_DUR_LOW_HY_MASK = _pyupm_bma220.BMA220__L_HYST_DUR_LOW_HY_MASK _L_HYST_DUR_LOW_HY_SHIFT = _pyupm_bma220.BMA220__L_HYST_DUR_LOW_HY_SHIFT TAP_CONFIG_DUR0 = _pyupm_bma220.BMA220_TAP_CONFIG_DUR0 TAP_CONFIG_DUR1 = _pyupm_bma220.BMA220_TAP_CONFIG_DUR1 TAP_CONFIG_DUR2 = _pyupm_bma220.BMA220_TAP_CONFIG_DUR2 _TAP_CONFIG_DUR_MASK = _pyupm_bma220.BMA220__TAP_CONFIG_DUR_MASK _TAP_CONFIG_DUR_SHIFT = _pyupm_bma220.BMA220__TAP_CONFIG_DUR_SHIFT TAP_CONFIG_THRESH0 = _pyupm_bma220.BMA220_TAP_CONFIG_THRESH0 TAP_CONFIG_THRESH1 = _pyupm_bma220.BMA220_TAP_CONFIG_THRESH1 TAP_CONFIG_THRESH2 = _pyupm_bma220.BMA220_TAP_CONFIG_THRESH2 TAP_CONFIG_THRESH3 = _pyupm_bma220.BMA220_TAP_CONFIG_THRESH3 _TAP_CONFIG_THRESH_MASK = _pyupm_bma220.BMA220__TAP_CONFIG_THRESH_MASK _TAP_CONFIG_THRESH_SHIFT = _pyupm_bma220.BMA220__TAP_CONFIG_THRESH_SHIFT TAP_CONFIG_FILTER = _pyupm_bma220.BMA220_TAP_CONFIG_FILTER SLOPE_CONFIG_DUR0 = _pyupm_bma220.BMA220_SLOPE_CONFIG_DUR0 SLOPE_CONFIG_DUR1 = _pyupm_bma220.BMA220_SLOPE_CONFIG_DUR1 _SLOPE_CONFIG_DUR_MASK = _pyupm_bma220.BMA220__SLOPE_CONFIG_DUR_MASK _SLOPE_CONFIG_DUR_SHIFT = _pyupm_bma220.BMA220__SLOPE_CONFIG_DUR_SHIFT SLOPE_CONFIG_THRESH0 = _pyupm_bma220.BMA220_SLOPE_CONFIG_THRESH0 SLOPE_CONFIG_THRESH1 = _pyupm_bma220.BMA220_SLOPE_CONFIG_THRESH1 SLOPE_CONFIG_THRESH2 = _pyupm_bma220.BMA220_SLOPE_CONFIG_THRESH2 SLOPE_CONFIG_THRESH3 = _pyupm_bma220.BMA220_SLOPE_CONFIG_THRESH3 _SLOPE_CONFIG_THRESH_MASK = _pyupm_bma220.BMA220__SLOPE_CONFIG_THRESH_MASK _SLOPE_CONFIG_THRESH_SHIFT = _pyupm_bma220.BMA220__SLOPE_CONFIG_THRESH_SHIFT SLOPE_CONFIG_FILTER = _pyupm_bma220.BMA220_SLOPE_CONFIG_FILTER SLOPE_CONFIG_ORIENT_EX = _pyupm_bma220.BMA220_SLOPE_CONFIG_ORIENT_EX TAP_CONFIG2_SAMP0 = _pyupm_bma220.BMA220_TAP_CONFIG2_SAMP0 TAP_CONFIG2_SAMP1 = _pyupm_bma220.BMA220_TAP_CONFIG2_SAMP1 _TAP_CONFIG2_SAMP_MASK = _pyupm_bma220.BMA220__TAP_CONFIG2_SAMP_MASK _TAP_CONFIG2_SAMP_SHIFT = _pyupm_bma220.BMA220__TAP_CONFIG2_SAMP_SHIFT TAP_CONFIG2_ORIENT_BLOCK0 = _pyupm_bma220.BMA220_TAP_CONFIG2_ORIENT_BLOCK0 TAP_CONFIG2_ORIENT_BLOCK1 = _pyupm_bma220.BMA220_TAP_CONFIG2_ORIENT_BLOCK1 _TAP_CONFIG2_ORIENT_BLOCK_MASK = _pyupm_bma220.BMA220__TAP_CONFIG2_ORIENT_BLOCK_MASK _TAP_CONFIG2_ORIENT_BLOCK_SHIFT = _pyupm_bma220.BMA220__TAP_CONFIG2_ORIENT_BLOCK_SHIFT TAP_CONFIG2_TIP_EN = _pyupm_bma220.BMA220_TAP_CONFIG2_TIP_EN TAP_SAMP_2 = _pyupm_bma220.BMA220_TAP_SAMP_2 TAP_SAMP_4 = _pyupm_bma220.BMA220_TAP_SAMP_4 TAP_SAMP_8 = _pyupm_bma220.BMA220_TAP_SAMP_8 TAP_SAMP_16 = _pyupm_bma220.BMA220_TAP_SAMP_16 TAP_ORIENT_BLOCK_0 = _pyupm_bma220.BMA220_TAP_ORIENT_BLOCK_0 TAP_ORIENT_BLOCK_2 = _pyupm_bma220.BMA220_TAP_ORIENT_BLOCK_2 TAP_ORIENT_BLOCK_3 = _pyupm_bma220.BMA220_TAP_ORIENT_BLOCK_3 TAP_ORIENT_BLOCK_4 = _pyupm_bma220.BMA220_TAP_ORIENT_BLOCK_4 INT_STATUS1_SIGN = _pyupm_bma220.BMA220_INT_STATUS1_SIGN INT_STATUS1_FIRST_Z = _pyupm_bma220.BMA220_INT_STATUS1_FIRST_Z INT_STATUS1_FIRST_Y = _pyupm_bma220.BMA220_INT_STATUS1_FIRST_Y INT_STATUS1_FIRST_X = _pyupm_bma220.BMA220_INT_STATUS1_FIRST_X INT_STATUS1_ORIENT0 = _pyupm_bma220.BMA220_INT_STATUS1_ORIENT0 INT_STATUS1_ORIENT1 = _pyupm_bma220.BMA220_INT_STATUS1_ORIENT1 INT_STATUS1_ORIENT2 = _pyupm_bma220.BMA220_INT_STATUS1_ORIENT2 _INT_STATUS1_ORIENT_MASK = _pyupm_bma220.BMA220__INT_STATUS1_ORIENT_MASK _INT_STATUS1_ORIENT_SHIFT = _pyupm_bma220.BMA220__INT_STATUS1_ORIENT_SHIFT INT_STATUS1_ORIENT_INT = _pyupm_bma220.BMA220_INT_STATUS1_ORIENT_INT CONFIG_ORI_UP_PORT_UPRIGHT = _pyupm_bma220.BMA220_CONFIG_ORI_UP_PORT_UPRIGHT CONFIG_ORI_UP_PORT_UPSIDE_DOWN = _pyupm_bma220.BMA220_CONFIG_ORI_UP_PORT_UPSIDE_DOWN CONFIG_ORI_UP_LAND_LEFT = _pyupm_bma220.BMA220_CONFIG_ORI_UP_LAND_LEFT CONFIG_ORI_UP_LAND_RIGHT = _pyupm_bma220.BMA220_CONFIG_ORI_UP_LAND_RIGHT CONFIG_ORI_DN_PORT_UPRIGHT = _pyupm_bma220.BMA220_CONFIG_ORI_DN_PORT_UPRIGHT CONFIG_ORI_DN_PORT_UPSIDE_DOWN = _pyupm_bma220.BMA220_CONFIG_ORI_DN_PORT_UPSIDE_DOWN CONFIG_ORI_DN_LAND_LEFT = _pyupm_bma220.BMA220_CONFIG_ORI_DN_LAND_LEFT CONFIG_ORI_DN_LAND_RIGHT = _pyupm_bma220.BMA220_CONFIG_ORI_DN_LAND_RIGHT INT_STATUS2_SLOPE = _pyupm_bma220.BMA220_INT_STATUS2_SLOPE INT_STATUS2_DATA = _pyupm_bma220.BMA220_INT_STATUS2_DATA INT_STATUS2_HIGH = _pyupm_bma220.BMA220_INT_STATUS2_HIGH INT_STATUS2_LOW = _pyupm_bma220.BMA220_INT_STATUS2_LOW INT_STATUS2_TAP = _pyupm_bma220.BMA220_INT_STATUS2_TAP ENABLE_CONFIG_TT_Z = _pyupm_bma220.BMA220_ENABLE_CONFIG_TT_Z ENABLE_CONFIG_TT_Y = _pyupm_bma220.BMA220_ENABLE_CONFIG_TT_Y ENABLE_CONFIG_TT_X = _pyupm_bma220.BMA220_ENABLE_CONFIG_TT_X ENABLE_CONFIG_SLOPE_Z = _pyupm_bma220.BMA220_ENABLE_CONFIG_SLOPE_Z ENABLE_CONFIG_SLOPE_Y = _pyupm_bma220.BMA220_ENABLE_CONFIG_SLOPE_Y ENABLE_CONFIG_SLOPE_X = _pyupm_bma220.BMA220_ENABLE_CONFIG_SLOPE_X ENABLE_CONFIG_ORIENT = _pyupm_bma220.BMA220_ENABLE_CONFIG_ORIENT ENABLE_CONFIG_DATA = _pyupm_bma220.BMA220_ENABLE_CONFIG_DATA ENABLE_CONFIG2_HIGH_Z = _pyupm_bma220.BMA220_ENABLE_CONFIG2_HIGH_Z ENABLE_CONFIG2_HIGH_Y = _pyupm_bma220.BMA220_ENABLE_CONFIG2_HIGH_Y ENABLE_CONFIG2_HIGH_X = _pyupm_bma220.BMA220_ENABLE_CONFIG2_HIGH_X ENABLE_CONFIG2_LOW = _pyupm_bma220.BMA220_ENABLE_CONFIG2_LOW ENABLE_CONFIG2_LAT_INT0 = _pyupm_bma220.BMA220_ENABLE_CONFIG2_LAT_INT0 ENABLE_CONFIG2_LAT_INT1 = _pyupm_bma220.BMA220_ENABLE_CONFIG2_LAT_INT1 ENABLE_CONFIG2_LAT_INT2 = _pyupm_bma220.BMA220_ENABLE_CONFIG2_LAT_INT2 _ENABLE_CONFIG2_LAT_INT_MASK = _pyupm_bma220.BMA220__ENABLE_CONFIG2_LAT_INT_MASK _ENABLE_CONFIG2_LAT_INT_SHIFT = _pyupm_bma220.BMA220__ENABLE_CONFIG2_LAT_INT_SHIFT ENABLE_CONFIG2_RESET_INT = _pyupm_bma220.BMA220_ENABLE_CONFIG2_RESET_INT CONFIG2_LAT_UNLATCH = _pyupm_bma220.BMA220_CONFIG2_LAT_UNLATCH CONFIG2_LAT_0_25 = _pyupm_bma220.BMA220_CONFIG2_LAT_0_25 CONFIG2_LAT_0_5 = _pyupm_bma220.BMA220_CONFIG2_LAT_0_5 CONFIG2_LAT_1 = _pyupm_bma220.BMA220_CONFIG2_LAT_1 CONFIG2_LAT_2 = _pyupm_bma220.BMA220_CONFIG2_LAT_2 CONFIG2_LAT_4 = _pyupm_bma220.BMA220_CONFIG2_LAT_4 CONFIG2_LAT_8 = _pyupm_bma220.BMA220_CONFIG2_LAT_8 CONFIG2_LAT_PERM = _pyupm_bma220.BMA220_CONFIG2_LAT_PERM ENABLE_CONFIG3_Z_CHAN = _pyupm_bma220.BMA220_ENABLE_CONFIG3_Z_CHAN ENABLE_CONFIG3_Y_CHAN = _pyupm_bma220.BMA220_ENABLE_CONFIG3_Y_CHAN ENABLE_CONFIG3_X_CHAN = _pyupm_bma220.BMA220_ENABLE_CONFIG3_X_CHAN ENABLE_CONFIG3_SLEEP_DUR0 = _pyupm_bma220.BMA220_ENABLE_CONFIG3_SLEEP_DUR0 ENABLE_CONFIG3_SLEEP_DUR1 = _pyupm_bma220.BMA220_ENABLE_CONFIG3_SLEEP_DUR1 ENABLE_CONFIG3_SLEEP_DUR2 = _pyupm_bma220.BMA220_ENABLE_CONFIG3_SLEEP_DUR2 _ENABLE_CONFIG3_SLEEP_DUR_MASK = _pyupm_bma220.BMA220__ENABLE_CONFIG3_SLEEP_DUR_MASK _ENABLE_CONFIG3_SLEEP_DUR_SHIFT = _pyupm_bma220.BMA220__ENABLE_CONFIG3_SLEEP_DUR_SHIFT ENABLE_CONFIG3_SLEEP_EN = _pyupm_bma220.BMA220_ENABLE_CONFIG3_SLEEP_EN SLEEP_DUR_2MS = _pyupm_bma220.BMA220_SLEEP_DUR_2MS SLEEP_DUR_10MS = _pyupm_bma220.BMA220_SLEEP_DUR_10MS SLEEP_DUR_25MS = _pyupm_bma220.BMA220_SLEEP_DUR_25MS SLEEP_DUR_50MS = _pyupm_bma220.BMA220_SLEEP_DUR_50MS SLEEP_DUR_100MS = _pyupm_bma220.BMA220_SLEEP_DUR_100MS SLEEP_DUR_500MS = _pyupm_bma220.BMA220_SLEEP_DUR_500MS SLEEP_DUR_1S = _pyupm_bma220.BMA220_SLEEP_DUR_1S SLEEP_DUR_2S = _pyupm_bma220.BMA220_SLEEP_DUR_2S FILTER_CONFIG_FILTER0 = _pyupm_bma220.BMA220_FILTER_CONFIG_FILTER0 FILTER_CONFIG_FILTER1 = _pyupm_bma220.BMA220_FILTER_CONFIG_FILTER1 FILTER_CONFIG_FILTER2 = _pyupm_bma220.BMA220_FILTER_CONFIG_FILTER2 FILTER_CONFIG_FILTER3 = _pyupm_bma220.BMA220_FILTER_CONFIG_FILTER3 _FILTER_CONFIG_FILTER_MASK = _pyupm_bma220.BMA220__FILTER_CONFIG_FILTER_MASK _FILTER_CONFIG_FILTER_SHIFT = _pyupm_bma220.BMA220__FILTER_CONFIG_FILTER_SHIFT FILTER_CONFIG_SERIAL_HIGH_BW = _pyupm_bma220.BMA220_FILTER_CONFIG_SERIAL_HIGH_BW FILTER_CONFIG_1KHZ = _pyupm_bma220.BMA220_FILTER_CONFIG_1KHZ FILTER_CONFIG_500HZ = _pyupm_bma220.BMA220_FILTER_CONFIG_500HZ FILTER_CONFIG_250HZ = _pyupm_bma220.BMA220_FILTER_CONFIG_250HZ FILTER_CONFIG_125HZ = _pyupm_bma220.BMA220_FILTER_CONFIG_125HZ FILTER_CONFIG_64HZ = _pyupm_bma220.BMA220_FILTER_CONFIG_64HZ FILTER_CONFIG_32HZ = _pyupm_bma220.BMA220_FILTER_CONFIG_32HZ REG_SBIST_FSL_RANGE0 = _pyupm_bma220.BMA220_REG_SBIST_FSL_RANGE0 REG_SBIST_FSL_RANGE1 = _pyupm_bma220.BMA220_REG_SBIST_FSL_RANGE1 _REG_SBIST_FSL_RANGE_MASK = _pyupm_bma220.BMA220__REG_SBIST_FSL_RANGE_MASK _REG_SBIST_FSL_RANGE_SHIFT = _pyupm_bma220.BMA220__REG_SBIST_FSL_RANGE_SHIFT REG_SBIST_FSL_SBIST0 = _pyupm_bma220.BMA220_REG_SBIST_FSL_SBIST0 REG_SBIST_FSL_SBIST1 = _pyupm_bma220.BMA220_REG_SBIST_FSL_SBIST1 _REG_SBIST_FSL_SBIST_MASK = _pyupm_bma220.BMA220__REG_SBIST_FSL_SBIST_MASK _REG_SBIST_FSL_SBIST_SHIFT = _pyupm_bma220.BMA220__REG_SBIST_FSL_SBIST_SHIFT REG_SBIST_FSL_SBIST_SIGN = _pyupm_bma220.BMA220_REG_SBIST_FSL_SBIST_SIGN FSL_RANGE_2G = _pyupm_bma220.BMA220_FSL_RANGE_2G FSL_RANGE_4G = _pyupm_bma220.BMA220_FSL_RANGE_4G FSL_RANGE_8G = _pyupm_bma220.BMA220_FSL_RANGE_8G FSL_RANGE_16G = _pyupm_bma220.BMA220_FSL_RANGE_16G SBIST_OFF = _pyupm_bma220.BMA220_SBIST_OFF SBIST_X = _pyupm_bma220.BMA220_SBIST_X SBIST_Y = _pyupm_bma220.BMA220_SBIST_Y SBIST_Z = _pyupm_bma220.BMA220_SBIST_Z I2C_WATCHDOG_SPI3 = _pyupm_bma220.BMA220_I2C_WATCHDOG_SPI3 I2C_WATCHDOG_TO_SEL = _pyupm_bma220.BMA220_I2C_WATCHDOG_TO_SEL I2C_WATCHDOG_TO_EN = _pyupm_bma220.BMA220_I2C_WATCHDOG_TO_EN def __init__(self, bus=0, addr=0x0a): """ BMA220(int bus=BMA220_I2C_BUS, uint8_t addr=BMA220_DEFAULT_ADDR) BMA220 constructor Parameters: ----------- bus: i2c bus to use addr: the address for this device """ this = _pyupm_bma220.new_BMA220(bus, addr) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_bma220.delete_BMA220 __del__ = lambda self: None
[docs] def update(self): """ void update() update the accelerometer values """ return _pyupm_bma220.BMA220_update(self)
[docs] def readReg(self, reg): """ uint8_t readReg(uint8_t reg) read a register Parameters: ----------- reg: the register to read the value of the register """ return _pyupm_bma220.BMA220_readReg(self, reg)
[docs] def writeReg(self, reg, val): """ bool writeReg(uint8_t reg, uint8_t val) write to a register Parameters: ----------- reg: the register to write to val: the value to write true if successful, false otherwise """ return _pyupm_bma220.BMA220_writeReg(self, reg, val)
[docs] def getChipID(self): """ uint8_t getChipID() return the chip ID the chip ID (usually 0xdd) """ return _pyupm_bma220.BMA220_getChipID(self)
[docs] def getChipRevision(self): """ uint8_t getChipRevision() return the chip revision the chip revision (usually 0x00) """ return _pyupm_bma220.BMA220_getChipRevision(self)
[docs] def setAccelerometerScale(self, scale): """ bool setAccelerometerScale(FSL_RANGE_T scale) set the scaling mode of the accelerometer (2g/4g/8g/16g) Parameters: ----------- scale: one of the FSL_RANGE_T values true if successful, false otherwise """ return _pyupm_bma220.BMA220_setAccelerometerScale(self, scale)
[docs] def getAccelerometer(self, *args): """ std::vector< float > getAccelerometer() get the accelerometer values in gravities std::vector containing X, Y, Z acceleration values """ return _pyupm_bma220.BMA220_getAccelerometer(self, *args)
[docs] def setFilterConfig(self, filter): """ bool setFilterConfig(FILTER_CONFIG_T filter) set the filtering configuration Parameters: ----------- filter: one of the FILTER_CONFIG_T values true if successful """ return _pyupm_bma220.BMA220_setFilterConfig(self, filter)
[docs] def setSerialHighBW(self, high): """ bool setSerialHighBW(bool high) enable or disable high bandwidth serial access (1Khz). This essentially disables filtering and makes the raw unfiltered data available in the axis registers. Parameters: ----------- high: true to enable high bw access, false otherwise true if successful """ return _pyupm_bma220.BMA220_setSerialHighBW(self, high)
[docs] def enableAxes(self, xEn, yEn, zEn): """ bool enableAxes(bool xEn, bool yEn, bool zEn) enable or disable axis channels Parameters: ----------- xEn: true to enable the axis, false otherwise yEn: true to enable the axis, false otherwise zEn: true to enable the axis, false otherwise true if successful """ return _pyupm_bma220.BMA220_enableAxes(self, xEn, yEn, zEn)
[docs] def suspend(self): """ uint8_t suspend() place the device into, or take the device out of suspend mode 0x00 if the device was in active mode, 0xff if the device was in suspend mode """ return _pyupm_bma220.BMA220_suspend(self)
[docs] def softReset(self): """ uint8_t softReset() place the device into, or take the device out of soft reset mode 0x00 if the device was in active mode, 0xff if the device was in soft reset mode """ return _pyupm_bma220.BMA220_softReset(self)
[docs] def sleep(self, enable): """ bool sleep(bool enable) place the device into, or take the device out of low power mode. See the datasheet for information on how low power mode is implemented on this device. Parameters: ----------- enable: true to set low power mode, false otherwise true if successful """ return _pyupm_bma220.BMA220_sleep(self, enable)
[docs] def setSleepDuration(self, dur): """ bool setSleepDuration(SLEEP_DUR_T dur) when in low power (sleep) mode, specify how often the device wakes up to acquire samples. Parameters: ----------- dur: one of the SLEEP_DUR_T values true if successful """ return _pyupm_bma220.BMA220_setSleepDuration(self, dur)
[docs] def setLowGThreshold(self, thresh): """ bool setLowGThreshold(uint8_t thresh) specify the threshold for low G detection Parameters: ----------- thresh: see the datasheet true if successful """ return _pyupm_bma220.BMA220_setLowGThreshold(self, thresh)
[docs] def setHighGThreshold(self, thresh): """ bool setHighGThreshold(uint8_t thresh) specify the threshold for high G detection Parameters: ----------- thresh: see the datasheet true if successful """ return _pyupm_bma220.BMA220_setHighGThreshold(self, thresh)
[docs] def setLowGHysteresis(self, hyst): """ bool setLowGHysteresis(uint8_t hyst) specify the hysteresis for low G detection Parameters: ----------- hyst: 2 bit hysteresis value true if successful """ return _pyupm_bma220.BMA220_setLowGHysteresis(self, hyst)
[docs] def setLowGDuration(self, dur): """ bool setLowGDuration(uint8_t dur) specify the sample duration for low G detection Parameters: ----------- dur: the number of samples (depends on bandwidth) true if successful """ return _pyupm_bma220.BMA220_setLowGDuration(self, dur)
[docs] def setHighGHysteresis(self, hyst): """ bool setHighGHysteresis(uint8_t hyst) specify the hysteresis for high G detection Parameters: ----------- hyst: 2 bit hysteresis value true if successful """ return _pyupm_bma220.BMA220_setHighGHysteresis(self, hyst)
[docs] def setHighGDuration(self, dur): """ bool setHighGDuration(uint8_t dur) specify the sample duration for high G detection Parameters: ----------- dur: the number of samples (depends on bandwidth) true if successful """ return _pyupm_bma220.BMA220_setHighGDuration(self, dur)
[docs] def setTapDuration(self, dur): """ bool setTapDuration(uint8_t dur) specify the sample duration for tap detection Parameters: ----------- dur: the number of samples (depends on bandwidth) true if successful """ return _pyupm_bma220.BMA220_setTapDuration(self, dur)
[docs] def setTapThreshold(self, thresh): """ bool setTapThreshold(uint8_t thresh) specify the threshold for tap detection Parameters: ----------- thresh: see the datasheet true if successful """ return _pyupm_bma220.BMA220_setTapThreshold(self, thresh)
[docs] def enableTapFilter(self, filt): """ bool enableTapFilter(bool filt) unable to disable tap filtering Parameters: ----------- filt: true to enable, false otherwise true if successful """ return _pyupm_bma220.BMA220_enableTapFilter(self, filt)
[docs] def setSlopeDuration(self, dur): """ bool setSlopeDuration(uint8_t dur) specify the sample duration for slope detection Parameters: ----------- dur: the number of samples (depends on bandwidth) true if successful """ return _pyupm_bma220.BMA220_setSlopeDuration(self, dur)
[docs] def setSlopeThreshold(self, thresh): """ bool setSlopeThreshold(uint8_t thresh) specify the threshold for slope detection Parameters: ----------- thresh: see the datasheet true if successful """ return _pyupm_bma220.BMA220_setSlopeThreshold(self, thresh)
[docs] def enableSlopeFilter(self, filt): """ bool enableSlopeFilter(bool filt) enable or disable slope filtering Parameters: ----------- filt: true to enable filtering, false otherwise true if successful """ return _pyupm_bma220.BMA220_enableSlopeFilter(self, filt)
[docs] def getInterruptStatus1(self): """ uint8_t getInterruptStatus1() return a bitmask of the interrupt status 1 register bitmask of INT_STATUS1_BITS_T bits (minus the orient value) """ return _pyupm_bma220.BMA220_getInterruptStatus1(self)
[docs] def getOrient(self): """ BMA220::CONFIG_ORIENT_T getOrient() return the orient value from the interrupt status 1 register one of the CONFIG_ORIENT_T values """ return _pyupm_bma220.BMA220_getOrient(self)
[docs] def getInterruptStatus2(self): """ uint8_t getInterruptStatus2() return a bitmask of the interrupt status 2 register bitmask of INT_STATUS2_BITS_T bits """ return _pyupm_bma220.BMA220_getInterruptStatus2(self)
[docs] def setInterruptEnables1(self, bits): """ bool setInterruptEnables1(uint8_t bits) enable interrupts for events in interrupt config register 1 Parameters: ----------- bits: bitmask of ENABLE_CONFIG_BITS_T values true if successful """ return _pyupm_bma220.BMA220_setInterruptEnables1(self, bits)
[docs] def getInterruptEnables1(self): """ uint8_t getInterruptEnables1() return the enabled interrupts for events in interrupt config register 1 bitmask of ENABLE_CONFIG_BITS_T values """ return _pyupm_bma220.BMA220_getInterruptEnables1(self)
[docs] def setInterruptEnables2(self, bits): """ bool setInterruptEnables2(uint8_t bits) enable interrupts for events in interrupt config register 2 Parameters: ----------- bits: bitmask of ENABLE_CONFIG2_BITS_T values true if successful """ return _pyupm_bma220.BMA220_setInterruptEnables2(self, bits)
[docs] def getInterruptEnables2(self): """ uint8_t getInterruptEnables2() return the enabled interrupts for events in interrupt config register 2 bitmask of ENABLE_CONFIG2_BITS_T values """ return _pyupm_bma220.BMA220_getInterruptEnables2(self)
[docs] def setInterruptLatch(self, lat): """ bool setInterruptLatch(CONFIG2_LAT_T lat) configure interrupt latching behavior Parameters: ----------- lat: one of the CONFIG2_LAT_T values true if successful """ return _pyupm_bma220.BMA220_setInterruptLatch(self, lat)
[docs] def resetInterrupts(self): """ bool resetInterrupts() reset the interrupt controller. This should be called after any changes are made to interrupt configuration, or to reset interrupts if latched interrupts have been enabled and an interrupt has occurred.. true if successful """ return _pyupm_bma220.BMA220_resetInterrupts(self)
[docs] def installISR(self, gpio, level, isr, arg): """ void installISR(int gpio, mraa::Edge level, void(*isr)(void *), void *arg) install an interrupt handler. Parameters: ----------- gpio: gpio pin to use as interrupt pin level: the interrupt trigger level (one of mraa::Edge values). Make sure that you have configured the interrupt pin properly for whatever level you choose. isr: the interrupt handler, accepting a void * argument arg: the argument to pass the the interrupt handler """ return _pyupm_bma220.BMA220_installISR(self, gpio, level, isr, arg)
[docs] def uninstallISR(self): """ void uninstallISR() uninstall a previously installed interrupt handler """ return _pyupm_bma220.BMA220_uninstallISR(self)
[docs] def get_gpioIntr(self): """ mraa::Gpio * get_gpioIntr() """ return _pyupm_bma220.BMA220_get_gpioIntr(self)
BMA220_swigregister = _pyupm_bma220.BMA220_swigregister BMA220_swigregister(BMA220) # This file is compatible with both classic and new-style classes.