# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# 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 as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pyupm_kx122
else:
    import _pyupm_kx122

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

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


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def getVersion():
    return _pyupm_kx122.getVersion()
class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pyupm_kx122.delete_SwigPyIterator

    def value(self):
        return _pyupm_kx122.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _pyupm_kx122.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _pyupm_kx122.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _pyupm_kx122.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _pyupm_kx122.SwigPyIterator_equal(self, x)

    def copy(self):
        return _pyupm_kx122.SwigPyIterator_copy(self)

    def next(self):
        return _pyupm_kx122.SwigPyIterator_next(self)

    def __next__(self):
        return _pyupm_kx122.SwigPyIterator___next__(self)

    def previous(self):
        return _pyupm_kx122.SwigPyIterator_previous(self)

    def advance(self, n):
        return _pyupm_kx122.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _pyupm_kx122.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _pyupm_kx122.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _pyupm_kx122.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _pyupm_kx122.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _pyupm_kx122.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _pyupm_kx122.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _pyupm_kx122:
_pyupm_kx122.SwigPyIterator_swigregister(SwigPyIterator)

class floatVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _pyupm_kx122.floatVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _pyupm_kx122.floatVector___nonzero__(self)

    def __bool__(self):
        return _pyupm_kx122.floatVector___bool__(self)

    def __len__(self):
        return _pyupm_kx122.floatVector___len__(self)

    def __getslice__(self, i, j):
        return _pyupm_kx122.floatVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _pyupm_kx122.floatVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _pyupm_kx122.floatVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _pyupm_kx122.floatVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _pyupm_kx122.floatVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _pyupm_kx122.floatVector___setitem__(self, *args)

    def pop(self):
        return _pyupm_kx122.floatVector_pop(self)

    def append(self, x):
        return _pyupm_kx122.floatVector_append(self, x)

    def empty(self):
        return _pyupm_kx122.floatVector_empty(self)

    def size(self):
        return _pyupm_kx122.floatVector_size(self)

    def swap(self, v):
        return _pyupm_kx122.floatVector_swap(self, v)

    def begin(self):
        return _pyupm_kx122.floatVector_begin(self)

    def end(self):
        return _pyupm_kx122.floatVector_end(self)

    def rbegin(self):
        return _pyupm_kx122.floatVector_rbegin(self)

    def rend(self):
        return _pyupm_kx122.floatVector_rend(self)

    def clear(self):
        return _pyupm_kx122.floatVector_clear(self)

    def get_allocator(self):
        return _pyupm_kx122.floatVector_get_allocator(self)

    def pop_back(self):
        return _pyupm_kx122.floatVector_pop_back(self)

    def erase(self, *args):
        return _pyupm_kx122.floatVector_erase(self, *args)

    def __init__(self, *args):
        _pyupm_kx122.floatVector_swiginit(self, _pyupm_kx122.new_floatVector(*args))

    def push_back(self, x):
        return _pyupm_kx122.floatVector_push_back(self, x)

    def front(self):
        return _pyupm_kx122.floatVector_front(self)

    def back(self):
        return _pyupm_kx122.floatVector_back(self)

    def assign(self, n, x):
        return _pyupm_kx122.floatVector_assign(self, n, x)

    def resize(self, *args):
        return _pyupm_kx122.floatVector_resize(self, *args)

    def insert(self, *args):
        return _pyupm_kx122.floatVector_insert(self, *args)

    def reserve(self, n):
        return _pyupm_kx122.floatVector_reserve(self, n)

    def capacity(self):
        return _pyupm_kx122.floatVector_capacity(self)
    __swig_destroy__ = _pyupm_kx122.delete_floatVector

# Register floatVector in _pyupm_kx122:
_pyupm_kx122.floatVector_swigregister(floatVector)

