upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions
LIDARLITEV3 Class Reference

API for the LIDARLITEV3 Optical Distance Measurement Sensor. More...

Detailed Description

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

upm::LIDARLITEV3 sensor(0, ADDR);
while (!doWork) {
std::cout << "Distance = " << sensor.getDistance() << std::endl;
upm_delay_us(50000);
}

Public Member Functions

 LIDARLITEV3 (int bus, int devAddr=ADDR)
 
int getDistance ()
 
uint16_t read (int reg, bool monitorBusyFlag)
 
std::string name ()
 
uint8_t i2cReadReg_8 (int reg)
 
uint16_t i2cReadReg_16 (int reg)
 
mraa::Result i2cWriteReg (uint8_t reg, uint8_t value)
 

Constructor & Destructor Documentation

LIDARLITEV3 ( int  bus,
int  devAddr = ADDR 
)

Instantiates an LIDARLITEV3 object

Parameters
busNumber of the used bus
devAddrAddress of the used I2C device: 0x62

Member Function Documentation

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.

Here is the call graph for this function:

uint16_t read ( int  reg,
bool  monitorBusyFlag 
)

Read Perform I2C read from device.

Parameters
regregister address to read from.
monitorBusyFlagif true, the routine will repeatedly read the status register until the busy flag (LSB) is 0.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string name ( )
inline

Returns the name of the component

Here is the call graph for this function:

uint8_t i2cReadReg_8 ( int  reg)

Reads a one-byte register

Parameters
regAddress of the register

Here is the caller graph for this function:

uint16_t i2cReadReg_16 ( int  reg)

Reads a two-byte register

Parameters
regAddress of the register

Here is the caller graph for this function:

mraa::Result i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Writes to a one-byte register

Parameters
regAddress of the register
valueByte to be written

Here is the caller graph for this function:


The documentation for this class was generated from the following files: