You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/09/27 05:59:46 UTC

(nuttx) branch master updated (2cf92a75d3 -> 329d121d50)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 2cf92a75d3 boards/qemu-rv: Correct tmpfs mount path to use CONFIG_LIBC_TMPDIR
     new 899eeb3c35 nuttx/uorb.h: align sensor_type value with aosp refs:https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h
     new e7e2474614 sensor:sensor info power max_range and resolution are unified with Android type. https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors.h
     new 709cbe26f5 inlclude/uorb.h:Update data types to be sorted by macro definition.
     new 329d121d50 sensor: Added 6dof motion and gesture related types. For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/sensors/sensor.c |  39 ++-
 include/nuttx/uorb.h     | 888 ++++++++++++++++++++++++++++-------------------
 2 files changed, 567 insertions(+), 360 deletions(-)


(nuttx) 01/04: nuttx/uorb.h: align sensor_type value with aosp refs:https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 899eeb3c3511208897a5653ac52d7c118a4e32fa
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Tue Jul 9 21:27:56 2024 +0800

    nuttx/uorb.h: align sensor_type value with aosp
    refs:https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h
    
    Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
 drivers/sensors/sensor.c | 16 ++++----
 include/nuttx/uorb.h     | 96 ++++++++++++++++++++++++------------------------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c
index 5b812a88f3..dee6947537 100644
--- a/drivers/sensors/sensor.c
+++ b/drivers/sensors/sensor.c
@@ -161,17 +161,17 @@ static const struct sensor_meta_s g_sensor_meta[] =
   {0,                                         NULL},
   {sizeof(struct sensor_accel),               "accel"},
   {sizeof(struct sensor_mag),                 "mag"},
+  {sizeof(struct sensor_uv),                  "uv"},
   {sizeof(struct sensor_gyro),                "gyro"},
   {sizeof(struct sensor_light),               "light"},
   {sizeof(struct sensor_baro),                "baro"},
+  {sizeof(struct sensor_noise),               "noise"},
   {sizeof(struct sensor_prox),                "prox"},
-  {sizeof(struct sensor_humi),                "humi"},
-  {sizeof(struct sensor_temp),                "temp"},
   {sizeof(struct sensor_rgb),                 "rgb"},
   {sizeof(struct sensor_hall),                "hall"},
   {sizeof(struct sensor_ir),                  "ir"},
-  {sizeof(struct sensor_uv),                  "uv"},
-  {sizeof(struct sensor_noise),               "noise"},
+  {sizeof(struct sensor_humi),                "humi"},
+  {sizeof(struct sensor_temp),                "temp"},
   {sizeof(struct sensor_pm25),                "pm25"},
   {sizeof(struct sensor_pm1p0),               "pm1p0"},
   {sizeof(struct sensor_pm10),                "pm10"},
@@ -179,17 +179,17 @@ static const struct sensor_meta_s g_sensor_meta[] =
   {sizeof(struct sensor_hcho),                "hcho"},
   {sizeof(struct sensor_tvoc),                "tvoc"},
   {sizeof(struct sensor_ph),                  "ph"},
-  {sizeof(struct sensor_dust),                "dust"},
   {sizeof(struct sensor_hrate),               "hrate"},
-  {sizeof(struct sensor_hbeat),               "hbeat"},
+  {sizeof(struct sensor_dust),                "dust"},
+  {sizeof(struct sensor_wake_gesture),        "wake_gesture"},
   {sizeof(struct sensor_ecg),                 "ecg"},
   {sizeof(struct sensor_ppgd),                "ppgd"},
   {sizeof(struct sensor_ppgq),                "ppgq"},
   {sizeof(struct sensor_impd),                "impd"},
   {sizeof(struct sensor_ots),                 "ots"},
-  {sizeof(struct sensor_wake_gesture),        "wake_gesture"},
-  {sizeof(struct sensor_cap),                 "cap"},
   {sizeof(struct sensor_gas),                 "gas"},
+  {sizeof(struct sensor_cap),                 "cap"},
+  {sizeof(struct sensor_hbeat),               "hbeat"},
   {sizeof(struct sensor_force),               "force"},
   {sizeof(struct sensor_gnss),                "gnss"},
   {sizeof(struct sensor_gnss_satellite),      "gnss_satellite"},
diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h
index dd8e5365c6..98e94f59f5 100644
--- a/include/nuttx/uorb.h
+++ b/include/nuttx/uorb.h
@@ -63,45 +63,45 @@
 
 #define SENSOR_TYPE_MAGNETIC_FIELD                  2
 
+/* Ultraviolet light sensor
+ * This sensor can identify the UV index in ambient light help people
+ * to effectively protect themselves from sunburns, cancer or eye damage.
+ * This value range is 0 - 15.
+ */
+#define SENSOR_TYPE_ULTRAVIOLET                     3
+
 /* Gyroscope
  * All values are in radians/second and measure the rate of rotation around
  * the X, Y and Z axis.
  */
 
-#define SENSOR_TYPE_GYROSCOPE                       3
+#define SENSOR_TYPE_GYROSCOPE                       4
 
 /* Ambient Light
  * The ambient light sensor value is returned in SI units lux.
  */
 
-#define SENSOR_TYPE_LIGHT                           4
+#define SENSOR_TYPE_LIGHT                           5
 
 /* Barometer
  * All values are in hectopascal (hPa) and measure the athmospheric pressure.
  * You can calculate altitude by perssure.
  */
 
-#define SENSOR_TYPE_BAROMETER                       5
-
-/* Proximity
- * The values correspond to the distance to the nearest
- * object in centimeters.
- */
-
-#define SENSOR_TYPE_PROXIMITY                       6
+#define SENSOR_TYPE_BAROMETER                       6
 
-/* Relative Humidity
- * A relative humidity sensor measure relative ambient air humidity and
- * return a value in percent.
+/* Noise Loudness
+ * A sensor of this type returns the loudness of noise in SI units (db)
  */
 
-#define SENSOR_TYPE_RELATIVE_HUMIDITY               7
+#define SENSOR_TYPE_NOISE                           7
 
-/* Ambient Temperature
- * The ambient (room) temperature in degree Celsius
+/* Proximity
+ * The values correspond to the distance to the nearest
+ * object in centimeters.
  */
 
-#define SENSOR_TYPE_AMBIENT_TEMPERATURE             8
+#define SENSOR_TYPE_PROXIMITY                       8
 
 /* RGB
  * We use these values of RGB to weighted to obtain the color of LED.
@@ -124,18 +124,18 @@
 
 #define SENSOR_TYPE_IR                              11
 
-/* Ultraviolet light sensor
- * This sensor can identify the UV index in ambient light help people
- * to effectively protect themselves from sunburns, cancer or eye damage.
- * This value range is 0 - 15.
+/* Relative Humidity
+ * A relative humidity sensor measure relative ambient air humidity and
+ * return a value in percent.
  */
-#define SENSOR_TYPE_ULTRAVIOLET                     12
 
-/* Noise Loudness
- * A sensor of this type returns the loudness of noise in SI units (db)
+#define SENSOR_TYPE_RELATIVE_HUMIDITY               12
+
+/* Ambient Temperature
+ * The ambient (room) temperature in degree Celsius
  */
 
