feature: sensor: Add sensor type ots.

Add ots sensor type for ots sensor.

Signed-off-by: songnannan <songnannan@xiaomi.com>
This commit is contained in:
songnannan 2021-10-25 10:00:59 +08:00 committed by Alan Carvalho de Assis
parent 064f6c8c55
commit 1799994f2c
2 changed files with 18 additions and 1 deletions

View File

@ -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 =

View File

@ -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;