Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
tfmini_i2c.h File Reference

Driver for the TFMini ranging device when used via I2C bus. More...

#include "stdbool.h"
#include "mcu_periph/i2c.h"
+ Include dependency graph for tfmini_i2c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TFMiniI2C
 

Enumerations

enum  TFMiniI2CStatus { TFMINI_I2C_ACQUIRE, TFMINI_I2C_PARSE }
 

Functions

void tfmini_i2c_init (void)
 Set the default values at initialization. More...
 
void tfmini_i2c_event (void)
 Ranger event function Basically just check the progress of the transation to prevent overruns during high speed operation (ie. More...
 
void tfmini_i2c_periodic (void)
 Get the ranger current distance value. More...
 
void tfmini_i2c_downlink (void)
 

Variables

struct TFMiniI2C tfmini_i2c
 

Detailed Description

Driver for the TFMini ranging device when used via I2C bus.

Driver for the TFMini ranging device connected via I2C port.

Driver for the I2C and S version of the TFMini(and TFLuna) based range sensor Reads sensor using I2Cinput and outputs the distance to object or ground

Definition in file tfmini_i2c.h.


Data Structure Documentation

◆ TFMiniI2C

struct TFMiniI2C

Definition at line 42 of file tfmini_i2c.h.

+ Collaboration diagram for TFMiniI2C:
Data Fields
uint8_t addr
bool compensate_rotation
float dist Sacled distance measured in [m].
float offset offset to what one considers a zero distance to sensor in [m]
uint16_t raw_dist raw non scaled value from sensor
enum TFMiniI2CStatus status
uint16_t strength strength of reflect signal, not implemented ATM
struct i2c_transaction trans
bool update_agl Do or don't update AGL ABI message.

Enumeration Type Documentation

◆ TFMiniI2CStatus

Enumerator
TFMINI_I2C_ACQUIRE 
TFMINI_I2C_PARSE 

Definition at line 37 of file tfmini_i2c.h.

Function Documentation

◆ tfmini_i2c_downlink()

void tfmini_i2c_downlink ( void  )

◆ tfmini_i2c_event()

void tfmini_i2c_event ( void  )

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

polling the ranger at >100Hz)

Definition at line 167 of file tfmini_i2c.c.

References I2CTransDone, I2CTransFailed, I2CTransPending, I2CTransRunning, I2CTransSuccess, i2c_transaction::status, tfmini_i2c, and TFMiniI2C::trans.

◆ tfmini_i2c_init()

◆ tfmini_i2c_periodic()

Variable Documentation

◆ tfmini_i2c