|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for an sonar rangfinder sensor when used via I2C bus. More...
Include dependency graph for sonar_i2c.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | SonarI2C |
Enumerations | |
| enum | SonarI2CStatus { SONAR_I2C_REQ_DATA , SONAR_I2C_READ_DATA , SONAR_I2C_PARSE_DATA } |
Functions | |
| void | sonar_i2c_init (void) |
| Set the default values at initialization. | |
| void | sonar_i2c_event (void) |
| Rangefinder event function Basically just check the progress of the transation to prevent overruns during high speed operation (ie. | |
| void | sonar_i2c_periodic (void) |
| Get the ranger current distance value. | |
| void | sonar_i2c_report (void) |
| Option to send debug informative values over telemetry if you do not want sonar message in telemetry. | |
Variables | |
| struct SonarI2C | sonar_i2c |
Driver for an sonar rangfinder sensor when used via I2C bus.
Driver for common sonar rangfinder devices used via I2C bus.
Definition in file sonar_i2c.h.
| struct SonarI2C |
Definition at line 38 of file sonar_i2c.h.
Collaboration diagram for SonarI2C:| Data Fields | ||
|---|---|---|
| uint8_t | addr | |
| float | distance | Distance scaled to [m]. |
| uint16_t | raw | raw measuread non scaled range value from sensor |
| enum SonarI2CStatus | status | |
| struct i2c_transaction | trans | |
| bool | update_agl | Do or don't update AGL ABI message. |
| Enumerator | |
|---|---|
| SONAR_I2C_REQ_DATA | |
| SONAR_I2C_READ_DATA | |
| SONAR_I2C_PARSE_DATA | |
Definition at line 32 of file sonar_i2c.h.
Rangefinder event function Basically just check the progress of the transation to prevent overruns during high speed operation (ie.
polling the sensor at more than maximum, e.g. > 10Hz)
Definition at line 142 of file sonar_i2c.c.
References I2CTransDone, I2CTransFailed, I2CTransPending, I2CTransRunning, I2CTransSuccess, sonar_i2c, sonar_i2c_report(), i2c_transaction::status, and SonarI2C::trans.
Here is the call graph for this function:Set the default values at initialization.
Definition at line 114 of file sonar_i2c.c.
References SonarI2C::addr, DefaultPeriodic, SonarI2C::distance, foo, I2CTransDone, init_median_filter_f(), SonarI2C::raw, register_periodic_telemetry(), sonar_i2c, SONAR_I2C_ADDR, sonar_i2c_filter, SONAR_I2C_MEDIAN_SIZE, SONAR_I2C_MIN_RANGE, SONAR_I2C_REQ_DATA, SONAR_I2C_SCALE, sonar_i2c_send_sonar(), i2c_transaction::status, SonarI2C::status, SonarI2C::trans, SonarI2C::update_agl, and USE_SONAR_I2C_AGL.
Here is the call graph for this function:Get the ranger current distance value.
Definition at line 169 of file sonar_i2c.c.
References SonarI2C::addr, AGL_SONAR_I2C_ID, i2c_transaction::buf, SonarI2C::distance, foo, get_sys_time_usec(), i2c_receive(), i2c_transmit(), I2CTransDone, FloatEulers::phi, SonarI2C::raw, READ_MODE_SINGLE, sonar_i2c, sonar_i2c_filter, SONAR_I2C_MAX_RANGE, SONAR_I2C_MIN_RANGE, SONAR_I2C_OFFSET, SONAR_I2C_PARSE_DATA, SONAR_I2C_READ_DATA, SONAR_I2C_REQ_DATA, SONAR_I2C_SCALE, stateGetNedToBodyEulers_f(), stateGetPositionEnu_f(), i2c_transaction::status, SonarI2C::status, FloatEulers::theta, SonarI2C::trans, SonarI2C::update_agl, update_median_filter_f(), and EnuCoor_f::z.
Here is the call graph for this function:Option to send debug informative values over telemetry if you do not want sonar message in telemetry.
Definition at line 246 of file sonar_i2c.c.
References DefaultChannel, DefaultDevice, SonarI2C::distance, foo, SonarI2C::raw, and sonar_i2c.
Referenced by sonar_i2c_event().
Here is the caller graph for this function:
|
extern |
Definition at line 101 of file sonar_i2c.c.
Referenced by sonar_i2c_event(), sonar_i2c_init(), sonar_i2c_periodic(), sonar_i2c_report(), and sonar_i2c_send_sonar().