Add LTR-553ALS-WA#1494
Conversation
WalkthroughThree 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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.Ltr553AlsWabinding (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 | |||
| <?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"> |
| <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" /> |
| "nanoFramework.System.Buffers.Binary.BinaryPrimitives": { | ||
| "type": "Direct", | ||
| "requested": "[1.2.862, 1.2.862]", | ||
| "resolved": "1.2.862", | ||
| "contentHash": "O+jmbbw2h2cjCTShsvWCzjqn/kmRacJE4Ena9gJt5xF5D7XHyYh/uE/qbZ4LhlmlN6JCZjLRNiEfHyM1YUjyxg==" | ||
| }, |
| 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)); |
| <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" /> |
| "nanoFramework.System.Buffers.Binary.BinaryPrimitives": { | ||
| "type": "Direct", | ||
| "requested": "[1.2.862, 1.2.862]", | ||
| "resolved": "1.2.862", | ||
| "contentHash": "O+jmbbw2h2cjCTShsvWCzjqn/kmRacJE4Ena9gJt5xF5D7XHyYh/uE/qbZ4LhlmlN6JCZjLRNiEfHyM1YUjyxg==" | ||
| }, |
Description
Add LTR-553ALS-WA
Motivation and Context
How Has This Been Tested?
To be tested
Screenshots
Types of changes
Checklist:
Summary by CodeRabbit