Device driver for the srf04 ultra sonic range finder. More...
Device driver for the srf04 ultra sonic range finder.
Definition in file srf04.h.
Go to the source code of this file.
Data Structures | |
struct | srf04_params_t |
GPIO pins for srf04 device. More... | |
struct | srf04_t |
Device descriptor for srf04 sensor. More... | |
Enumerations | |
enum | { SRF04_OK = 0 , SRF04_ERR_INVALID = -1 , SRF04_ERR_MEASURING = -2 , SRF04_ERR_GPIO = -3 } |
Status and error return codes. More... | |
Functions | |
int | srf04_init (srf04_t *dev, const srf04_params_t *params) |
Initialize gpio and interrupt. | |
void | srf04_trigger (const srf04_t *dev) |
Triggers measurement. | |
int | srf04_read (const srf04_t *dev) |
Returns time of flight in ms. | |
int | srf04_get_distance (const srf04_t *dev) |
Convenience function triggers a measurement and returns distance. | |