# 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_lidarlitev3', [dirname(__file__)])
except ImportError:
import _pyupm_lidarlitev3
return _pyupm_lidarlitev3
if fp is not None:
try:
_mod = imp.load_module('_pyupm_lidarlitev3', fp, pathname, description)
finally:
fp.close()
return _mod
_pyupm_lidarlitev3 = swig_import_helper()
del swig_import_helper
else:
import _pyupm_lidarlitev3
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_lidarlitev3.getVersion()
getVersion = _pyupm_lidarlitev3.getVersion
_pyupm_lidarlitev3.ADDR_swigconstant(_pyupm_lidarlitev3)
ADDR = _pyupm_lidarlitev3.ADDR
_pyupm_lidarlitev3.ACQ_COMMAND_swigconstant(_pyupm_lidarlitev3)
ACQ_COMMAND = _pyupm_lidarlitev3.ACQ_COMMAND
_pyupm_lidarlitev3.STATUS_swigconstant(_pyupm_lidarlitev3)
STATUS = _pyupm_lidarlitev3.STATUS
_pyupm_lidarlitev3.SIG_COUNT_VAL_swigconstant(_pyupm_lidarlitev3)
SIG_COUNT_VAL = _pyupm_lidarlitev3.SIG_COUNT_VAL
_pyupm_lidarlitev3.ACQ_CONFIG_REG_swigconstant(_pyupm_lidarlitev3)
ACQ_CONFIG_REG = _pyupm_lidarlitev3.ACQ_CONFIG_REG
_pyupm_lidarlitev3.VELOCITY_swigconstant(_pyupm_lidarlitev3)
VELOCITY = _pyupm_lidarlitev3.VELOCITY
_pyupm_lidarlitev3.PEAK_CORR_swigconstant(_pyupm_lidarlitev3)
PEAK_CORR = _pyupm_lidarlitev3.PEAK_CORR
_pyupm_lidarlitev3.NOISE_PEAK_swigconstant(_pyupm_lidarlitev3)
NOISE_PEAK = _pyupm_lidarlitev3.NOISE_PEAK
_pyupm_lidarlitev3.SIGNAL_STRENGTH_swigconstant(_pyupm_lidarlitev3)
SIGNAL_STRENGTH = _pyupm_lidarlitev3.SIGNAL_STRENGTH
_pyupm_lidarlitev3.FULL_DELAY_HIGH_swigconstant(_pyupm_lidarlitev3)
FULL_DELAY_HIGH = _pyupm_lidarlitev3.FULL_DELAY_HIGH
_pyupm_lidarlitev3.FULL_DELAY_LOW_swigconstant(_pyupm_lidarlitev3)
FULL_DELAY_LOW = _pyupm_lidarlitev3.FULL_DELAY_LOW
_pyupm_lidarlitev3.OUTER_LOOP_COUNT_swigconstant(_pyupm_lidarlitev3)
OUTER_LOOP_COUNT = _pyupm_lidarlitev3.OUTER_LOOP_COUNT
_pyupm_lidarlitev3.REF_COUNT_VAL_swigconstant(_pyupm_lidarlitev3)
REF_COUNT_VAL = _pyupm_lidarlitev3.REF_COUNT_VAL
_pyupm_lidarlitev3.LAST_DELAY_HIGH_swigconstant(_pyupm_lidarlitev3)
LAST_DELAY_HIGH = _pyupm_lidarlitev3.LAST_DELAY_HIGH
_pyupm_lidarlitev3.LAST_DELAY_LOW_swigconstant(_pyupm_lidarlitev3)
LAST_DELAY_LOW = _pyupm_lidarlitev3.LAST_DELAY_LOW
_pyupm_lidarlitev3.UNIT_ID_HIGH_swigconstant(_pyupm_lidarlitev3)
UNIT_ID_HIGH = _pyupm_lidarlitev3.UNIT_ID_HIGH
_pyupm_lidarlitev3.UNIT_ID_LOW_swigconstant(_pyupm_lidarlitev3)
UNIT_ID_LOW = _pyupm_lidarlitev3.UNIT_ID_LOW
_pyupm_lidarlitev3.I2C_ID_HIGH_swigconstant(_pyupm_lidarlitev3)
I2C_ID_HIGH = _pyupm_lidarlitev3.I2C_ID_HIGH
_pyupm_lidarlitev3.I2C_ID_LOW_swigconstant(_pyupm_lidarlitev3)
I2C_ID_LOW = _pyupm_lidarlitev3.I2C_ID_LOW
_pyupm_lidarlitev3.I2C_SEC_ADDR_swigconstant(_pyupm_lidarlitev3)
I2C_SEC_ADDR = _pyupm_lidarlitev3.I2C_SEC_ADDR
_pyupm_lidarlitev3.THRESHOLD_BYPASS_swigconstant(_pyupm_lidarlitev3)
THRESHOLD_BYPASS = _pyupm_lidarlitev3.THRESHOLD_BYPASS
_pyupm_lidarlitev3.I2C_CONFIG_swigconstant(_pyupm_lidarlitev3)
I2C_CONFIG = _pyupm_lidarlitev3.I2C_CONFIG
_pyupm_lidarlitev3.COMMAND_swigconstant(_pyupm_lidarlitev3)
COMMAND = _pyupm_lidarlitev3.COMMAND
_pyupm_lidarlitev3.MEASURE_DELAY_swigconstant(_pyupm_lidarlitev3)
MEASURE_DELAY = _pyupm_lidarlitev3.MEASURE_DELAY
_pyupm_lidarlitev3.PEAK_BCK_swigconstant(_pyupm_lidarlitev3)
PEAK_BCK = _pyupm_lidarlitev3.PEAK_BCK
_pyupm_lidarlitev3.CORR_DATA_swigconstant(_pyupm_lidarlitev3)
CORR_DATA = _pyupm_lidarlitev3.CORR_DATA
_pyupm_lidarlitev3.CORR_DATA_SIGN_swigconstant(_pyupm_lidarlitev3)
CORR_DATA_SIGN = _pyupm_lidarlitev3.CORR_DATA_SIGN
_pyupm_lidarlitev3.ACQ_SETTINGS_swigconstant(_pyupm_lidarlitev3)
ACQ_SETTINGS = _pyupm_lidarlitev3.ACQ_SETTINGS
_pyupm_lidarlitev3.POWER_CONTROL_swigconstant(_pyupm_lidarlitev3)
POWER_CONTROL = _pyupm_lidarlitev3.POWER_CONTROL
_pyupm_lidarlitev3.HIGH_swigconstant(_pyupm_lidarlitev3)
HIGH = _pyupm_lidarlitev3.HIGH
_pyupm_lidarlitev3.LOW_swigconstant(_pyupm_lidarlitev3)
LOW = _pyupm_lidarlitev3.LOW
[docs]class LIDARLITEV3(_object):
"""
API for the LIDARLITEV3 Optical Distance Measurement Sensor.
ID: lidarlightv3
Name: Optical Distance Measurement Sensor
Category: light
Manufacturer: garmin
Connection: i2c
Link:https://www.sparkfun.com/products/14032 It is a compact, high-
performance optical distance measurement sensor from Garmin. [
LIDARLITEV3
Datasheet]http://static.garmin.com/pumac/LIDAR_Lite_v3_Operation_Manual_and_Technical_Specifications.pdf
C++ includes: lidarlitev3.hpp
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, LIDARLITEV3, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, LIDARLITEV3, name)
__repr__ = _swig_repr
def __init__(self, bus, devAddr=0x62):
"""
LIDARLITEV3(int
bus, int devAddr=ADDR)
Instantiates an LIDARLITEV3 object
Parameters:
-----------
bus: Number of the used bus
devAddr: Address of the used I2C device: 0x62
"""
this = _pyupm_lidarlitev3.new_LIDARLITEV3(bus, devAddr)
try:
self.this.append(this)
except Exception:
self.this = this
[docs] def getDistance(self):
"""
int
getDistance()
LIDARLITEV3 object destructor; basically, it closes the I2C
connection.
~LIDARLITEV3 (); no need for the destructor - the I2c connection will
be closed when m_i2ControlCtx variable will be out of context Returns
distance measurement on success Retruns -1 on failure.
"""
return _pyupm_lidarlitev3.LIDARLITEV3_getDistance(self)
[docs] def read(self, reg, monitorBusyFlag):
"""
uint16_t read(int reg,
bool monitorBusyFlag)
Read Perform I2C read from device.
Parameters:
-----------
reg: register address to read from.
monitorBusyFlag: if true, the routine will repeatedly read the status
register until the busy flag (LSB) is 0.
"""
return _pyupm_lidarlitev3.LIDARLITEV3_read(self, reg, monitorBusyFlag)
[docs] def name(self):
"""
std::string name()
Returns the name of the component
"""
return _pyupm_lidarlitev3.LIDARLITEV3_name(self)
[docs] def i2cReadReg_8(self, reg):
"""
uint8_t
i2cReadReg_8(int reg)
Reads a one-byte register
Parameters:
-----------
reg: Address of the register
"""
return _pyupm_lidarlitev3.LIDARLITEV3_i2cReadReg_8(self, reg)
[docs] def i2cReadReg_16(self, reg):
"""
uint16_t
i2cReadReg_16(int reg)
Reads a two-byte register
Parameters:
-----------
reg: Address of the register
"""
return _pyupm_lidarlitev3.LIDARLITEV3_i2cReadReg_16(self, reg)
[docs] def i2cWriteReg(self, reg, value):
"""
mraa::Result
i2cWriteReg(uint8_t reg, uint8_t value)
Writes to a one-byte register
Parameters:
-----------
reg: Address of the register
value: Byte to be written
"""
return _pyupm_lidarlitev3.LIDARLITEV3_i2cWriteReg(self, reg, value)
__swig_destroy__ = _pyupm_lidarlitev3.delete_LIDARLITEV3
__del__ = lambda self: None
LIDARLITEV3_swigregister = _pyupm_lidarlitev3.LIDARLITEV3_swigregister
LIDARLITEV3_swigregister(LIDARLITEV3)
# This file is compatible with both classic and new-style classes.