-#define SENSOR_TYPE_NOISE                           13
+#define SENSOR_TYPE_AMBIENT_TEMPERATURE             13
 
 /* PM25
  * A sensor of this type returns the content of pm2.5 in the air
@@ -188,27 +188,28 @@
 
 #define SENSOR_TYPE_PH                              20
 
-/* Dust
- * A sensor of this type returns the content of dust in the air
- * values is in ug/m^3.
- */
-
-#define SENSOR_TYPE_DUST                            21
-
 /* Heart Rate
  * A sensor of this type returns the current heart rate.
  * Current heart rate is in beats per minute (BPM).
  */
 
-#define SENSOR_TYPE_HEART_RATE                      22
+#define SENSOR_TYPE_HEART_RATE                      21
 
-/* Heart Beat
- * A sensor of this type returns an event evetytime
- * a hear beat peek is detected. Peak here ideally corresponds
- * to the positive peak in the QRS complex of and ECG signal.
+/* Dust
+ * A sensor of this type returns the content of dust in the air
+ * values is in ug/m^3.
  */
 
-#define SENSOR_TYPE_HEART_BEAT                      23
+#define SENSOR_TYPE_DUST                            22
+
+/* Wake gesture
+ * A sensor enabling waking up the device based on a device specific
+ * motion. 0: the device should sleep, 1: the device should wake up.
+ * Other values ​​are uncalibrated values ​​reported by the driver to
+ * uncalibrated topics.
+ */
+
+#define SENSOR_TYPE_WAKE_GESTURE                    23
 
 /* ECG (Electrocardiogram)
  * A sensor of this type returns the ECG voltage in μV. Sensors may amplify
@@ -257,14 +258,12 @@
 
 #define SENSOR_TYPE_OTS                             28
 
-/* Wake gesture
- * A sensor enabling waking up the device based on a device specific
- * motion. 0: the device should sleep, 1: the device should wake up.
- * Other values ​​are uncalibrated values ​​reported by the driver to
- * uncalibrated topics.
+/* Gas sensor
+ * This sensor measures the gas resistance, indicating the presence
+ * of volatile organic compounds in the air.
  */
 
-#define SENSOR_TYPE_WAKE_GESTURE                    29
+#define SENSOR_TYPE_GAS                             29
 
 /* CAP (Capacitive proximity sensor)
  * The purpose of the proximity sensing interface is to detect when a
@@ -274,12 +273,13 @@
 
 #define SENSOR_TYPE_CAP                             30
 
-/* Gas sensor
- * This sensor measures the gas resistance, indicating the presence
- * of volatile organic compounds in the air.
+/* Heart Beat
+ * A sensor of this type returns an event evetytime
+ * a hear beat peek is detected. Peak here ideally corresponds
+ * to the positive peak in the QRS complex of and ECG signal.
  */
 
-#define SENSOR_TYPE_GAS                             31
+#define SENSOR_TYPE_HEART_BEAT                      31
 
 /* Force
  * A sensor of this type measures the force on it, and additionally


(nuttx) 02/04: sensor:sensor info power max_range and resolution are unified with Android type. https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors.h

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e7e2474614719716be6a43988944d26f91f13cfc
Author: likun17 <li...@xiaomi.com>
AuthorDate: Thu Jun 27 14:19:49 2024 +0800

    sensor:sensor info power max_range and resolution are unified with Android type.
    https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors.h
    
    Nuttx    <-------------------------------> Android
    int32_t  <-- version                   --> int
    float    <-- power                     --> float
    float    <-- max_range                 --> float
    float    <-- resolution                --> float
    int32_t  <-- min_delay                 --> int32_t
    int32_t  <-- max_delay                 --> int32/64_t
    uint32_t <-- fifo_reserved_event_count --> uint32_t
    uint32_t <-- fifo_max_event_count      --> uint32_t
    char[]   <-- name                      --> char*
    char[]   <-- vendor                    --> char*
    
    Signed-off-by: likun17 <li...@xiaomi.com>
---
 include/nuttx/uorb.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h
index 98e94f59f5..08cd67953c 100644
--- a/include/nuttx/uorb.h
+++ b/include/nuttx/uorb.h
@@ -784,11 +784,9 @@ struct sensor_device_info_s
 
   uint32_t      version;
 
-  /* Rough estimate of this sensor's power consumption in mA.
-   * Divide the current data by 1000 to get the real data.
-   */
+  /* Rough estimate of this sensor's power consumption in mA. */
 
-  uint32_t      power;
+  float         power;
 
   /* Maximum range of this sensor's value in SI units. */
 
@@ -806,7 +804,7 @@ struct sensor_device_info_s
    *   special   : 0, unless otherwise noted
    */
 
-  long          min_delay;
+  int32_t       min_delay;
 
   /* This value is defined only for continuous mode and on-change sensors.
    * it is the delay between two sensor events corresponding to the lowest
@@ -816,7 +814,7 @@ struct sensor_device_info_s
    * applications to estimate when the batch FIFO may be full.
    */
 
