-
Notifications
You must be signed in to change notification settings - Fork 7.4k
drivers: sensor: Add support for BH1730 ambient light sensor #89908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hello @rtborg, and thank you very much for your first pull request to the Zephyr project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the BH1730 ambient light sensor by introducing a new sensor driver, device tree bindings, and associated build changes.
- Added a new sensor node in the DTS test file.
- Introduced DTS binding YAML for the BH1730 sensor.
- Implemented the sensor driver with configuration (Kconfig, CMakeLists.txt) and driver source code.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/drivers/build_all/sensor/i2c.dtsi | Added sensor node for BH1730. |
dts/bindings/sensor/rohm,bh1730.yaml | New DTS binding file describing sensor properties and defaults. |
drivers/sensor/rohm/bh1730/bh1730.c | New driver code implementing sensor functionality. |
drivers/sensor/rohm/bh1730/Kconfig | Added configuration options for the BH1730 sensor. |
drivers/sensor/rohm/bh1730/CMakeLists.txt | Build file listing new driver source. |
drivers/sensor/rohm/Kconfig | Updated to include the new sensor driver Kconfig. |
drivers/sensor/rohm/CMakeLists.txt | Updated to add the BH1730 subdirectory when enabled. |
Comments suppressed due to low confidence (1)
drivers/sensor/rohm/bh1730/bh1730.c:29
- The constant 'BH1730_CONTORL_ADC_EN_POWER_ON_SINGLE_READING' is misspelled; consider renaming it to 'BH1730_CONTROL_ADC_EN_POWER_ON_SINGLE_READING' for clarity.
#define BH1730_CONTORL_ADC_EN_POWER_ON_SINGLE_READING 0x0B
- 0 | ||
- 1 | ||
- 2 | ||
- 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gain documentation for value '3 = x64 gain mode' does not match the driver implementation (which returns 128x gain); update the documentation to reflect the correct gain value.
Copilot uses AI. Check for mistakes.
drivers/sensor/rohm/bh1730/bh1730.c
Outdated
|
||
/* Part number in bits 7:4 */ | ||
if ((val >> 4) != (BH1730_PART_ID >> 4)) { | ||
LOG_ERR("Part number do not match, received 0x%1X", val >> 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider correcting the error message to 'Part number does not match' for proper grammar.
LOG_ERR("Part number do not match, received 0x%1X", val >> 4); | |
LOG_ERR("Part number does not match, received 0x%1X", val >> 4); |
Copilot uses AI. Check for mistakes.
properties: | ||
gain: | ||
type: int | ||
default: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the default values
https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#rules-for-default-values
This commit adds support for BH1730 ambient light sensor. Signed-off-by: Borislav Kereziev <[email protected]>
|
This commit adds support for BH1730 ambient light sensor.