Commit graph

21 commits

Author SHA1 Message Date
wangjianyu3
508418917e drivers/sensor: Add flags for GNSS satellite
Some applications require satellite information for positioning using the flag USED_IN_FIX.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 10:41:06 +08:00
wangjianyu3
5fc950e608 drivers/sensor: Fix spell errors of uorb.h
../nuttx/tools/checkpatch.sh -c -u -m -g d611304d61a79f581210584813a5b2894b838490..HEAD
Used config files:
    1: .codespellrc
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:307: afte ==> after
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:405: multipled ==> multiplied
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:416: multipled ==> multiplied
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:432: provies ==> provides, proves
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:1173: subcribers ==> subscribers
    Error: Process completed with exit code 1.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-11 20:28:17 +08:00
wangjianyu3
fda251aad0 drivers/sensor: Add timestamp for GNSS data
Add timestamp for GNSS measurements and clock, for matching.

When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
           refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.

WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-11 20:28:17 +08:00
Matteo Golin
1d205e9ae2 sensors/mcp9600: Converted MCP9600 legacy driver to UORB driver as per suggestions on PR #15525. 2025-01-21 09:09:43 +08:00
dongjiuzhu1
e7f38fe6fa drivers/sensor: add new sensot type to align android sensor type
new sensor type:
SENSOR_TEMPERATURE
SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
SENSOR_TYPE_MAGNETIC_FILED_UNCALIBRATED

refs:
https://cs.android.com/android/_/android/platform/hardware/libhardware/+/
0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-01-20 19:57:42 +08:00
wangjianyu3
0fe3aebd6a nuttx/uorb.h: Add carrier frequency for GNSS Satellite
The `struct sensor_gnss_satellite.cf` may be parsed from `GSV.signal_id`(e.g. NMEA 0183 v4.11) and `struct sensor_gnss_satellite.constellation`

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-20 20:05:26 +08:00
Alan Carvalho de Assis
0e162eeb7a drivers/sensors: Add Velocity sensor type to UORB
This patch adds support for velocity measurement sensors.
I plan to use it as a generic velocity type to be used for
Renesas FS3000 (Air Velocity Flow).

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-19 23:58:04 +01:00
wangjianyu3
c1553464bb nuttx/uorb.h: Add GNSS firmware version for struct sensor_gnss
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-06 21:18:57 +08:00
Alin Jerpelea
cd2fcf5252 include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-10-04 08:18:42 +08:00
likun17
329d121d50 sensor: Added 6dof motion and gesture related types.
For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
likun17
709cbe26f5 inlclude/uorb.h:Update data types to be sorted by macro definition.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
likun17
e7e2474614 sensor:sensor info power max_range and resolution are unified with Android type.
0e67aa0cae: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 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
dongjiuzhu1
899eeb3c35 nuttx/uorb.h: align sensor_type value with aosp
refs:0e67aa0cae:include_all/hardware/sensors-base.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-27 13:59:41 +08:00
wangjianyu3
ffac2a314b driver/sensors: Support GNSS Geofence
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
bf83b3fafc driver/sensors: Support GNSS Measurement & Clock
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
e830db0316 driver/sensors: Add constellation for GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
c652f41c87 nuttx/uorb: Rename GPS to GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
b17c074a18 nuttx/uorb: change unsigned long to uint32 to fix size issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
403469336f driver/sensors: support sensor flush operation
Supports the flush operation of the sensor.

The application can initiate a flush action through ioctl SNIOC_FLUSH
to trigger flush, and the call will be returned immediately.
Using SNIOC_GET_EVENTS to clear flush event,

However, the flush implementation is asynchronous, when all the flush
data is push to upper circbuffer, the POLLPRI event(FLUSH_COMPLETED)
will be reported.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
likun17
703bb7e7b3 sensor.c: Added new interface for obtaining and setting sensor device information.
When there is an actual physical sensor, the driver must implement the get info interface. The upper layer can obtain the actual physical sensor information through SNIOC_GET_INFO.
SNIOC_SET_INFO can only set the information of the local virtual sensor, which means it is bound to the local advertisement. Remote subscribers cannot set the information.

Usage:
  struct sensor_device_info dev_info;
  orb_ioctl(fd, SNIOC_GET_INFO, (unsigned long)(uintptr_t)&dev_info);

  or:
  ret = orb_set_info(fd, &dev_info);
  ret = orb_get_info(fd, &dev_info);

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
cccdaf8f88 include/sensors: import public pre-processor definitions types and to uorb.h
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 22:40:30 +08:00