-  unsigned long max_delay;
+  int32_t       max_delay;
 
   /* Number of events reserved for this sensor in the batch mode FIFO.
    * if there is a dedicated FIFO for this sensor, then this is the


(nuttx) 04/04: sensor: Added 6dof motion and gesture related types. For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 329d121d50b44fd8e0932cc9650782fa6b0a5f53
Author: likun17 <li...@xiaomi.com>
AuthorDate: Mon Aug 5 20:56:32 2024 +0800

    sensor: Added 6dof motion and gesture related types.
    For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values
    
    Signed-off-by: likun17 <li...@xiaomi.com>
---
 drivers/sensors/sensor.c |  35 ++--
 include/nuttx/uorb.h     | 408 ++++++++++++++++++++++++++++++++++-------------
 2 files changed, 326 insertions(+), 117 deletions(-)

diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c
index dee6947537..9a42611a02 100644
--- a/drivers/sensors/sensor.c
+++ b/drivers/sensors/sensor.c
@@ -161,36 +161,51 @@ static const struct sensor_meta_s g_sensor_meta[] =
   {0,                                         NULL},
   {sizeof(struct sensor_accel),               "accel"},
   {sizeof(struct sensor_mag),                 "mag"},
-  {sizeof(struct sensor_uv),                  "uv"},
+  {sizeof(struct sensor_orientation),         "orientation"},
   {sizeof(struct sensor_gyro),                "gyro"},
   {sizeof(struct sensor_light),               "light"},
   {sizeof(struct sensor_baro),                "baro"},
   {sizeof(struct sensor_noise),               "noise"},
   {sizeof(struct sensor_prox),                "prox"},
   {sizeof(struct sensor_rgb),                 "rgb"},
-  {sizeof(struct sensor_hall),                "hall"},
-  {sizeof(struct sensor_ir),                  "ir"},
+  {sizeof(struct sensor_accel),               "linear_accel"},
+  {sizeof(struct sensor_rotation),            "rotation"},
   {sizeof(struct sensor_humi),                "humi"},
   {sizeof(struct sensor_temp),                "temp"},
   {sizeof(struct sensor_pm25),                "pm25"},
   {sizeof(struct sensor_pm1p0),               "pm1p0"},
   {sizeof(struct sensor_pm10),                "pm10"},
-  {sizeof(struct sensor_co2),                 "co2"},
-  {sizeof(struct sensor_hcho),                "hcho"},
-  {sizeof(struct sensor_tvoc),                "tvoc"},
+  {sizeof(struct sensor_event),               "motion_detect"},
+  {sizeof(struct sensor_event),               "step_detector"},
+  {sizeof(struct sensor_step_counter),        "step_counter"},
   {sizeof(struct sensor_ph),                  "ph"},
   {sizeof(struct sensor_hrate),               "hrate"},
+  {sizeof(struct sensor_event),               "tilt_detector"},
+  {sizeof(struct sensor_event),               "wake_gesture"},
+  {sizeof(struct sensor_event),               "glance_gesture"},
+  {sizeof(struct sensor_event),               "pickup_gesture"},
+  {sizeof(struct sensor_event),               "wrist_tilt"},
+  {sizeof(struct sensor_orientation),         "device_orientation"},
+  {sizeof(struct sensor_pose_6dof),           "pose_6dof"},
+  {sizeof(struct sensor_gas),                 "gas"},
+  {sizeof(struct sensor_event),               "significant_motion"},
+  {sizeof(struct sensor_hbeat),               "hbeat"},
+  {sizeof(struct sensor_force),               "force"},
+  {sizeof(struct sensor_hall),                "hall"},
+  {sizeof(struct sensor_event),               "offbody_detector"},
+  {sizeof(struct sensor_uv),                  "uv"},
+  {sizeof(struct sensor_angle),               "hinge_angle"},
+  {sizeof(struct sensor_ir),                  "ir"},
+  {sizeof(struct sensor_hcho),                "hcho"},
+  {sizeof(struct sensor_tvoc),                "tvoc"},
   {sizeof(struct sensor_dust),                "dust"},
-  {sizeof(struct sensor_wake_gesture),        "wake_gesture"},
   {sizeof(struct sensor_ecg),                 "ecg"},
   {sizeof(struct sensor_ppgd),                "ppgd"},
   {sizeof(struct sensor_ppgq),                "ppgq"},
   {sizeof(struct sensor_impd),                "impd"},
   {sizeof(struct sensor_ots),                 "ots"},
-  {sizeof(struct sensor_gas),                 "gas"},
+  {sizeof(struct sensor_co2),                 "co2"},
   {sizeof(struct sensor_cap),                 "cap"},
-  {sizeof(struct sensor_hbeat),               "hbeat"},
-  {sizeof(struct sensor_force),               "force"},
   {sizeof(struct sensor_gnss),                "gnss"},
   {sizeof(struct sensor_gnss_satellite),      "gnss_satellite"},
   {sizeof(struct sensor_gnss_measurement),    "gnss_measurement"},
diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h
index 4c4baa8262..8327197c91 100644
--- a/include/nuttx/uorb.h
+++ b/include/nuttx/uorb.h
@@ -63,12 +63,19 @@
 
 #define SENSOR_TYPE_MAGNETIC_FIELD                  2
 
-/* Ultraviolet light sensor
- * This sensor can identify the UV index in ambient light help people
- * to effectively protect themselves from sunburns, cancer or eye damage.
- * This value range is 0 - 15.
+/* Orientation
+ * An orientation sensor reports the attitude of the device. The measurements
+ * are reported in degrees in the x, y, and z.
+ *   x:azimuth, the angle between the magnetic north direction and the
+ *     Y axis, around the Z axis (0<=azimuth<360). 0=North, 90=East,
+ *     180=South, 270=West.
+ *   y:pitch, rotation around X axis (-180<=pitch<=180), with positive values
+ *     when the Z axis moves toward the Y axis.
+ *   z:roll, rotation around Y axis (-90<=roll<=90), with positive values
+ *     when the X axis moves towards the Z axis.
  */
-#define SENSOR_TYPE_ULTRAVIOLET                     3
+
+#define SENSOR_TYPE_ORIENTATION                     3
 
 /* Gyroscope
  * All values are in radians/second and measure the rate of rotation around
@@ -110,19 +117,26 @@
 
 #define SENSOR_TYPE_RGB                             9
 
-/* Hall
- * All values are in bool type (0 or 1) and it often is used to as switch.
- * A values of 1 indicates that switch on.
+/* Linear acceleration
+ * A linear acceleration sensor reports the linear acceleration of the device
+ * in the sensor frame, not including gravity(output of the accelerometer
+ * minus the output of the gravity sensor).
  */
 
-#define SENSOR_TYPE_HALL                            10
-
-/* IR (Infrared Ray)
- * This sensor can detect a human approach and outputs a signal from
- * interrupt pins. This sensor value is in lux.
+#define SENSOR_TYPE_LINEAR_ACCELERATION             10
+
+/* Rotation
+ * A rotation vector sensor reports the orientation of the device relative
+ * to the East-North-Up coordinates frame. It's usually obtained by
+ * integration of accelerometer, gyroscope, and magnetometer readings.
+ * The East-North-Up coordinate system is defined as a direct orthonormal
+ * basis where:
+ *   X points east and is tangential to the ground.
+ *   Y points north and is tangential to the ground.
+ *   Z points towards the sky and is perpendicular to the ground.
  */
 
-#define SENSOR_TYPE_IR                              11
+#define SENSOR_TYPE_ROTATION_VECTOR                 11
 
 /* Relative Humidity
  * A relative humidity sensor measure relative ambient air humidity and
@@ -158,26 +172,32 @@
 
 #define SENSOR_TYPE_PM10                            16
 
-/* CO2
- * A sensor of this type returns the content of CO2 in the air
- * This value is in units (ppm-part per million).
+/* Significant motion
+ * A significant motion detector triggers when detecting a significant
+ * motion: a motion that might lead to a change in the user location.
  */
 
-#define SENSOR_TYPE_CO2                             17
+#define SENSOR_TYPE_SIGNIFICANT_MOTION              17
 
-/* HCHO
- * The HCHO pollution is an important indicator of household air
- * pollution. This value is in units (ppm-part per million).
+/* Step detector
+ * A step detector generates an event each time a step is taken by the user.
+ * The timestamp of the event corresponds to when the foot hit the ground,
+ * generating a high variation in acceleration. Compared to the step counter,
+ * the step detector should have a lower latency (less than two seconds).
+ * Both the step detector and the step counter detect when the user is
+ * walking, running, and walking up the stairs. They shouldn't trigger when
+ * the user is biking, driving, or in other vehicles.
  */
 
-#define SENSOR_TYPE_HCHO                            18
+#define SENSOR_TYPE_STEP_DETECTOR                   18
 
-/* TVOC (total volatile organic compounds)
- * The indoor TVOC is cause indoor air pollution is one of the
- * main reasons why. This value is in units (ppb-part per billion).
+/* Step counter
+ * A step counter reports the number of steps taken by the user since the
+ * last reboot while activated. A step counter reports the number of steps
+ * taken by the user since the last reboot while activated.
  */
 
-#define SENSOR_TYPE_TVOC                            19
+#define SENSOR_TYPE_STEP_COUNTER                    19
 
 /* PH
  * The acid-base degree describes the strength of the aqueous
@@ -195,12 +215,11 @@
 
 #define SENSOR_TYPE_HEART_RATE                      21
 
-/* Dust
- * A sensor of this type returns the content of dust in the air
- * values is in ug/m^3.
+/* Tilt detector
+ * A tilt detector generates an event each time a tilt event is detected.
  */
 
