srf04_params_t p
GPIO Ports of device.
int srf04_get_distance(const srf04_t *dev)
Convenience function triggers a measurement and returns distance.
@ SRF04_ERR_INVALID
error no valid measurement available
void srf04_trigger(const srf04_t *dev)
Triggers measurement.
@ SRF04_ERR_GPIO
error initializing gpio
int srf04_read(const srf04_t *dev)
Returns time of flight in ms.
gpio_t trigger
GPIO Port the trigger pin is connected to.
uint32_t time
timestamp of trigger or echo
gpio_t echo
GPIO Port the echo pin is connected to.
Low-level GPIO peripheral driver interface definitions.
@ SRF04_ERR_MEASURING
error sensor is measuring
GPIO pins for srf04 device.
int srf04_init(srf04_t *dev, const srf04_params_t *params)
Initialize gpio and interrupt.
int distance
raw time of flight distance
@ SRF04_OK
exit without error
Device descriptor for srf04 sensor.
xtimer interface definitions