Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Basic library for SRF08 telemeter. More...
#include "mcu_periph/i2c.h"
#include "alt_srf08.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
#include "led.h"
Go to the source code of this file.
Macros | |
#define | SRF08_I2C_DEV i2c0 |
Functions | |
void | srf08_init (void) |
void | srf08_initiate_ranging (void) |
void | srf08_receive (void) |
Ask the value to the device. More... | |
void | srf08_read (void) |
Read values on the bus. More... | |
void | srf08_copy (void) |
Copy the I2C buffer. More... | |
void | srf08_ping () |
uint32_t | srf08_read_register (uint8_t srf08_register) |
void | srf08_event (void) |
Variables | |
bool | srf08_received |
bool | srf08_got |
struct i2c_transaction | srf_trans |
uint16_t | srf08_range |
Basic library for SRF08 telemeter.
Definition in file alt_srf08.c.
#define SRF08_I2C_DEV i2c0 |
Definition at line 39 of file alt_srf08.c.
void srf08_copy | ( | void | ) |
Copy the I2C buffer.
Definition at line 93 of file alt_srf08.c.
References i2c_transaction::buf, srf08_range, and srf_trans.
Referenced by srf08_event().
void srf08_event | ( | void | ) |
Handling of data sent by the device (initiated by srf08_receive()
Definition at line 139 of file alt_srf08.c.
References DefaultChannel, DefaultDevice, f, I2CTransSuccess, srf08_copy(), srf08_got, srf08_range, srf08_read(), srf08_received, srf_trans, and i2c_transaction::status.
void srf08_init | ( | void | ) |
Setting the gain to the minimun value (to avoid echos ?)
Definition at line 50 of file alt_srf08.c.
References i2c_transaction::buf, i2c_transmit(), srf08_got, SRF08_I2C_DEV, SRF08_MIN_GAIN, srf08_received, SRF08_SET_GAIN, SRF08_UNIT_0, and srf_trans.
void srf08_initiate_ranging | ( | void | ) |
Definition at line 68 of file alt_srf08.c.
References i2c_transaction::buf, i2c_transmit(), LED_ON, SRF08_CENTIMETERS, SRF08_COMMAND, SRF08_I2C_DEV, SRF08_UNIT_0, and srf_trans.
Referenced by srf08_ping().
void srf08_ping | ( | void | ) |
Definition at line 98 of file alt_srf08.c.
References I2CTransSuccess, srf08_initiate_ranging(), srf08_receive(), srf_trans, and i2c_transaction::status.
void srf08_read | ( | void | ) |
Read values on the bus.
Definition at line 86 of file alt_srf08.c.
References i2c_receive(), srf08_got, SRF08_I2C_DEV, SRF08_UNIT_0, and srf_trans.
Referenced by srf08_event().
Definition at line 107 of file alt_srf08.c.
References i2c_transaction::buf, i2c_transceive(), SRF08_I2C_DEV, SRF08_UNIT_0, and srf_trans.
void srf08_receive | ( | void | ) |
Ask the value to the device.
Definition at line 77 of file alt_srf08.c.
References i2c_transaction::buf, i2c_transmit(), LED_OFF, SRF08_ECHO_1, SRF08_I2C_DEV, srf08_received, SRF08_UNIT_0, and srf_trans.
Referenced by srf08_ping().
bool srf08_got |
Definition at line 43 of file alt_srf08.c.
Referenced by srf08_event(), srf08_init(), and srf08_read().
uint16_t srf08_range |
Definition at line 45 of file alt_srf08.c.
Referenced by srf08_copy(), and srf08_event().
bool srf08_received |
Definition at line 43 of file alt_srf08.c.
Referenced by srf08_event(), srf08_init(), and srf08_receive().
struct i2c_transaction srf_trans |
Definition at line 43 of file alt_srf08.c.
Referenced by srf08_copy(), srf08_event(), srf08_init(), srf08_initiate_ranging(), srf08_ping(), srf08_read(), srf08_read_register(), and srf08_receive().