-#define SENSOR_TYPE_DUST                            22
+#define SENSOR_TYPE_TILT_DETECTOR                   22
 
 /* Wake gesture
  * A sensor enabling waking up the device based on a device specific
@@ -211,13 +230,160 @@
 
 #define SENSOR_TYPE_WAKE_GESTURE                    23
 
+/* Glance gesture
+ * A glance gesture sensor enables briefly turning the screen on to enable
+ * the user to glance content on screen based on a specific motion.
+ * When this sensor triggers, the device will turn the screen on momentarily
+ * to allow the user to glance notifications or other content while the
+ * device remains locked in a non-interactive state (dozing), then the screen
+ * will turn off again.
+ */
+
+#define SENSOR_TYPE_GLANCE_GESTURE                  24
+
+/* Pick up gesture
+ * A pick-up gesture sensor triggers when the device is picked up regardless
+ * of wherever it was before (desk, pocket, bag).
+ */
+
+#define SENSOR_TYPE_PICK_UP_GESTURE                 25
+
+/* Wrist tilt
+ * The wrist-off detection sensor is only triggered when the device is off
+ * the wrist.
+ */
+
+#define SENSOR_TYPE_WRIST_TILT_GESTURE              26
+
+/* Device_orientation
+ * A device orientation sensor reports the current orientation of the device.
+ */
+
+#define SENSOR_TYPE_DEVICE_ORIENTATION              27
+
+/* Pose 6DOF
+ * A Pose 6DOF sensor reports the orientation of the device relative to the
+ * East-North-Up coordinates frame. It is obtained by integration of
+ * accelerometer and gyroscope readings.
+ * The East-North-Up coordinate system is defined as a direct orthonormal
+ * basis where:
+ *   X points east and is tangential to the ground.
+ *   Y points north and is tangential to the ground.
+ *   Z points towards the sky and is perpendicular to the ground.
+ * The orientation is represented by the rotation necessary to align the
+ * East-North-Up coordinates with the device's coordinates. That is, applying
+ * the rotation to the world frame (X,Y,Z) would align them with the device
+ * coordinates (x,y,z).
+ * The rotation can be seen as rotating the device by an angle theta around
+ * an axis rot_axis to go from the reference (East-North-Up aligned) device
+ * orientation to the current device orientation. The rotation is encoded as
+ * the four unitless x, y, z, w components of a unit quaternion.
+ */
+
+#define SENSOR_TYPE_POSE_6DOF                       28
+
+/* Gas sensor
+ * This sensor measures the gas resistance, indicating the presence
+ * of volatile organic compounds in the air.
+ */
+
+#define SENSOR_TYPE_GAS                             29
+
+/* Motion detect
+ * Motion detection sensor is used to detect the motion status of the device.
+ * motion detect event is produced if the device has been in motion
+ * for at least 5 seconds with a maximal latency of 5 additional seconds.
+ * ie: it may take up anywhere from 5 to 10 seconds afte the device has been
+ * at rest to trigger this event. The only allowed value is 1.0.
+ */
+
+#define SENSOR_TYPE_MOTION_DETECT                   30
+
+/* Heart Beat
+ * A sensor of this type returns an event evetytime
+ * a hear beat peek is detected. Peak here ideally corresponds
+ * to the positive peak in the QRS complex of and ECG signal.
+ */
+
+#define SENSOR_TYPE_HEART_BEAT                      31
+
+/* Force
+ * A sensor of this type measures the force on it, and additionally
+ * compares the force with one or more specified thresholds. The sensor
+ * can output the force value directly. Moreover, it's usually applied
+ * as a press key. In that case, when it detects a force greater than
+ * some given threshold, a corresponding event is reported.
+ */
+
+#define SENSOR_TYPE_FORCE                           32
+
+/* Hall
+ * All values are in bool type (0 or 1) and it often is used to as switch.
+ * A values of 1 indicates that switch on.
+ */
+
+#define SENSOR_TYPE_HALL                            33
+
+/* Offbody detect
+ * An offbody detect sensor reports every time the device transitions from
+ * off-body to on-body and from on-body to off-body (e.g. a wearable device
+ * being removed from the wrist would trigger an event indicating an off-body
+ * transition).
+ */
+
+#define SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT      34
+
+/* Ultraviolet light sensor
+ * This sensor can identify the UV index in ambient light help people
+ * to effectively protect themselves from sunburns, cancer or eye damage.
+ * This value range is 0 - 15.
+ */
+#define SENSOR_TYPE_ULTRAVIOLET                     35
+
+/* Hinge angle
+ * A hinge angle sensor measures the angle, in degrees, between two integral
+ * parts of the device. Movement of a hinge measured by this sensor type is
+ * expected to alter the ways in which the user can interact with the device,
+ * for example, by unfolding or revealing a display.
+ */
+
+#define SENSOR_TYPE_HINGE_ANGLE                     36
+
+/* IR (Infrared Ray)
+ * This sensor can detect a human approach and outputs a signal from
+ * interrupt pins. This sensor value is in lux.
+ */
+
+#define SENSOR_TYPE_IR                              37
+
+/* HCHO
+ * The HCHO pollution is an important indicator of household air
+ * pollution. This value is in units (ppm-part per million).
+ */
+
+#define SENSOR_TYPE_HCHO                            38
+
+/* TVOC (total volatile organic compounds)
+ * The indoor TVOC is cause indoor air pollution is one of the
+ * main reasons why. This value is in units (ppb-part per billion).
+ */
+
+#define SENSOR_TYPE_TVOC                            39
+
+/* Dust
+ * A sensor of this type returns the content of dust in the air
+ * values is in ug/m^3.
+ */
+
+#define SENSOR_TYPE_DUST                            40
+
 /* ECG (Electrocardiogram)
  * A sensor of this type returns the ECG voltage in μV. Sensors may amplify
  * the input ECG signal. Here the ECG voltage is the un-amplified ECG
  * voltage.
  */
 
-#define SENSOR_TYPE_ECG                             24
+#define SENSOR_TYPE_ECG                             41
 
 /* PPG Dual (2-channel photoplethysmography)
  * A sensor of this type returns the 2 channels PPG measurements in ADC
@@ -228,7 +394,7 @@
  * measurements. The ADC gains are multipled on the output and affect SNR.
  */
 
-#define SENSOR_TYPE_PPGD                            25
+#define SENSOR_TYPE_PPGD                            42
 
 /* PPG Quad (4-channel photoplethysmography)
  * A sensor of this type returns the 4 channels PPG measurements in ADC
@@ -239,7 +405,7 @@
  * measurements. The ADC gains are multipled on the output and affect SNR.
  */
 
-#define SENSOR_TYPE_PPGQ                            26
+#define SENSOR_TYPE_PPGQ                            43
 
 /* Imdepance
  * A sensor of this type returns the impedance measurements. An impedance
@@ -247,7 +413,7 @@
  * imaginary part(reactance). Both of them are in uint Ohm(Ω).
  */
 
-#define SENSOR_TYPE_IMPEDANCE                       27
+#define SENSOR_TYPE_IMPEDANCE                       44
 
 /* OTS (Optical tracking sensor)
  * A sensor of this type returns the OTS measurements in counts. It
@@ -256,14 +422,14 @@
  * design flexibility into a compact device.
  */
 
-#define SENSOR_TYPE_OTS                             28
+#define SENSOR_TYPE_OTS                             45
 
