Commit graph

662 commits

Author SHA1 Message Date
Niccolò Maggioni
3ba6047e29 drivers/sensors/tmp112: Add support for TMP112 temperature sensor
Add support for the Texas Instruments TMP112 I2C/SMBus digital
temperature sensor. Also add a new defconfig that includes
support for a TMP112 sensor and extend the existing documentation
to include its description.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-19 19:45:32 -03:00
simbit18
2b3741d083 drivers: Fix Kconfig style
Remove spaces from Kconfig
2025-08-19 19:44:31 -03:00
Matteo Golin
41eaa50a58 drivers/sensors/lis2mdl: Increase buffer size
The ODR of this sensor is too high to have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
7d9d59f069 drivers/sensors/lsm6dso32: Increase buffer size
The ODR of this device is too high to only have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
4845eadaa9 drivers/l86xxx: Mutex fixes & performance improvements
Fix mutex locking bugs and improve performance. Fix interval no longer
set statically since it is available via `set_interval` uORB function.
Activation/deactivation no longer triggers standby/hotstart since this
functionality was very unstable.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:49:49 -04:00
wangjianyu3
8c32bed29e drivers/sensors/gnss: Skip copying extended satellite flags
The extended member `flags` of `info` of `struct sensor_gnss_satellite` is not parsed from GSV.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 10:41:06 +08:00
Matteo Golin
b0760dceb6 drivers/sensors/l86xxx: Use uORB GNSS lower-half
Changes the implementation of the L86xxx driver to use the
gnss_lowerhalf driver implementation, simplifying this driver's logic.
It also fixes the `read_line` function which would early return on `\r`,
as well as adding some retries for response checking and better mutex
locking.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-28 10:46:55 +02:00
Matteo Golin
da72df9ab6 drivers/sensors/l86xxx: Fix kernel crashes on failed registration
Sometimes this driver will boot when the serial port is of the wrong
baud rate, and it cannot set the correct baud rate or verify
communication. This commit prevents registration if any settings fail to
be set, and also prevents the kernel thread from setting the L86 to
enabled (this is done only by the uORB upper half).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-25 10:48:55 +08:00
Daniel Byshkin
c51f749f9a /drivers/sensors/nau7802: Added frequency control
Added controls to the NAU7802 so that a user can change the frequency via orb_set_frequency/orb_set_interval
2025-07-15 09:39:57 +08:00
SPRESENSE
a20ac0fe7c sensors/bmi160: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:50:18 +02:00
SPRESENSE
be5c90716c sensors/bmi270: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:50:18 +02:00
Matteo Golin
6ae3cc9082 drivers/sensors/l86xxx: Make some dependency patches and update documentation
This commit removes the termios dependency of the command to set fix
rate. It makes the MINMEA dependency present in the Kconfig options for
the driver, and it also adds a retry limit to the boot message
verification of 3 times. The documentation has been updated to reflect
the correct signature for the registration function and fix some
formatting.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-09 09:45:21 +02:00
Elias Hawa
0ce9e82d73 drivers/sensors: add Quectel L86-XXX GNSS uORB sensor driver 2025-07-07 21:18:15 -03:00
simbit18
1f98d90825 drivers/sensors/CMakeLists.txt: Aligned Cmake with Make
Add:
    Adafruit NAU7802 ADC sensor
    MCP9600 Thermocouple Amplifier
    Maxim MAX31865

Removed repeated addition of the Rohm BH1749NUC Color Sensor

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 20:40:15 +08:00
Matteo Golin
0bfcbed934 sensors/nau7802: Fix format warning
Silence format string warning by adding missing '%' sign.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-04 15:26:47 +08:00
raiden00pl
1775528beb drivers/sensors: add missing SENSORS prefix after d68476796a
add missing SENSORS prefix after d68476796a for some sensors

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-25 09:50:53 +08:00
raiden00pl
d68476796a drivers/sensors: fix various coding style issues
fix various coding style issues for drivers/sensors:

- remove redundant `#define CONFIG_XXX` that should be provided from Kconfig
- correct section banners
- remove empty section banners
- fix some function banners

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-23 11:29:58 -03:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
raiden00pl
3a31da9585 sensors: add support for BME688 sensor
Add support for BME688 sensor based on BME680 implementation.
The BME688 is nearly identical to the BME680, and this implementation
reuses much of the existing BME680 code. However, there are some differences
related to gas measurements that make it impractical to use the same driver
without significantly complicating it. BME688 also supports parallel mode
which isn't yet supported.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:16:54 +08:00
Matteo Golin
da982e113e drivers/sensors/lis2mdl: Fix SYSLOG call.
This call to syslog was missing the '%' in its format string, and also
was using the wrong format string (lu instead of d) to print the `cmd`
argument. It is corrected and the compiler warning resolved.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-04-20 16:54:47 -03:00
Daniel Byshkin
504f838577 sensors/nau7802: Add support for the NAU7802
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.

