Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the TFMini ranging device when used via I2C bus. More...
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 |
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.
struct TFMiniI2C |
Definition at line 42 of file tfmini_i2c.h.
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. |
enum TFMiniI2CStatus |
Enumerator | |
---|---|
TFMINI_I2C_ACQUIRE | |
TFMINI_I2C_PARSE |
Definition at line 37 of file tfmini_i2c.h.
void tfmini_i2c_downlink | ( | void | ) |
Definition at line 247 of file tfmini_i2c.c.
References DefaultChannel, DefaultDevice, TFMiniI2C::dist, TFMiniI2C::raw_dist, and tfmini_i2c.
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.
void tfmini_i2c_init | ( | void | ) |
Set the default values at initialization.
Definition at line 142 of file tfmini_i2c.c.
References TFMiniI2C::addr, TFMiniI2C::compensate_rotation, DefaultPeriodic, TFMiniI2C::dist, I2CTransDone, TFMiniI2C::offset, TFMiniI2C::raw_dist, register_periodic_telemetry(), i2c_transaction::status, TFMiniI2C::status, TFMiniI2C::strength, tfmini_i2c, TFMINI_I2C_ACQUIRE, TFMINI_I2C_ADDR, TFMINI_I2C_OFFSET, tfmini_i2c_send_lidar(), TFMiniI2C::trans, and TFMiniI2C::update_agl.
void tfmini_i2c_periodic | ( | void | ) |
Get the ranger current distance value.
Definition at line 196 of file tfmini_i2c.c.
References TFMiniI2C::addr, AGL_LIDAR_TFMINI_I2C_ID, i2c_transaction::buf, TFMiniI2C::compensate_rotation, TFMiniI2C::dist, get_sys_time_usec(), i2c_blocking_transceive(), I2CTransDone, TFMiniI2C::offset, FloatEulers::phi, TFMiniI2C::raw_dist, stateGetNedToBodyEulers_f(), stateGetPositionEnu_f(), i2c_transaction::status, TFMiniI2C::status, tfmini_i2c, TFMINI_I2C_ACQUIRE, TFMINI_I2C_MAX_RANGE, TFMINI_I2C_MIN_RANGE, TFMINI_I2C_PARSE, FloatEulers::theta, TFMiniI2C::trans, TFMiniI2C::update_agl, and EnuCoor_f::z.
|
extern |
Definition at line 1 of file tfmini_i2c.c.
Referenced by tfmini_i2c_downlink(), tfmini_i2c_event(), tfmini_i2c_init(), tfmini_i2c_periodic(), and tfmini_i2c_send_lidar().