-/* Gas sensor
- * This sensor measures the gas resistance, indicating the presence
- * of volatile organic compounds in the air.
+/* CO2
+ * A sensor of this type returns the content of CO2 in the air
+ * This value is in units (ppm-part per million).
  */
 
-#define SENSOR_TYPE_GAS                             29
+#define SENSOR_TYPE_CO2                             46
 
 /* CAP (Capacitive proximity sensor)
  * The purpose of the proximity sensing interface is to detect when a
@@ -271,25 +437,7 @@
  * is in the proximity of the system.
  */
 
-#define SENSOR_TYPE_CAP                             30
-
-/* Heart Beat
- * A sensor of this type returns an event evetytime
- * a hear beat peek is detected. Peak here ideally corresponds
- * to the positive peak in the QRS complex of and ECG signal.
- */
-
-#define SENSOR_TYPE_HEART_BEAT                      31
-
-/* Force
- * A sensor of this type measures the force on it, and additionally
- * compares the force with one or more specified thresholds. The sensor
- * can output the force value directly. Moreover, it's usually applied
- * as a press key. In that case, when it detects a force greater than
- * some given threshold, a corresponding event is reported.
- */
-
-#define SENSOR_TYPE_FORCE                           32
+#define SENSOR_TYPE_CAP                             47
 
 /* GNSS
  * A sensor of this type returns GNSS data. Include latitude, longitude,
@@ -297,29 +445,29 @@
  * horizontal dilution of precision, vertical dilution of precision...
  */
 
-#define SENSOR_TYPE_GNSS                            33
+#define SENSOR_TYPE_GNSS                            48
 
 /* Sensor of GNSS satellite
  * A sensor of this type returns the GNSS satellite information.
  */
 
-#define SENSOR_TYPE_GNSS_SATELLITE                  34
+#define SENSOR_TYPE_GNSS_SATELLITE                  49
 
 /* GNSS Measurement */
 
-#define SENSOR_TYPE_GNSS_MEASUREMENT                35
+#define SENSOR_TYPE_GNSS_MEASUREMENT                50
 
 /* GNSS Clock */
 
-#define SENSOR_TYPE_GNSS_CLOCK                      36
+#define SENSOR_TYPE_GNSS_CLOCK                      51
 
 /* GNSS Geofence */
 
-#define SENSOR_TYPE_GNSS_GEOFENCE                   37
+#define SENSOR_TYPE_GNSS_GEOFENCE                   52
 
 /* The total number of sensor */
 
-#define SENSOR_TYPE_COUNT                           38
+#define SENSOR_TYPE_COUNT                           53
 
 /* The additional sensor open flags */
 
@@ -423,6 +571,12 @@
  * reported.
  */
 
+struct sensor_event  /* Type: Sensor Common Event */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  uint32_t event;           /* Common events */
+};
+
 struct sensor_accel         /* Type: Accerometer */
 {
   uint64_t timestamp;       /* Units is microseconds */
@@ -442,10 +596,12 @@ struct sensor_mag           /* Type: Magnetic Field */
   int32_t status;           /* Status of calibration */
 };
 
-struct sensor_uv            /* Type: Ultraviolet Light */
+struct sensor_orientation   /* Type: Orientation */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float uvi;                /* the value range is 0 - 15 */
+  float    x;               /* azimuth */
+  float    y;               /* pitch */
+  float    z;               /* roll */
 };
 
 struct sensor_gyro          /* Type: Gyroscope */
@@ -491,16 +647,14 @@ struct sensor_rgb           /* Type: RGB */
   float b;                  /* Units is percent */
 };
 
-struct sensor_hall          /* Type: HALL */
+struct sensor_rotation      /* Type: Rotation */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  int32_t hall;             /* Hall state */
-};
-
-struct sensor_ir            /* Type: Infrared Ray */
-{
-  uint64_t timestamp;       /* Units is microseconds */
-  float ir;                 /* in SI units lux */
+  float    x;               /* x*sin(θ/2) */
+  float    y;               /* y*sin(θ/2) */
+  float    z;               /* z*sin(θ/2) */
+  float    w;               /* cos(θ/2) */
+  float    status;          /* estimated heading Accuracy (in radians) (-1 if unavailable) */
 };
 
 struct sensor_humi          /* Type: Relative Humidity */
@@ -533,51 +687,104 @@ struct sensor_pm10          /* Type: PM10 */
   float pm10;               /* in SI units ug/m^3 */
 };
 
-struct sensor_co2           /* Type: CO2 */
+struct sensor_step_counter  /* Type: Step Coun */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float co2;                /* in SI units ppm */
+  uint32_t steps;           /* Step counting */
+  uint32_t cadence;         /* Stride frequency */
 };
 
-struct sensor_hcho          /* Type: HCHO */
+struct sensor_ph            /* Type: PH */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float hcho;               /* in SI units ppm */
+  float ph;                 /* PH = 7.0 neutral, PH < 7.0 acidic, PH > 7.0 alkaline */
 };
 
-struct sensor_tvoc          /* Type: TVOC */
+struct sensor_hrate         /* Type: Heart Rate */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float tvoc;               /* in SI units ppm */
+  float bpm;                /* is SI units BPM */
 };
 
-struct sensor_ph            /* Type: PH */
+struct sensor_pose_6dof     /* Type: Pose 6dof */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float ph;                 /* PH = 7.0 neutral, PH < 7.0 acidic, PH > 7.0 alkaline */
+  float    x;               /* x*sin(theta/2) */
+  float    y;               /* y*sin(theta/2) */
+  float    z;               /* z*sin(theta/2) */
+  float    w;               /* cos(theta/2) */
+  float    tx;              /* Translation along x axis from an arbitrary origin. */
+  float    ty;              /* Translation along y axis from an arbitrary origin. */
+  float    tz;              /* Translation along z axis from an arbitrary origin. */
+  float    dx;              /* Delta quaternion rotation x*sin(theta/2) */
+  float    dy;              /* Delta quaternion rotation y*sin(theta/2) */
+  float    dz;              /* Delta quaternion rotation z*sin(theta/2) */
+  float    dw;              /* Delta quaternion rotation cos(theta/2) */
+  float    dtx;             /* Delta translation along x axis. */
+  float    dty;             /* Delta translation along y axis. */
+  float    dtz;             /* Delta translation along z axis. */
+  uint64_t number;          /* Sequence number; ascending sequentially from 0 */
 };
 
-struct sensor_hrate         /* Type: Heart Rate */
+struct sensor_gas           /* Type: Gas */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float bpm;                /* is SI units BPM */
+  float gas_resistance;     /* Gas resistance in kOhm */
 };
 
-struct sensor_dust          /* Type: DUST */
+struct sensor_hbeat         /* Type: Heart Beat */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float dust;               /* is SI units ug/m^3 */
+  float beat;               /* Units is times/minutes */
 };
 
-struct sensor_wake_gesture  /* Type: Wake gesture */
+struct sensor_force         /* Type: Force */
 {
-  uint64_t timestamp;                /* Units is microseconds */
+  uint64_t timestamp;       /* Unit is microseconds */
+  float force;              /* Force value, units is N */
+  int32_t event;            /* Force event */
+};
 
