This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 1799994 feature: sensor: Add sensor type ots.
1799994 is described below
commit 1799994f2cad57e9aeafd0594d6352cc9d5b71a8
Author: songnannan <[email protected]>
AuthorDate: Mon Oct 25 10:00:59 2021 +0800
feature: sensor: Add sensor type ots.
Add ots sensor type for ots sensor.
Signed-off-by: songnannan <[email protected]>
---
drivers/sensors/sensor.c | 1 +
include/nuttx/sensors/sensor.h | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c
index 3e2ea78..5b48ce0 100644
--- a/drivers/sensors/sensor.c
+++ b/drivers/sensors/sensor.c
@@ -128,6 +128,7 @@ static const struct sensor_info g_sensor_info[] =
{sizeof(struct sensor_event_ecg), "ecg"},
{sizeof(struct sensor_event_ppg), "ppg"},
{sizeof(struct sensor_event_impd), "impd"},
+ {sizeof(struct sensor_event_ots), "ots"},
};
static const struct file_operations g_sensor_fops =
diff --git a/include/nuttx/sensors/sensor.h b/include/nuttx/sensors/sensor.h
index e1aaefa..139646a 100644
--- a/include/nuttx/sensors/sensor.h
+++ b/include/nuttx/sensors/sensor.h
@@ -245,9 +245,18 @@
#define SENSOR_TYPE_IMPEDANCE 27
+/* OTS (Optical tracking sensor)
+ * A sensor of this type returns the OTS measurements in counts. It
+ * integrates an optical chip and a LASER light source in a single miniature
+ * package. It provies wide depth of field range on glossy surface, and
+ * design flexibility into a compact device.
+ */
+
+#define SENSOR_TYPE_OTS 28
+
/* The total number of sensor */
-#define SENSOR_TYPE_COUNT 28
+#define SENSOR_TYPE_COUNT 29
/****************************************************************************
* Inline Functions
@@ -461,6 +470,13 @@ struct sensor_event_impd /* Type: Impedance */
float imag; /* Imaginary part, unit is Ohm(Ω) */
};
+struct sensor_event_ots /* Type: OTS */
+{
+ uint64_t timestamp; /* Unit is microseconds */
+ int32_t x; /* Axis X in counts */
+ int32_t y; /* Axis Y in counts */
+};
+
/* The sensor lower half driver interface */
struct sensor_lowerhalf_s;