Driver definitions for the SRF02 ultrasonic ranger. More...
Driver definitions for the SRF02 ultrasonic ranger.
The connection between the SRF08 and the MCU is based on the i2c interface.
Definition in file srf08.h.
Go to the source code of this file.
Data Structures | |
struct | srf08_params_t |
Device initialization parameters. More... | |
struct | srf08_t |
Device descriptor for SRF08 sensors. More... | |
Macros | |
#define | SRF08_COMMAND_REG 0x0 |
The sensors command register (write) | |
#define | SRF08_GAIN_REG 0x1 |
Max. | |
#define | SRF08_RANGE_REG 0x2 |
The sensors range register (write) | |
#define | SRF08_RANGE_HIGH_BYTE 0x2 |
The upper measurement byte (read) | |
#define | SRF08_RANGE_LOW_BYTE 0x3 |
The lower measurement byte (read) | |
#define | SRF08_MAX_REGISTER_NUMBER 35 |
Number of highest register. | |
#define | SRF08_MAX_ECHO_NUMBER 17 |
Maximum number of echos from more distant objects. | |
#define | SRF08_MAX_RANGE_6M 0x8C |
Maximum range the sensor can measure (6m) | |
#define | SRF08_MAX_GAIN 0x1F |
Maximum gain of the sensor (1025) | |
Enumerations | |
enum | srf08_mode_t { SRF08_MODE_INCH = 0x50 , SRF08_MODE_CM = 0x51 , SRF08_MODE_MICRO_SEC = 0x52 , SRF08_ANN_MODE_INCH = 0x53 , SRF08_ANN_MODE_CM = 0x54 , SRF08_ANN_MODE_MICRO_SEC = 0x55 } |
Possible measurement modes for the SRF08 sensor. More... | |
Functions | |
int | srf08_init (srf08_t *dev, const srf08_params_t *params) |
Initialize the SRF08 ultrasonic sensor. | |
int | srf08_set_max_range (const srf08_t *dev, uint8_t max_range) |
Set the maximum range of the SRF08. | |
int | srf08_set_max_gain (const srf08_t *dev, uint8_t max_gain) |
Set the maximum of the analog stages. | |
int | srf08_get_distances (const srf08_t *dev, uint16_t *range_array, int num_echos, srf08_mode_t ranging_mode) |
Get all distances measured from the SRF08 ultrasonic sensor. | |