-  /* wake gesture event, 0: sleep, 1: wake,
-   * others: Uncalibrated status value.
-   */
+struct sensor_hall          /* Type: HALL */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  int32_t hall;             /* Hall state */
+};
+
+struct sensor_uv            /* Type: Ultraviolet Light */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float uvi;                /* the value range is 0 - 15 */
+};
+
+struct sensor_angle         /* Type: Angle */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float    angle;           /* Angle. Unit is degree */
+};
+
+struct sensor_ir            /* Type: Infrared Ray */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float ir;                 /* in SI units lux */
+};
+
+struct sensor_hcho          /* Type: HCHO */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float hcho;               /* in SI units ppm */
+};
+
+struct sensor_tvoc          /* Type: TVOC */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float tvoc;               /* in SI units ppm */
+};
 
-  uint32_t event;
+struct sensor_dust          /* Type: DUST */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float dust;               /* is SI units ug/m^3 */
 };
 
 struct sensor_ecg           /* Type: ECG */
@@ -617,10 +824,10 @@ struct sensor_ots           /* Type: OTS */
   int32_t y;                /* Axis Y in counts */
 };
 
-struct sensor_gas           /* Type: Gas */
+struct sensor_co2           /* Type: CO2 */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float gas_resistance;     /* Gas resistance in kOhm */
+  float co2;                /* in SI units ppm */
 };
 
 struct sensor_cap           /* Type: Capacitance */
@@ -630,19 +837,6 @@ struct sensor_cap           /* Type: Capacitance */
   int32_t rawdata[4];       /* in SI units pF */
 };
 
-struct sensor_hbeat         /* Type: Heart Beat */
-{
-  uint64_t timestamp;       /* Units is microseconds */
-  float beat;               /* Units is times/minutes */
-};
-
-struct sensor_force         /* Type: Force */
-{
-  uint64_t timestamp;       /* Unit is microseconds */
-  float force;              /* Force value, units is N */
-  int32_t event;            /* Force event */
-};
-
 struct sensor_gnss          /* Type: GNSS */
 {
   uint64_t timestamp;       /* Time since system start, Units is microseconds */


(nuttx) 03/04: inlclude/uorb.h:Update data types to be sorted by macro definition.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 709cbe26f54ad8f2b9d6b375d56eb48b02b9bd81
Author: likun17 <li...@xiaomi.com>
AuthorDate: Mon Aug 26 09:53:53 2024 +0800

    inlclude/uorb.h:Update data types to be sorted by macro definition.
    
    Signed-off-by: likun17 <li...@xiaomi.com>
---
 include/nuttx/uorb.h | 462 +++++++++++++++++++++++++--------------------------
 1 file changed, 231 insertions(+), 231 deletions(-)

diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h
index 08cd67953c..4c4baa8262 100644
--- a/include/nuttx/uorb.h
+++ b/include/nuttx/uorb.h
@@ -432,15 +432,6 @@ struct sensor_accel         /* Type: Accerometer */
   float temperature;        /* Temperature in degrees celsius */
 };
 
-struct sensor_gyro          /* Type: Gyroscope */
-{
-  uint64_t timestamp;       /* Units is microseconds */
-  float x;                  /* Axis X in rad/s */
-  float y;                  /* Axis Y in rad/s */
-  float z;                  /* Axis Z in rad/s */
-  float temperature;        /* Temperature in degrees celsius */
-};
-
 struct sensor_mag           /* Type: Magnetic Field */
 {
   uint64_t timestamp;       /* Units is microseconds */
@@ -451,17 +442,19 @@ struct sensor_mag           /* Type: Magnetic Field */
   int32_t status;           /* Status of calibration */
 };
 
-struct sensor_baro          /* Type: Barometer */
+struct sensor_uv            /* Type: Ultraviolet Light */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float pressure;           /* pressure measurement in millibar or hpa */
-  float temperature;        /* Temperature in degrees celsius */
+  float uvi;                /* the value range is 0 - 15 */
 };
 
-struct sensor_prox          /* Type: proximity */
+struct sensor_gyro          /* Type: Gyroscope */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float proximity;          /* distance to the nearest object in centimeters */
+  float x;                  /* Axis X in rad/s */
+  float y;                  /* Axis Y in rad/s */
+  float z;                  /* Axis Z in rad/s */
+  float temperature;        /* Temperature in degrees celsius */
 };
 
 struct sensor_light         /* Type: Light */
@@ -471,16 +464,23 @@ struct sensor_light         /* Type: Light */
   float ir;                 /* in SI lux units */
 };
 
-struct sensor_humi          /* Type: Relative Humidity */
+struct sensor_baro          /* Type: Barometer */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float humidity;           /* in percent  */
+  float pressure;           /* pressure measurement in millibar or hpa */
+  float temperature;        /* Temperature in degrees celsius */
 };
 
-struct sensor_temp          /* Type: Ambient Temperature */
+struct sensor_noise         /* Type: Noise Loudness */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float temperature;        /* Temperature in degrees celsius */
+  float db;                 /* in SI units db */
+};
+
+struct sensor_prox          /* Type: proximity */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float proximity;          /* distance to the nearest object in centimeters */
 };
 
 struct sensor_rgb           /* Type: RGB */
@@ -503,16 +503,16 @@ struct sensor_ir            /* Type: Infrared Ray */
   float ir;                 /* in SI units lux */
 };
 
-struct sensor_uv            /* Type: Ultraviolet Light */
+struct sensor_humi          /* Type: Relative Humidity */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float uvi;                /* the value range is 0 - 15 */
+  float humidity;           /* in percent  */
 };
 
-struct sensor_noise         /* Type: Noise Loudness */
+struct sensor_temp          /* Type: Ambient Temperature */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float db;                 /* in SI units db */
+  float temperature;        /* Temperature in degrees celsius */
 };
 
 struct sensor_pm25          /* Type: PM25 */
@@ -521,16 +521,16 @@ struct sensor_pm25          /* Type: PM25 */
   float pm25;               /* in SI units ug/m^3 */
 };
 
-struct sensor_pm10          /* Type: PM10 */
+struct sensor_pm1p0         /* Type: PM1P0 */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float pm10;               /* in SI units ug/m^3 */
+  float pm1p0;              /* in SI units ug/m^3 */
 };
 
-struct sensor_pm1p0         /* Type: PM1P0 */
+struct sensor_pm10          /* Type: PM10 */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float pm1p0;              /* in SI units ug/m^3 */
+  float pm10;               /* in SI units ug/m^3 */
 };
 
 struct sensor_co2           /* Type: CO2 */
@@ -557,22 +557,27 @@ struct sensor_ph            /* Type: PH */
   float ph;                 /* PH = 7.0 neutral, PH < 7.0 acidic, PH > 7.0 alkaline */
 };
 
-struct sensor_dust          /* Type: DUST */
+struct sensor_hrate         /* Type: Heart Rate */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float dust;               /* is SI units ug/m^3 */
+  float bpm;                /* is SI units BPM */
 };
 
-struct sensor_hrate         /* Type: Heart Rate */
+struct sensor_dust          /* Type: DUST */
 {
   uint64_t timestamp;       /* Units is microseconds */
-  float bpm;                /* is SI units BPM */
+  float dust;               /* is SI units ug/m^3 */
 };
 
