Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
lidar_lite.c File Reference

driver for the Lidar-Lite i2c lidar version 1 (silver label) More...

#include "modules/lidar/lidar_lite.h"
#include "modules/core/abi.h"
#include "filters/median_filter.h"
#include "state.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
+ Include dependency graph for lidar_lite.c:

Go to the source code of this file.

Macros

#define LIDAR_LITE_REG_ADDR   0x00
 
#define LIDAR_LITE_REG_VAL   0x04
 
#define LIDAR_LITE_READ_ADDR   0x8F
 

Functions

void lidar_lite_init (void)
 Initialization function. More...
 
void lidar_lite_event (void)
 Lidar event function Basically just check the progress of the transation to prevent overruns during high speed operation (ie. More...
 
void lidar_lite_periodic (void)
 Poll lidar for data for altitude hold 50Hz-100Hz should be enough, in theory can go faster (see the datasheet for Lidar Lite v3. More...
 
void lidar_lite_downlink (void)
 Downlink message for debug. More...
 

Variables

struct LidarLite lidar_lite
 
struct MedianFilterInt lidar_lite_filter
 

Detailed Description

driver for the Lidar-Lite i2c lidar version 1 (silver label)

Note that the version 1 (silver label) seems to generate unexpected events on the i2c bus, such as misplaced start or stop or word reset (see I2C_ERRORS message). It seems to have no effect on other i2c devices (especially the IMU), but use with caution.

The newer versions function correctly.

Definition in file lidar_lite.c.

Macro Definition Documentation

◆ LIDAR_LITE_READ_ADDR

#define LIDAR_LITE_READ_ADDR   0x8F

Definition at line 50 of file lidar_lite.c.

◆ LIDAR_LITE_REG_ADDR

#define LIDAR_LITE_REG_ADDR   0x00

Definition at line 48 of file lidar_lite.c.

◆ LIDAR_LITE_REG_VAL

#define LIDAR_LITE_REG_VAL   0x04

Definition at line 49 of file lidar_lite.c.

Function Documentation

◆ lidar_lite_downlink()

void lidar_lite_downlink ( void  )

Downlink message for debug.

Definition at line 173 of file lidar_lite.c.

References DefaultChannel, DefaultDevice, LidarLite::distance, lidar_lite, i2c_transaction::status, LidarLite::status, status, and LidarLite::trans.

◆ lidar_lite_event()

void lidar_lite_event ( void  )

Lidar event function Basically just check the progress of the transation to prevent overruns during high speed operation (ie.

polling the radar at >100Hz)

Definition at line 76 of file lidar_lite.c.

References I2CTransDone, I2CTransFailed, I2CTransPending, I2CTransRunning, I2CTransSuccess, lidar_lite, i2c_transaction::status, and LidarLite::trans.

◆ lidar_lite_init()

◆ lidar_lite_periodic()

Variable Documentation

◆ lidar_lite

struct LidarLite lidar_lite

◆ lidar_lite_filter

struct MedianFilterInt lidar_lite_filter

Definition at line 1 of file lidar_lite.c.

Referenced by lidar_lite_init(), and lidar_lite_periodic().