39#define SRF08_COMMAND_REG 0x0
42#define SRF08_GAIN_REG 0x1
45#define SRF08_RANGE_REG 0x2
48#define SRF08_RANGE_HIGH_BYTE 0x2
51#define SRF08_RANGE_LOW_BYTE 0x3
54#define SRF08_MAX_REGISTER_NUMBER 35
57#define SRF08_MAX_ECHO_NUMBER 17
60#define SRF08_MAX_RANGE_6M 0x8C
63#define SRF08_MAX_GAIN 0x1F
159 uint16_t *range_array,
uint_fast8_t i2c_t
Default i2c_t type definition.
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.
int srf08_set_max_range(const srf08_t *dev, uint8_t max_range)
Set the maximum range of the SRF08.
int srf08_init(srf08_t *dev, const srf08_params_t *params)
Initialize the SRF08 ultrasonic sensor.
int srf08_set_max_gain(const srf08_t *dev, uint8_t max_gain)
Set the maximum of the analog stages.
srf08_mode_t
Possible measurement modes for the SRF08 sensor.
@ SRF08_ANN_MODE_INCH
synchronous measurement in inch
@ SRF08_MODE_INCH
result in inches
@ SRF08_MODE_MICRO_SEC
result in centimeters
@ SRF08_ANN_MODE_MICRO_SEC
synchronous measurement in us
@ SRF08_MODE_CM
result in centimeters
@ SRF08_ANN_MODE_CM
synchronous measurement in cm
Low-level I2C peripheral driver interface definition.
Device initialization parameters.
i2c_t i2c
I2C device the sensor is connected to.
uint8_t addr
I2C bus address of the sensor.
Device descriptor for SRF08 sensors.
srf08_params_t params
Initialization parameters.