Skip to content

Add LTR-553ALS-WA#1494

Open
Ellerbach wants to merge 1 commit into
mainfrom
add-LTR-553ALS-WA
Open

Add LTR-553ALS-WA#1494
Ellerbach wants to merge 1 commit into
mainfrom
add-LTR-553ALS-WA

Conversation

@Ellerbach
Copy link
Copy Markdown
Member

@Ellerbach Ellerbach commented Mar 13, 2026

Description

Add LTR-553ALS-WA

Motivation and Context

How Has This Been Tested?

To be tested

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

Summary by CodeRabbit

  • New Features
    • Added support for the Ltr553AlsWa proximity light sensor device with necessary configuration and dependencies.

@nfbot nfbot added Type: enhancement New feature or request Type: Documentation Improvements or additions to documentation labels Mar 13, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

Walkthrough

Three new files are added to configure the Ltr553AlsWa device: a category descriptor identifying it as a proximity light sensor, and two NuGet lockfiles that specify resolved NanoFramework dependency versions for the main project and samples subdirectory.

Changes

Cohort / File(s) Summary
Ltr553AlsWa Device Configuration
devices/Ltr553AlsWa/category.txt
Added device category identifier specifying "proximity light".
Ltr553AlsWa NanoFramework Dependencies
devices/Ltr553AlsWa/packages.lock.json, devices/Ltr553AlsWa/samples/packages.lock.json
Added NuGet lockfiles pinning resolved versions of nanoFramework core libraries, I2C system drivers, and build tools (CoreLibrary, System.Buffers.Binary.BinaryPrimitives, System.Device.I2c, System.Device.Model, Nerdbank.GitVersioning, StyleCop.MSBuild).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds support for LTR-553ALS-WA sensor, but linked issue #1718 requests M5Stack CoreS3 target support with generic screen driver, which are unrelated objectives. Verify that this PR correctly resolves issue #1718 or update the linked issue reference if this PR addresses a different sensor support requirement.
Out of Scope Changes check ⚠️ Warning The PR adds three configuration/manifest files (category.txt and two packages.lock.json files) related to a sensor device, which appears disconnected from the linked issue requesting M5Stack CoreS3 target support. Clarify whether the LTR-553ALS-WA sensor is a component of the M5Stack CoreS3 or if this PR should be linked to a different issue.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Add LTR-553ALS-WA' directly describes the main addition in the changeset - adding support for the LTR-553ALS-WA sensor device.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-LTR-553ALS-WA
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new .NET nanoFramework device binding for the Lite-On LTR-553ALS-WA proximity + ambient light sensor, including packaging assets and a runnable sample project.

Changes:

  • Introduces Iot.Device.Ltr553AlsWa binding (register map, configuration enums, I2C read/write helpers, interrupt/threshold APIs).
  • Adds a samples/ nanoFramework project demonstrating basic configuration + read loop.
  • Adds project/packaging scaffolding (.sln, .nfproj, .nuspec, StyleCop settings, dependency files) plus a repo Copilot agent instruction file.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
