drivers/sensors: add LTR553 uORB driver #2

Open
mojito02 wants to merge 1 commits from mojito02/nuttx:ltr553-uorb-driver into dev
First-time contributor

Changes

 drivers/sensors/ltr553_uorb.c   | new file (1027 lines)
 include/nuttx/sensors/ltr553.h  | new file
 drivers/sensors/Kconfig         | +26
 drivers/sensors/Make.defs       | +4
 drivers/sensors/CMakeLists.txt  | +4

All changes to existing files are pure additions; no existing file
content is modified or removed.

Summary

Add a uORB driver for the Lite-On LTR553 combined ambient light and
proximity sensor. NuttX currently supports the LTR308 ambient light
sensor from the same vendor (ltr308_uorb.c), but has no support for the
LTR553, which integrates both an ALS and an IR proximity channel in one
package.

The driver registers two uORB topics from a single device:

  • SENSOR_TYPE_LIGHT — illuminance in lux, plus the raw IR channel
  • SENSOR_TYPE_PROXIMITY — approximate distance in centimetres

Implementation notes

  • A single kthread polls the device and publishes both topics, so the two
    channels share one I2C transaction sequence and one wakeup per interval.
  • Lux is computed from the CH0/CH1 ratio following the LTR553 datasheet's
    piecewise conversion.
  • The ALS and PS channels can be activated independently through the uORB
    activate op; the PS channel follows the datasheet's required
    power-up sequence (standby → LED drive → pulse count → measurement
    rate → activate).
  • Polling interval and thread stack size are configurable via Kconfig.

Testing

Tested on an Allwinner R528 board with an LTR553 on I2C:

  • Both uORB topics publish at the expected cadence
  • Proximity values respond correctly to an approaching hand (raw counts
    from near-zero up to 1000+)
  • Light readings tracked expected changes under a covered/uncovered sensor
  • ALS and PS channels verified to work independently (either one can be
    enabled without the other)

Notes

The driver contains no platform-specific code and depends only on
standard NuttX interfaces (i2c_master, sensors/sensor.h, kthread).
Kconfig, Make.defs and CMakeLists.txt entries follow the existing LTR308
pattern.

Both new files pass nxstyle with zero warnings; the code was formatted
using tools/uncrustify.cfg.

合并请求描述

[简要描述本次合并请求的目的和主要内容]

相关Issue

关联Issue编号:#{Issue编号}

变更内容

1. 增强了xxx

## Changes ``` drivers/sensors/ltr553_uorb.c | new file (1027 lines) include/nuttx/sensors/ltr553.h | new file drivers/sensors/Kconfig | +26 drivers/sensors/Make.defs | +4 drivers/sensors/CMakeLists.txt | +4 ``` All changes to existing files are **pure additions**; no existing file content is modified or removed. ## Summary Add a uORB driver for the Lite-On LTR553 combined ambient light and proximity sensor. NuttX currently supports the LTR308 ambient light sensor from the same vendor (`ltr308_uorb.c`), but has no support for the LTR553, which integrates both an ALS and an IR proximity channel in one package. The driver registers two uORB topics from a single device: - `SENSOR_TYPE_LIGHT` — illuminance in lux, plus the raw IR channel - `SENSOR_TYPE_PROXIMITY` — approximate distance in centimetres ## Implementation notes - A single kthread polls the device and publishes both topics, so the two channels share one I2C transaction sequence and one wakeup per interval. - Lux is computed from the CH0/CH1 ratio following the LTR553 datasheet's piecewise conversion. - The ALS and PS channels can be activated independently through the uORB `activate` op; the PS channel follows the datasheet's required power-up sequence (standby → LED drive → pulse count → measurement rate → activate). - Polling interval and thread stack size are configurable via Kconfig. ## Testing Tested on an Allwinner R528 board with an LTR553 on I2C: - Both uORB topics publish at the expected cadence - Proximity values respond correctly to an approaching hand (raw counts from near-zero up to 1000+) - Light readings tracked expected changes under a covered/uncovered sensor - ALS and PS channels verified to work independently (either one can be enabled without the other) ## Notes The driver contains no platform-specific code and depends only on standard NuttX interfaces (`i2c_master`, `sensors/sensor.h`, `kthread`). Kconfig, Make.defs and CMakeLists.txt entries follow the existing LTR308 pattern. Both new files pass `nxstyle` with zero warnings; the code was formatted using `tools/uncrustify.cfg`. ## 合并请求描述 [简要描述本次合并请求的目的和主要内容] ## 相关Issue 关联Issue编号:#{Issue编号} ## 变更内容 ### 1. 增强了xxx
mojito02 added 1 commit 2026-07-29 13:59:48 +08:00
d30d72d8df drivers/sensors: add LTR553 uORB driver
Signed-off-by: mojito02 <1786365650@qq.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b mojito02-ltr553-uorb-driver dev
git pull ltr553-uorb-driver

Step 2:

Merge the changes and update on Gitea.
git checkout dev
git merge --no-ff mojito02-ltr553-uorb-driver
git push origin dev
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: openvela/nuttx#2
No description provided.