Add GC0308#1495
Conversation
WalkthroughTwo new configuration files are added to establish build and versioning configuration for the Gc0308 device, including NuGet dependency management and semantic versioning setup. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 inconclusive)
✅ 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 GC0308 (0.3MP VGA) camera sensor device binding to the devices/ collection, including configuration APIs over SCCB/I2C plus documentation and a sample project for bring-up.
Changes:
- Introduces the
Iot.Device.Gc0308driver with register initialization tables and configuration methods (format, resolution, WB, effects, etc.). - Adds
CameraFramehelper for working with captured RGB565 / YCbCr 4:2:2 frame buffers. - Adds module packaging/versioning assets (
.nuspec,version.json, lock file), documentation, and a runnable sample.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| devices/Gc0308/version.json | Adds module versioning configuration (Nerdbank.GitVersioning). |
| devices/Gc0308/packages.lock.json | Adds locked restore for module dependencies. |
| devices/Gc0308/packages.config | Declares module NuGet dependencies. |
| devices/Gc0308/Settings.StyleCop | Adds StyleCop configuration for the new module. |
| devices/Gc0308/Gc0308.sln | Adds a solution for the device + sample projects. |
| devices/Gc0308/Gc0308.nfproj | Adds the nanoFramework project file for the driver library. |
| devices/Gc0308/Gc0308.nuspec | Adds NuGet packaging metadata for publishing the driver. |
| devices/Gc0308/README.md | Adds usage docs, feature list, limitations, and CoreS3 wiring notes. |
| devices/Gc0308/Properties/AssemblyInfo.cs | Adds assembly metadata for the driver. |
| devices/Gc0308/Gc0308.cs | Implements the main GC0308 driver and configuration API surface. |
| devices/Gc0308/Gc0308Config.cs | Adds default register init tables and preset parameter tables. |
| devices/Gc0308/Gc0308Register.cs | Defines register addresses used by the driver. |
| devices/Gc0308/OutputFormat.cs | Adds output format enum. |
| devices/Gc0308/Resolution.cs | Adds resolution preset enum. |
| devices/Gc0308/MirrorFlip.cs | Adds orientation enum. |
| devices/Gc0308/ExposureMode.cs | Adds exposure mode enum. |
| devices/Gc0308/WhiteBalanceMode.cs | Adds white balance mode enum. |
| devices/Gc0308/SpecialEffect.cs | Adds special effect enum. |
| devices/Gc0308/CameraFrame.cs | Adds frame buffer helper for pixel access/conversion. |
| devices/Gc0308/samples/packages.config | Declares sample project NuGet dependencies. |
| devices/Gc0308/samples/Gc0308.Samples.nfproj | Adds the nanoFramework project file for the sample. |
| devices/Gc0308/samples/Program.cs | Adds sample program demonstrating driver configuration and register reads. |
| devices/Gc0308/samples/Properties/AssemblyInfo.cs | Adds assembly metadata for the sample. |
💡 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.
| // Office / Incandescent (~3200K) | ||
| new byte[] { 0x48, 0x40, 0x5C }, | ||
|
|
||
| // Home / Fluorescent (~4000K) | ||
| new byte[] { 0x40, 0x42, 0x50 }, |
| public void SetSpecialEffect(SpecialEffect effect) | ||
| { | ||
| byte index = (byte)effect; | ||
| if (index >= Gc0308Config.SpecialEffectValues.Length) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| UpdateRegisterBits(Gc0308Register.SpecialEffect, 0x03, Gc0308Config.SpecialEffectValues[index]); | ||
| } |
| <package id="nanoFramework.CoreLibrary" version="1.17.12" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.Graphics.Core" version="1.2.45" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.2.862" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Device.I2c" version="1.1.29" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Device.Model" version="1.2.862" targetFramework="netnano1.0" /> | ||
| <package id="Nerdbank.GitVersioning" version="3.9.50" developmentDependency="true" targetFramework="netnano1.0" /> | ||
| <package id="StyleCop.MSBuild" version="6.2.0" targetFramework="netnano1.0" developmentDependency="true" /> |
| <package id="nanoFramework.CoreLibrary" version="1.17.12" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.Hardware.Esp32" version="1.6.37" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.2.862" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Device.I2c" version="1.1.29" targetFramework="netnano1.0" /> | ||
| <package id="nanoFramework.System.Device.Model" version="1.2.862" targetFramework="netnano1.0" /> |
| <Reference Include="mscorlib, Version=1.17.12.0, Culture=neutral, PublicKeyToken=c07d481e9758c731"> | ||
| <HintPath>packages\nanoFramework.CoreLibrary.1.17.12\lib\mscorlib.dll</HintPath> |
| else if (_format == OutputFormat.YCbCr422) | ||
| { | ||
| SetPixelYCbCr422(x, y, color); | ||
| } |
| ushort colStart = (640 - 352) / 2; | ||
| ushort rowStart = (480 - 288) / 2; | ||
| SetWindowInternal(colStart, rowStart, (ushort)(352 + 8), (ushort)(288 + 8)); | ||
| break; |
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} |
| <dependencies> | ||
| <dependency id="nanoFramework.CoreLibrary" version="1.17.12" /> | ||
| <dependency id="nanoFramework.Graphics.Core" version="1.2.45" /> | ||
| <dependency id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.2.862" /> | ||
| <dependency id="nanoFramework.System.Device.I2c" version="1.1.29" /> | ||
| <dependency id="nanoFramework.System.Device.Model" version="1.2.862" /> | ||
| </dependencies> |
| <Reference Include="mscorlib, Version=1.17.12.0, Culture=neutral, PublicKeyToken=c07d481e9758c731"> | ||
| <HintPath>..\packages\nanoFramework.CoreLibrary.1.17.12\lib\mscorlib.dll</HintPath> |
Description
Add GC0308
Motivation and Context
How Has This Been Tested?
To be tested
Screenshots
Types of changes
Checklist:
Summary by CodeRabbit