-struct sensor_hbeat         /* Type: Heart Beat */
+struct sensor_wake_gesture  /* Type: Wake gesture */
 {
-  uint64_t timestamp;       /* Units is microseconds */
-  float beat;               /* Units is times/minutes */
+  uint64_t timestamp;                /* Units is microseconds */
+
+  /* wake gesture event, 0: sleep, 1: wake,
+   * others: Uncalibrated status value.
+   */
+
+  uint32_t event;
 };
 
 struct sensor_ecg           /* Type: ECG */
@@ -612,6 +617,32 @@ struct sensor_ots           /* Type: OTS */
   int32_t y;                /* Axis Y in counts */
 };
 
+struct sensor_gas           /* Type: Gas */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float gas_resistance;     /* Gas resistance in kOhm */
+};
+
+struct sensor_cap           /* Type: Capacitance */
+{
+  uint64_t timestamp;       /* Unit is microseconds */
+  int32_t status;           /* Detection status */
+  int32_t rawdata[4];       /* in SI units pF */
+};
+
+struct sensor_hbeat         /* Type: Heart Beat */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float beat;               /* Units is times/minutes */
+};
+
+struct sensor_force         /* Type: Force */
+{
+  uint64_t timestamp;       /* Unit is microseconds */
+  float force;              /* Force value, units is N */
+  int32_t event;            /* Force event */
+};
+
 struct sensor_gnss          /* Type: GNSS */
 {
   uint64_t timestamp;       /* Time since system start, Units is microseconds */
@@ -694,35 +725,186 @@ struct sensor_gnss_satellite
   info[SENSOR_GNSS_SAT_INFO_MAX];
 };
 
-struct sensor_wake_gesture  /* Type: Wake gesture */
+struct sensor_gnss_measurement
 {
-  uint64_t timestamp;                /* Units is microseconds */
+  /* Indicating what fields are valid.
+   * See SENSOR_GNSS_MEASUREMENT_HAS_*.
+   */
 
-  /* wake gesture event, 0: sleep, 1: wake,
-   * others: Uncalibrated status value.
+  uint32_t flags;
+
+  /* Space vehicle ID. */
+
+  int32_t  svid;
+
+  /* Constellation of the given SV, see GNSS_CONSTELLATION_*. */
+
+  uint32_t constellation;
+
+  /* Offset between clock and time at which the measurement was taken in
+   * nanoseconds.
    */
 
-  uint32_t event;
+  float    time_offset_ns;
+
+  /* The received GNSS Time-of-Week at the measurement time, in
+   * nanoseconds.
+   */
+
+  int64_t  received_sv_time_in_ns;
+  int64_t  received_sv_time_uncertainty_in_ns;
+
+  /* GNSS measurement state, see SENSOR_GNSS_MEASUREMENT_STATE_*. */
+
+  uint32_t state;
+
+  /* dBHz, Carrier-to-noise density. */
+
+  float    c_n0_dbhz;
+
+  /* Pseudorange rate(m/s) at the timestamp. */
+
+  float    pseudorange_rate_mps;
+  float    pseudorange_rate_uncertainty_mps;
+
+  /* Accumulated delta range. */
+
+  uint32_t accumulated_delta_range_state;
+  float    accumulated_delta_range_m;
+  float    accumulated_delta_range_uncertainty_m;
+
+  /* Carrier related between the satellite and the receiver.
+   * flags:
+   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_CYCLES
+   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY
+   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_PHASE
+   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY
+   */
+
+  float    carrier_frequency_hz;
+  int64_t  carrier_cycles;
+  float    carrier_phase;
+  float    carrier_phase_uncertainty;
+
+  uint32_t multipath_indicator;
+
+  /* dBHz, Signal to noise ratio of satellite C/N0.
+   * flags: SENSOR_GNSS_MEASUREMENT_HAS_SNR
+   */
+
+  uint32_t snr;
 };
 
-struct sensor_cap           /* Type: Capacitance */
+struct sensor_gnss_clock
 {
-  uint64_t timestamp;       /* Unit is microseconds */
-  int32_t status;           /* Detection status */
-  int32_t rawdata[4];       /* in SI units pF */
+  /* Indicating what fields are valid.
+   * See SENSOR_GNSS_CLOCK_HAS_*.
+   */
+
+  uint32_t flags;
+
+  /* Leap second data.
+   * flags: SENSOR_GNSS_CLOCK_HAS_LEAP_SECOND
+   */
+
+  int32_t  leap_second;
+
+  /* The GNSS receiver internal local hardware clock value.
+   * flags:
+   *   SENSOR_GNSS_CLOCK_HAS_TIME_UNCERTAINTY
+   */
+
+  int64_t  time_ns;
+  float    time_uncertainty_ns;
+
+  /* Discontinuities in the HW clock. */
+
+  uint32_t hw_clock_discontinuity_count;
+
+  /* The difference between hardware clock ('time' field) inside
+   * GPS receiver and the true GPS time since 0000Z, January 6, 1980, in
+   * nanoseconds.
+   * flags:
+   *   SENSOR_GNSS_CLOCK_HAS_FULL_BIAS
+   *   SENSOR_GNSS_CLOCK_HAS_BIAS
+   *   SENSOR_GNSS_CLOCK_HAS_BIAS_UNCERTAINTY
+   */
+
+  int64_t  full_bias_ns;
+  float    bias_ns;             /* Sub-nanosecond bias */
+  float    bias_uncertainty_ns;
+
+  /* The clock's drift in nanoseconds (per second).
+   * A positive value means that the frequency is higher than
+   * the nominal frequency.
+   * flags:
+   *   SENSOR_GNSS_CLOCK_HAS_DRIFT
+   *   SENSOR_GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY
+   */
+
+  float    drift_nsps;
+  float    drift_uncertainty_nsps;
 };
 
-struct sensor_gas           /* Type: Gas */
+/* GNSS Geofence events */
+
+struct sensor_gnss_geofence_event
 {
-  uint64_t timestamp;       /* Units is microseconds */
-  float gas_resistance;     /* Gas resistance in kOhm */
+  /* Type of events
+   * Fields below are optional according to this `type`,
+   * Available: see SENSOR_GNSS_GEOFENCE_TYPE_VALID_EVENT.
+   *
+   * Mandatory:
+   *   |Fields \ Type |TRANSITION |STATUS |ADD |REMOVE |PAUSE |RESUME |
+   *   |--------------|:---------:|:-----:|:--:|:-----:|:----:|:-----:|
+   *   |geofence_id   |     v     |       | v  |    v  |   v  |   v   |
+   *   |transition    |     v     |       |    |       |      |       |
+   *   |location      |     v     |   v   |    |       |      |       |
+   *   |timestamp     |     v     |       |    |       |      |       |
+   *   |status        |           |   v   | v  |    v  |   v  |   v   |
+   */
+
+  int32_t            type;
+
+  int32_t            geofence_id; /* Id of the geofence. */
+  struct sensor_gnss location;    /* Location. */
+
+  /* Milliseconds when the transition was detected since January 1, 1970 */
+
+  int64_t            timestamp;
+  int32_t            status;      /* Status of Geofence operation/event. */
+  int32_t            transition;  /* See SENSOR_GNSS_GEOFENCE_TRANS_*. */
 };
 
