Change peripheral io APIs
[apps/native/position-finder-server.git] / inc / resource / resource_ultrasonic_sensor.h
index e2956b4..cfcfe64 100644 (file)
 #ifndef __POSITION_FINDER_RESOURCE_ULTRASONIC_SENSOR_H__
 #define __POSITION_FINDER_RESOURCE_ULTRASONIC_SENSOR_H__
 
+/**
+ * @brief Reads the value of gpio connected ultrasonic sensor(HC-SR04).
+ * @param[in] trig_pin_num The number of the gpio pin connected to the trig of the ultrasonic sensor
+ * @param[in] echo_pin_num The number of the gpio pin connected to the echo of the ultrasonic sensor
+ * @param[in] cb A callback function to be invoked when the gpio interrupt is triggered
+ * @param[in] data The data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @see If the gpio pin is not open, creates gpio handle before reading the value of gpio.
+ */
 extern int resource_read_ultrasonic_sensor(int trig_pin_num, int echo_pin_num, resource_read_cb cb, void *data);
 
 #endif /* __POSITION_FINDER_RESOURCE_ULTRASONIC_SENSOR_H__ */