Signed-off-by: Daniel Byshkin <online@bskdany.com>
2025-04-01 09:38:37 +08:00
SPRESENSE
64b97bda5d drivers/sensors: Add CXD5602PWBIMU driver for IMU Add-on board
Add CXD5602PWBIMU driver for IMU Add-on board.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-24 16:07:45 -03:00
Angus Jull
c7d72bc95c drivers/sensors/fakesensor: Add baro sensor type
Add a function `fakesensor_read_baro` that allows barometric data to be
read and published by fakesensor

Signed-off-by: Angus Jull <angusjull1@gmail.com>
2025-03-19 09:08:06 +01:00
Matteo Golin
a76d63646f drivers/sensors/ms56xx: Use nxsig_usleep for long delays.
Change use of `up_udelay()` to `nxsig_usleep()` on the 10ms delays for
better performance.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-20 11:12:13 -03:00
Matteo Golin
8de9dd9515 drivers/sensors/lsm6dso32: fixed byte read command to include start.
This is required to meet the communication requirements as per the
LSM6DSO32 datasheet. It doesn't cause issues on some MCUs (RP2040), but
prevents successful reads on others (STM32).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-19 15:21:08 -03:00
Matteo Golin
576a9990c5 drivers/sensors/lsm6dso32: Fixed typo in device address registration.
The valid addresses should be 0x6a and 0x6b, not 0x6c. Now the device
can be registered with the correct addresses without failing the
assertion.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-14 10:37:21 +01:00
Matteo Golin
729f8a75f7 drivers/sensors: Added uORB driver for LSM6DSO32 IMU.
Adds support for the LSM6DSO32 IMU by STM using the uORB framework. This
only contains limited support for the I2C interface, interrupt and
polling driven measurement and standard modes of operation (high
performance ODRs). Features like interrupts besides DRDY, filtering,
gesture recognition and acting as a bus master are not implemented.
2025-02-12 10:44:15 -03:00
simbit18
71a221708c [Kconfig] Fix Kconfig style
drivers\sensors\Kconfig

Remove spaces from Kconfig files
Add TABs
2025-02-10 17:08:16 -03:00
Matteo Golin
044879e7a3 sensors/lis2mdl: Create a UORB driver for the LIS2MDL magnetometer. 2025-01-28 16:34:17 +08:00
simbit18
5c02379548 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2025-01-23 23:01:54 +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
Matteo Golin
c15b900a88 sensors/sht4x: Converted SHT4X driver to UORB framework. 2025-01-17 09:08:21 +08:00
Matteo Golin
36507cc7b2 drivers/sensors: Wrote a driver for the MCP9600 thermocouple amplifier. 2025-01-14 23:04:18 +08:00
chenzihan0416
2db0b69335 Update goldfish_sensor_uorb.c 2025-01-14 16:44:13 +08:00
chenzihan1
c41c726161 goldfish sensor add get_info interface
Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-14 16:44:13 +08:00
jerryslhao
f1b7d7d641 drivers/sensors/bmi088: add driver for Bosch BMI088 IMU
This adds a driver for the Bosch BMI088 IMU sensor.
The driver supports spi.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-14 10:29:48 +08:00
chenzihan1
724797e05c goldfish_sensor_uorb.c: add set_interval for goldfish sensor
Added the ability to set sampling rate for goldfish

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-10 04:31:29 +08:00
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
wangjianyu3
8282ed9ab0 drivers/sensors/gnss: Macro UINT8_MAX for maximum value of uint8_t crefs
libs/libc/gnssutils/minmea/minmea.h:17:#include <stdint.h>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-08 22:50:03 +08:00
wangjianyu3
350f396aa5 drivers/sensors/gnss: Fix integer overflow error
CID 1309501: (#1 of 1): Overflow constant (INTEGER_OVERFLOW)
overflow_const: Expression upper->crefs, which is equal to 255, where enable ? 1 : -1 is known to be equal to -1, overflows the type that receives it, an unsigned integer 8 bits wide.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-07 21:38:17 +08:00
wangjianyu3
3093b28860 drivers/sensors/gnss: Fix deactivate failure when using both topic and device
Deactivate lower driver fails when both uORB topic and driver device are subscribed and opened.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-27 00:13:47 +08:00
Alan Carvalho de Assis
2d062a9529 drivers/sensors: Add support to Renesas FS3000 Air Velocity Flow
This driver add uORB sensor support to Renesas FS3000 sensor.

Thanks Xiang Xiao for review and suggestions.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-22 18:49:50 +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
Andre Heinemans
d15a20eac8 sensors: fix Make.defs for bmm150 2024-12-14 15:07:08 +08:00
wangjianyu3
5fbf377214 sensors/fakesensor_uorb: Using different nbuffer for each topic of GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 14:10:57 +08:00
wangjianyu3
d2dd747e09 drivers/sensors/gnss: Different nbuffer for each topic
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 14:10:57 +08:00
wangjianyu3
f1a57f4265 drivers/sensors/gnss: Add suffix to macro of geofence index
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 03:16:25 +08:00
Xiang Xiao
72fbbbdbf3 sensors/bmi160_uorb.c: Fix the typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-17 08:31:08 -03:00
raiden00pl
547cbf3ba6 drivers/sensors: fix style issues in function headers
fix style issues in function headers, add missing new lines
2024-11-15 01:04:10 +08:00