-struct sensor_force         /* Type: Force */
+/* GNSS Geofence parameters */
+
+struct sensor_gnss_geofence_param
 {
-  uint64_t timestamp;       /* Unit is microseconds */
-  float force;              /* Force value, units is N */
-  int32_t event;            /* Force event */
+  /* Type of events
+   * Available: see SENSOR_GNSS_GEOFENCE_TYPE_VALID_PARAM.
+   *
+   * Mandatory:
+   *   |Fields \ Type |ADD |REMOVE |PAUSE |RESUME |
+   *   |--------------|:--:|:-----:|:----:|:-----:|
+   *   |geofence_id   | v  |   v   |  v   |   v   |
+   *   |transition    | v  |       |      |   v   |
+   *   |latitude      | v  |       |      |       |
+   *   |longitude     | v  |       |      |       |
+   *   |radius_meters | v  |       |      |       |
+   */
+
+  int32_t            type;
+
+  int32_t            geofence_id;
+  float              latitude;
+  float              longitude;
+  float              radius_meters;
+
+  /* Which transitions to monitor.
+   * Available: see SENSOR_GNSS_GEOFENCE_TRANS_*.
+   */
+
+  int32_t            transition;
 };
 
 /* This structure describes the state for the sensor device */
@@ -840,186 +1022,4 @@ struct sensor_device_info_s
   char          vendor[SENSOR_INFO_NAME_SIZE];
 };
 
-struct sensor_gnss_clock
-{
-  /* Indicating what fields are valid.
-   * See SENSOR_GNSS_CLOCK_HAS_*.
-   */
-
-  uint32_t flags;
-
-  /* Leap second data.
-   * flags: SENSOR_GNSS_CLOCK_HAS_LEAP_SECOND
-   */
-
-  int32_t  leap_second;
-
-  /* The GNSS receiver internal local hardware clock value.
-   * flags:
-   *   SENSOR_GNSS_CLOCK_HAS_TIME_UNCERTAINTY
-   */
-
-  int64_t  time_ns;
-  float    time_uncertainty_ns;
-
-  /* Discontinuities in the HW clock. */
-
-  uint32_t hw_clock_discontinuity_count;
-
-  /* The difference between hardware clock ('time' field) inside
-   * GPS receiver and the true GPS time since 0000Z, January 6, 1980, in
-   * nanoseconds.
-   * flags:
-   *   SENSOR_GNSS_CLOCK_HAS_FULL_BIAS
-   *   SENSOR_GNSS_CLOCK_HAS_BIAS
-   *   SENSOR_GNSS_CLOCK_HAS_BIAS_UNCERTAINTY
-   */
-
-  int64_t  full_bias_ns;
-  float    bias_ns;             /* Sub-nanosecond bias */
-  float    bias_uncertainty_ns;
-
-  /* The clock's drift in nanoseconds (per second).
-   * A positive value means that the frequency is higher than
-   * the nominal frequency.
-   * flags:
-   *   SENSOR_GNSS_CLOCK_HAS_DRIFT
-   *   SENSOR_GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY
-   */
-
-  float    drift_nsps;
-  float    drift_uncertainty_nsps;
-};
-
-struct sensor_gnss_measurement
-{
-  /* Indicating what fields are valid.
-   * See SENSOR_GNSS_MEASUREMENT_HAS_*.
-   */
-
-  uint32_t flags;
-
-  /* Space vehicle ID. */
-
-  int32_t  svid;
-
-  /* Constellation of the given SV, see GNSS_CONSTELLATION_*. */
-
-  uint32_t constellation;
-
-  /* Offset between clock and time at which the measurement was taken in
-   * nanoseconds.
-   */
-
-  float    time_offset_ns;
-
-  /* The received GNSS Time-of-Week at the measurement time, in
-   * nanoseconds.
-   */
-
-  int64_t  received_sv_time_in_ns;
-  int64_t  received_sv_time_uncertainty_in_ns;
-
-  /* GNSS measurement state, see SENSOR_GNSS_MEASUREMENT_STATE_*. */
-
-  uint32_t state;
-
-  /* dBHz, Carrier-to-noise density. */
-
-  float    c_n0_dbhz;
-
-  /* Pseudorange rate(m/s) at the timestamp. */
-
-  float    pseudorange_rate_mps;
-  float    pseudorange_rate_uncertainty_mps;
-
-  /* Accumulated delta range. */
-
-  uint32_t accumulated_delta_range_state;
-  float    accumulated_delta_range_m;
-  float    accumulated_delta_range_uncertainty_m;
-
-  /* Carrier related between the satellite and the receiver.
-   * flags:
-   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_CYCLES
-   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY
-   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_PHASE
-   *   SENSOR_GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY
-   */
-
-  float    carrier_frequency_hz;
-  int64_t  carrier_cycles;
-  float    carrier_phase;
-  float    carrier_phase_uncertainty;
-
-  uint32_t multipath_indicator;
-
-  /* dBHz, Signal to noise ratio of satellite C/N0.
-   * flags: SENSOR_GNSS_MEASUREMENT_HAS_SNR
-   */
-
-  uint32_t snr;
-};
-
-/* GNSS Geofence parameters */
-
-struct sensor_gnss_geofence_param
-{
-  /* Type of events
-   * Available: see SENSOR_GNSS_GEOFENCE_TYPE_VALID_PARAM.
-   *
-   * Mandatory:
-   *   |Fields \ Type |ADD |REMOVE |PAUSE |RESUME |
-   *   |--------------|:--:|:-----:|:----:|:-----:|
-   *   |geofence_id   | v  |   v   |  v   |   v   |
-   *   |transition    | v  |       |      |   v   |
-   *   |latitude      | v  |       |      |       |
-   *   |longitude     | v  |       |      |       |
-   *   |radius_meters | v  |       |      |       |
-   */
-
-  int32_t            type;
-
-  int32_t            geofence_id;
-  float              latitude;
-  float              longitude;
-  float              radius_meters;
-
-  /* Which transitions to monitor.
-   * Available: see SENSOR_GNSS_GEOFENCE_TRANS_*.
-   */
-
-  int32_t            transition;
-};
-
-/* GNSS Geofence events */
-
-struct sensor_gnss_geofence_event
-{
-  /* Type of events
-   * Fields below are optional according to this `type`,
-   * Available: see SENSOR_GNSS_GEOFENCE_TYPE_VALID_EVENT.
-   *
-   * Mandatory:
-   *   |Fields \ Type |TRANSITION |STATUS |ADD |REMOVE |PAUSE |RESUME |
-   *   |--------------|:---------:|:-----:|:--:|:-----:|:----:|:-----:|
-   *   |geofence_id   |     v     |       | v  |    v  |   v  |   v   |
-   *   |transition    |     v     |       |    |       |      |       |
-   *   |location      |     v     |   v   |    |       |      |       |
-   *   |timestamp     |     v     |       |    |       |      |       |
-   *   |status        |           |   v   | v  |    v  |   v  |   v   |
-   */
-
-  int32_t            type;
-
-  int32_t            geofence_id; /* Id of the geofence. */
-  struct sensor_gnss location;    /* Location. */
-
-  /* Milliseconds when the transition was detected since January 1, 1970 */
-
-  int64_t            timestamp;
-  int32_t            status;      /* Status of Geofence operation/event. */
-  int32_t            transition;  /* See SENSOR_GNSS_GEOFENCE_TRANS_*. */
-};
-
 #endif /* __INCLUDE_NUTTX_SENSORS_SENSOR_H */