summaryrefslogtreecommitdiff
path: root/digital/io/src/sharp.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/io/src/sharp.h')
-rw-r--r--digital/io/src/sharp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/digital/io/src/sharp.h b/digital/io/src/sharp.h
index 3011e095..537208cd 100644
--- a/digital/io/src/sharp.h
+++ b/digital/io/src/sharp.h
@@ -65,6 +65,9 @@
*/
#define SHARP_BACK_RIGHT 4
+/** Sharps conversion table number of elements. */
+#define SHARP_NB_ELEMENT_TABLE_CONV 12
+
/**
* Low (0 index) and high (1 index) thresholds for interpreted sharp values.
*/
@@ -91,6 +94,15 @@ void sharp_update (uint8_t sharp_mask);
*/
uint16_t sharp_get_raw (uint8_t sharp_id);
+/**
+ * Get the distance of the sharp computed on the value. It does a search in the
+ * table.
+ * @param sharp_value the value of the seen by the sharp.
+ * @return the value in mm of the object seen.
+ */
+uint16_t
+sharp_get_distance_mm (uint16_t sharp_value);
+
/**
* Configure the thresholds of a sharp.
* @param sharp_id the sharp id to configure the thresholds.