DEFAULT_SPI_FREQUENCY = _pyupm_kx122.DEFAULT_SPI_FREQUENCY
KX122_DEFAULT_SLAVE_ADDR_1 = _pyupm_kx122.KX122_DEFAULT_SLAVE_ADDR_1
KX122_DEFAULT_SLAVE_ADDR_2 = _pyupm_kx122.KX122_DEFAULT_SLAVE_ADDR_2
MICRO_S = _pyupm_kx122.MICRO_S
KX122_ODR_12P5 = _pyupm_kx122.KX122_ODR_12P5
KX122_ODR_25 = _pyupm_kx122.KX122_ODR_25
KX122_ODR_50 = _pyupm_kx122.KX122_ODR_50
KX122_ODR_100 = _pyupm_kx122.KX122_ODR_100
KX122_ODR_200 = _pyupm_kx122.KX122_ODR_200
KX122_ODR_400 = _pyupm_kx122.KX122_ODR_400
KX122_ODR_800 = _pyupm_kx122.KX122_ODR_800
KX122_ODR_1600 = _pyupm_kx122.KX122_ODR_1600
KX122_ODR_0P781 = _pyupm_kx122.KX122_ODR_0P781
KX122_ODR_1P563 = _pyupm_kx122.KX122_ODR_1P563
KX122_ODR_3P125 = _pyupm_kx122.KX122_ODR_3P125
KX122_ODR_6P25 = _pyupm_kx122.KX122_ODR_6P25
KX122_ODR_3200 = _pyupm_kx122.KX122_ODR_3200
KX122_ODR_6400 = _pyupm_kx122.KX122_ODR_6400
KX122_ODR_12800 = _pyupm_kx122.KX122_ODR_12800
KX122_ODR_25600 = _pyupm_kx122.KX122_ODR_25600
KX122_NO_AVG = _pyupm_kx122.KX122_NO_AVG
KX122_2_SAMPLE_AVG = _pyupm_kx122.KX122_2_SAMPLE_AVG
KX122_4_SAMPLE_AVG = _pyupm_kx122.KX122_4_SAMPLE_AVG
KX122_8_SAMPLE_AVG = _pyupm_kx122.KX122_8_SAMPLE_AVG
KX122_16_SAMPLE_AVG = _pyupm_kx122.KX122_16_SAMPLE_AVG
KX122_32_SAMPLE_AVG = _pyupm_kx122.KX122_32_SAMPLE_AVG
KX122_64_SAMPLE_AVG = _pyupm_kx122.KX122_64_SAMPLE_AVG
KX122_128_SAMPLE_AVG = _pyupm_kx122.KX122_128_SAMPLE_AVG
KX122_RANGE_2G = _pyupm_kx122.KX122_RANGE_2G
KX122_RANGE_4G = _pyupm_kx122.KX122_RANGE_4G
KX122_RANGE_8G = _pyupm_kx122.KX122_RANGE_8G
KX122_FIFO_MODE = _pyupm_kx122.KX122_FIFO_MODE
KX122_FILO_MODE = _pyupm_kx122.KX122_FILO_MODE
KX122_STREAM_MODE = _pyupm_kx122.KX122_STREAM_MODE
KX122_BUF_FULL_INT = _pyupm_kx122.KX122_BUF_FULL_INT
KX122_WATERMARK_INT = _pyupm_kx122.KX122_WATERMARK_INT
KX122_DATA_READY_INT = _pyupm_kx122.KX122_DATA_READY_INT
HIGH_RES = _pyupm_kx122.HIGH_RES
LOW_RES = _pyupm_kx122.LOW_RES
ODR_9 = _pyupm_kx122.ODR_9
ODR_2 = _pyupm_kx122.ODR_2
INT1 = _pyupm_kx122.INT1
INT2 = _pyupm_kx122.INT2
ACTIVE_LOW = _pyupm_kx122.ACTIVE_LOW
ACTIVE_HIGH = _pyupm_kx122.ACTIVE_HIGH
class _kx122_context(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    i2c = property(_pyupm_kx122._kx122_context_i2c_get, _pyupm_kx122._kx122_context_i2c_set)
    spi = property(_pyupm_kx122._kx122_context_spi_get, _pyupm_kx122._kx122_context_spi_set)
    gpio1 = property(_pyupm_kx122._kx122_context_gpio1_get, _pyupm_kx122._kx122_context_gpio1_set)
    gpio2 = property(_pyupm_kx122._kx122_context_gpio2_get, _pyupm_kx122._kx122_context_gpio2_set)
    chip_select = property(_pyupm_kx122._kx122_context_chip_select_get, _pyupm_kx122._kx122_context_chip_select_set)
    accel_scale = property(_pyupm_kx122._kx122_context_accel_scale_get, _pyupm_kx122._kx122_context_accel_scale_set)
    res_mode = property(_pyupm_kx122._kx122_context_res_mode_get, _pyupm_kx122._kx122_context_res_mode_set)
    grange_mode = property(_pyupm_kx122._kx122_context_grange_mode_get, _pyupm_kx122._kx122_context_grange_mode_set)
    buffer_accel_scale = property(_pyupm_kx122._kx122_context_buffer_accel_scale_get, _pyupm_kx122._kx122_context_buffer_accel_scale_set)
    buffer_mode = property(_pyupm_kx122._kx122_context_buffer_mode_get, _pyupm_kx122._kx122_context_buffer_mode_set)
    buffer_res = property(_pyupm_kx122._kx122_context_buffer_res_get, _pyupm_kx122._kx122_context_buffer_res_set)
    using_spi = property(_pyupm_kx122._kx122_context_using_spi_get, _pyupm_kx122._kx122_context_using_spi_set)

    def __init__(self):
        _pyupm_kx122._kx122_context_swiginit(self, _pyupm_kx122.new__kx122_context())
    __swig_destroy__ = _pyupm_kx122.delete__kx122_context

# Register _kx122_context in _pyupm_kx122:
_pyupm_kx122._kx122_context_swigregister(_kx122_context)

class odr_item(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    odr_value = property(_pyupm_kx122.odr_item_odr_value_get, _pyupm_kx122.odr_item_odr_value_set)
    odr_decimal = property(_pyupm_kx122.odr_item_odr_decimal_get, _pyupm_kx122.odr_item_odr_decimal_set)

    def __init__(self):
        _pyupm_kx122.odr_item_swiginit(self, _pyupm_kx122.new_odr_item())
    __swig_destroy__ = _pyupm_kx122.delete_odr_item

# Register odr_item in _pyupm_kx122:
_pyupm_kx122.odr_item_swigregister(odr_item)


def kx122_init(bus, addr, chip_select_pin, spi_bus_frequency):
    return _pyupm_kx122.kx122_init(bus, addr, chip_select_pin, spi_bus_frequency)

def kx122_close(dev):
    return _pyupm_kx122.kx122_close(dev)

def kx122_device_init(dev, odr, res, grange):
    return _pyupm_kx122.kx122_device_init(dev, odr, res, grange)

def kx122_get_sample_period(dev):
    return _pyupm_kx122.kx122_get_sample_period(dev)

def kx122_get_who_am_i(dev, data):
    return _pyupm_kx122.kx122_get_who_am_i(dev, data)

def kx122_get_acceleration_data_raw(dev):
    return _pyupm_kx122.kx122_get_acceleration_data_raw(dev)

def kx122_get_acceleration_data(dev):
    return _pyupm_kx122.kx122_get_acceleration_data(dev)

def kx122_sensor_software_reset(dev):
    return _pyupm_kx122.kx122_sensor_software_reset(dev)

def kx122_enable_iir(dev):
    return _pyupm_kx122.kx122_enable_iir(dev)

def kx122_disable_iir(dev):
    return _pyupm_kx122.kx122_disable_iir(dev)

def kx122_self_test(dev):
    return _pyupm_kx122.kx122_self_test(dev)

def kx122_set_sensor_standby(dev):
    return _pyupm_kx122.kx122_set_sensor_standby(dev)

def kx122_set_sensor_active(dev):
    return _pyupm_kx122.kx122_set_sensor_active(dev)

def kx122_set_odr(dev, odr):
    return _pyupm_kx122.kx122_set_odr(dev, odr)

def kx122_set_grange(dev, grange):
    return _pyupm_kx122.kx122_set_grange(dev, grange)

def kx122_set_resolution(dev, res):
    return _pyupm_kx122.kx122_set_resolution(dev, res)

def kx122_set_bw(dev, lpro):
    return _pyupm_kx122.kx122_set_bw(dev, lpro)

def kx122_set_average(dev, avg):
    return _pyupm_kx122.kx122_set_average(dev, avg)

def kx122_install_isr(dev, edge, intp, pin, isr, arg):
    return _pyupm_kx122.kx122_install_isr(dev, edge, intp, pin, isr, arg)

def kx122_uninstall_isr(dev, intp):
    return _pyupm_kx122.kx122_uninstall_isr(dev, intp)

def kx122_enable_interrupt1(dev, polarity):
    return _pyupm_kx122.kx122_enable_interrupt1(dev, polarity)

def kx122_enable_interrupt2(dev, polarity):
    return _pyupm_kx122.kx122_enable_interrupt2(dev, polarity)

def kx122_disable_interrupt1(dev):
    return _pyupm_kx122.kx122_disable_interrupt1(dev)

def kx122_disable_interrupt2(dev):
    return _pyupm_kx122.kx122_disable_interrupt2(dev)

def kx122_route_interrupt1(dev, bits):
    return _pyupm_kx122.kx122_route_interrupt1(dev, bits)

def kx122_route_interrupt2(dev, bits):
    return _pyupm_kx122.kx122_route_interrupt2(dev, bits)

def kx122_get_interrupt_status(dev):
    return _pyupm_kx122.kx122_get_interrupt_status(dev)

def kx122_get_interrupt_source(dev, data):
    return _pyupm_kx122.kx122_get_interrupt_source(dev, data)

def kx122_clear_interrupt(dev):
    return _pyupm_kx122.kx122_clear_interrupt(dev)

def kx122_enable_data_ready_interrupt(dev):
    return _pyupm_kx122.kx122_enable_data_ready_interrupt(dev)

def kx122_disable_data_ready_interrupt(dev):
    return _pyupm_kx122.kx122_disable_data_ready_interrupt(dev)

def kx122_enable_buffer_full_interrupt(dev):
    return _pyupm_kx122.kx122_enable_buffer_full_interrupt(dev)

def kx122_disable_buffer_full_interrupt(dev):
    return _pyupm_kx122.kx122_disable_buffer_full_interrupt(dev)

def kx122_enable_buffer(dev):
    return _pyupm_kx122.kx122_enable_buffer(dev)

def kx122_disable_buffer(dev):
    return _pyupm_kx122.kx122_disable_buffer(dev)

def kx122_buffer_init(dev, samples, res, mode):
    return _pyupm_kx122.kx122_buffer_init(dev, samples, res, mode)

def kx122_set_buffer_resolution(dev, res):
    return _pyupm_kx122.kx122_set_buffer_resolution(dev, res)

def kx122_set_buffer_threshold(dev, samples):
    return _pyupm_kx122.kx122_set_buffer_threshold(dev, samples)

def kx122_set_buffer_mode(dev, mode):
    return _pyupm_kx122.kx122_set_buffer_mode(dev, mode)

def kx122_get_buffer_status(dev, samples):
    return _pyupm_kx122.kx122_get_buffer_status(dev, samples)

def kx122_read_buffer_samples_raw(dev, len, x_array, y_array, z_array):
    return _pyupm_kx122.kx122_read_buffer_samples_raw(dev, len, x_array, y_array, z_array)

def kx122_read_buffer_samples(dev, len, x_array, y_array, z_array):
    return _pyupm_kx122.kx122_read_buffer_samples(dev, len, x_array, y_array, z_array)

def kx122_clear_buffer(dev):
    return _pyupm_kx122.kx122_clear_buffer(dev)
class KX122(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, bus, addr, chip_select, spi_bus_frequency=10000):
        _pyupm_kx122.KX122_swiginit(self, _pyupm_kx122.new_KX122(bus, addr, chip_select, spi_bus_frequency))
    __swig_destroy__ = _pyupm_kx122.delete_KX122

    def deviceInit(self, odr, res, grange):
        return _pyupm_kx122.KX122_deviceInit(self, odr, res, grange)

    def getSamplePeriod(self):
        return _pyupm_kx122.KX122_getSamplePeriod(self)

    def getWhoAmI(self):
        return _pyupm_kx122.KX122_getWhoAmI(self)

    def getRawAccelerationData(self):
        return _pyupm_kx122.KX122_getRawAccelerationData(self)

    def getAccelerationData(self):
        return _pyupm_kx122.KX122_getAccelerationData(self)

    def getAccelerationDataVector(self):
        return _pyupm_kx122.KX122_getAccelerationDataVector(self)

    def softwareReset(self):
        return _pyupm_kx122.KX122_softwareReset(self)

    def enableIIR(self):
        return _pyupm_kx122.KX122_enableIIR(self)

    def disableIIR(self):
        return _pyupm_kx122.KX122_disableIIR(self)

    def selfTest(self):
        return _pyupm_kx122.KX122_selfTest(self)

    def setSensorStandby(self):
        return _pyupm_kx122.KX122_setSensorStandby(self)

    def setSensorActive(self):
        return _pyupm_kx122.KX122_setSensorActive(self)

    def setODR(self, odr):
        return _pyupm_kx122.KX122_setODR(self, odr)

    def setGrange(self, grange):
        return _pyupm_kx122.KX122_setGrange(self, grange)

    def setResolution(self, res):
        return _pyupm_kx122.KX122_setResolution(self, res)

    def setBW(self, lpro):
        return _pyupm_kx122.KX122_setBW(self, lpro)

    def setAverage(self, avg):
        return _pyupm_kx122.KX122_setAverage(self, avg)

    def installISR(self, edge, intp, pin, isr, arg):
        return _pyupm_kx122.KX122_installISR(self, edge, intp, pin, isr, arg)

    def uninstallISR(self, intp):
        return _pyupm_kx122.KX122_uninstallISR(self, intp)

    def enableInterrupt1(self, polarity):
        return _pyupm_kx122.KX122_enableInterrupt1(self, polarity)

    def enableInterrupt2(self, polarity):
        return _pyupm_kx122.KX122_enableInterrupt2(self, polarity)

    def disableInterrupt1(self):
        return _pyupm_kx122.KX122_disableInterrupt1(self)

    def disableInterrupt2(self):
        return _pyupm_kx122.KX122_disableInterrupt2(self)

    def routeInterrupt1(self, bits):
        return _pyupm_kx122.KX122_routeInterrupt1(self, bits)

    def routeInterrupt2(self, bits):
        return _pyupm_kx122.KX122_routeInterrupt2(self, bits)

    def getInterruptStatus(self):
        return _pyupm_kx122.KX122_getInterruptStatus(self)

    def getInterruptSource(self):
        return _pyupm_kx122.KX122_getInterruptSource(self)

    def clearInterrupt(self):
        return _pyupm_kx122.KX122_clearInterrupt(self)

    def enableDataReadyInterrupt(self):
        return _pyupm_kx122.KX122_enableDataReadyInterrupt(self)

    def disableDataReadyInterrupt(self):
        return _pyupm_kx122.KX122_disableDataReadyInterrupt(self)

    def enableBufferFullInterrupt(self):
        return _pyupm_kx122.KX122_enableBufferFullInterrupt(self)

    def disableBufferFullInterrupt(self):
        return _pyupm_kx122.KX122_disableBufferFullInterrupt(self)

    def enableBuffer(self):
        return _pyupm_kx122.KX122_enableBuffer(self)

    def disableBuffer(self):
        return _pyupm_kx122.KX122_disableBuffer(self)

    def bufferInit(self, samples, res, mode):
        return _pyupm_kx122.KX122_bufferInit(self, samples, res, mode)

    def setBufferResolution(self, res):
        return _pyupm_kx122.KX122_setBufferResolution(self, res)

    def setBufferThreshold(self, samples):
        return _pyupm_kx122.KX122_setBufferThreshold(self, samples)

    def setBufferMode(self, mode):
        return _pyupm_kx122.KX122_setBufferMode(self, mode)

    def getBufferStatus(self):
        return _pyupm_kx122.KX122_getBufferStatus(self)

    def getRawBufferSamples(self, len):
        return _pyupm_kx122.KX122_getRawBufferSamples(self, len)

    def getBufferSamples(self, len):
        return _pyupm_kx122.KX122_getBufferSamples(self, len)

    def clearBuffer(self):
        return _pyupm_kx122.KX122_clearBuffer(self)

# Register KX122 in _pyupm_kx122:
_pyupm_kx122.KX122_swigregister(KX122)