devices/Ltr553AlsWa/Settings.StyleCop StyleCop rule configuration for the new binding.
devices/Ltr553AlsWa/Properties/AssemblyInfo.cs Assembly metadata for the binding project.
devices/Ltr553AlsWa/Ltr553AlsWa.cs Main sensor driver API (I2C access, configuration properties, read methods, interrupt helpers).
devices/Ltr553AlsWa/Register.cs Internal register address map for the sensor.
devices/Ltr553AlsWa/AlsGain.cs ALS gain enum values.
devices/Ltr553AlsWa/AlsIntegrationTime.cs ALS integration-time enum values.
devices/Ltr553AlsWa/AlsMeasurementRate.cs ALS measurement-rate enum values.
devices/Ltr553AlsWa/PsMeasurementRate.cs Proximity measurement-rate enum values.
devices/Ltr553AlsWa/LedPulseFrequency.cs Proximity LED pulse-frequency enum values.
devices/Ltr553AlsWa/LedDutyCycle.cs Proximity LED duty-cycle enum values.
devices/Ltr553AlsWa/LedPeakCurrent.cs Proximity LED peak-current enum values.
devices/Ltr553AlsWa/InterruptMode.cs Interrupt mode enum.
devices/Ltr553AlsWa/InterruptPolarity.cs Interrupt polarity enum.
devices/Ltr553AlsWa/README.md Usage and feature documentation for the binding.
devices/Ltr553AlsWa/category.txt Device categorization metadata.
devices/Ltr553AlsWa/packages.config NuGet package references for the binding project.
devices/Ltr553AlsWa/packages.lock.json Locked dependency versions for the binding project.
devices/Ltr553AlsWa/Ltr553AlsWa.nfproj nanoFramework project file for the binding.
devices/Ltr553AlsWa/Ltr553AlsWa.nuspec NuGet packaging specification for the binding.
devices/Ltr553AlsWa/Ltr553AlsWa.sln Visual Studio solution for binding + sample projects.
devices/Ltr553AlsWa/samples/Properties/AssemblyInfo.cs Assembly metadata for the sample project.
devices/Ltr553AlsWa/samples/Program.cs Sample app demonstrating configuration and reading sensor data.
devices/Ltr553AlsWa/samples/packages.config NuGet package references for the sample project.
devices/Ltr553AlsWa/samples/packages.lock.json Locked dependency versions for the sample project.
devices/Ltr553AlsWa/samples/Ltr553AlsWa.Samples.nfproj nanoFramework project file for the sample.
.github/agents/nanoframework.agent.md Copilot agent guidance for nanoFramework codegen/review/build workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@@ -0,0 +1 @@
proximity light
Comment on lines +1 to +4
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Nerdbank.GitVersioning.3.9.50\build\Nerdbank.GitVersioning.props" Condition="Exists('packages\Nerdbank.GitVersioning.3.9.50\build\Nerdbank.GitVersioning.props')" />
<PropertyGroup Label="Globals">
Comment on lines +39 to +41
<Reference Include="System.Buffers.Binary.BinaryPrimitives, Version=1.2.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.2.862\lib\System.Buffers.Binary.BinaryPrimitives.dll</HintPath>
</Reference>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.17.12" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.2.862" targetFramework="netnano1.0" />
Comment on lines +11 to +16
"nanoFramework.System.Buffers.Binary.BinaryPrimitives": {
"type": "Direct",
"requested": "[1.2.862, 1.2.862]",
"resolved": "1.2.862",
"contentHash": "O+jmbbw2h2cjCTShsvWCzjqn/kmRacJE4Ena9gJt5xF5D7XHyYh/uE/qbZ4LhlmlN6JCZjLRNiEfHyM1YUjyxg=="
},
Comment on lines +269 to +275
public void SetPsThreshold(ushort lower, ushort upper)
{
WriteRegister(Register.PsThresholdUpLow, (byte)(upper & 0xFF));
WriteRegister(Register.PsThresholdUpHigh, (byte)((upper >> 8) & 0x07));
WriteRegister(Register.PsThresholdLowLow, (byte)(lower & 0xFF));
WriteRegister(Register.PsThresholdLowHigh, (byte)((lower >> 8) & 0x07));
}
/// <param name="alsCount">ALS persistence count (0–15), stored in bits [3:0].</param>
public void SetInterruptPersistence(byte psCount, byte alsCount)
{
byte value = (byte)(((psCount & 0x0F) << 4) | (alsCount & 0x0F));
Comment on lines +24 to +34
<HintPath>..\packages\nanoFramework.CoreLibrary.1.17.12\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="System.Buffers.Binary.BinaryPrimitives, Version=1.2.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.2.862\lib\System.Buffers.Binary.BinaryPrimitives.dll</HintPath>
</Reference>
<Reference Include="System.Device.I2c, Version=1.1.29.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\packages\nanoFramework.System.Device.I2c.1.1.29\lib\System.Device.I2c.dll</HintPath>
</Reference>
<Reference Include="System.Device.Model, Version=1.2.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\packages\nanoFramework.System.Device.Model.1.2.862\lib\System.Device.Model.dll</HintPath>
</Reference>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.17.12" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.2.862" targetFramework="netnano1.0" />
Comment on lines +11 to +16
"nanoFramework.System.Buffers.Binary.BinaryPrimitives": {
"type": "Direct",
"requested": "[1.2.862, 1.2.862]",
"resolved": "1.2.862",
"contentHash": "O+jmbbw2h2cjCTShsvWCzjqn/kmRacJE4Ena9gJt5xF5D7XHyYh/uE/qbZ4LhlmlN6JCZjLRNiEfHyM1YUjyxg=="
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation Improvements or additions to documentation Type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants