Repository navigation
Adding FT200X - #2628
Adding FT200X#2628Ellerbach wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The test compilation blocker needs correction, and persistent MTP programming requires hardware-backed human validation.
1 open issue
What changed in this PR
Adds an FT200X I2C slave binding using shared FTDI infrastructure.
Changes:
- Adds USB FIFO access and explicit persistent address programming.
- Extends shared FT-X transport and configuration support.
- Adds tests, documentation, and a simulated temperature-sensor sample.
| File | Description |
|---|---|
| src/devices/FtCommon/IFtXSeriesI2cSlaveTransport.cs | Defines configuration operations. |
| src/devices/FtCommon/IFtI2cSlaveTransport.cs | Defines FIFO transport operations. |
| src/devices/FtCommon/FtXSeriesI2cSlaveTransport.cs | Implements native transport access. |
| src/devices/FtCommon/FtXSeriesEeprom.cs | Models FT-X configuration layout. |
| src/devices/FtCommon/FtXSeriesConfiguration.cs | Validates and compares configuration snapshots. |
| src/devices/FtCommon/FtFunction.cs | Adds native configuration and opening APIs. |
| src/devices/FtCommon/FtEepromHeader.cs | Models the common configuration header. |
| src/devices/FtCommon/FtCommon.projitems | Includes shared implementation files. |
| src/devices/FtCommon/FtCommon.cs | Handles enumeration failures. |
| src/devices/Ft200X/tests/TemperatureSensorTests.cs | Tests sensor protocol behavior. |
| src/devices/Ft200X/tests/FtXSeriesConfigurationTests.cs | Tests configuration copying and comparison. |
| src/devices/Ft200X/tests/Ft200XDeviceTests.cs | Tests binding behavior and lifetime. |
| src/devices/Ft200X/tests/Ft200X.Tests.csproj | Adds the test project. |
| src/devices/Ft200X/samples/TemperatureSensor.cs | Implements the simulated sensor protocol. |
| src/devices/Ft200X/samples/Program.cs | Demonstrates transfers and configuration. |
| src/devices/Ft200X/samples/Ft200X.sample.csproj | Adds the sample project. |
| src/devices/Ft200X/README.md | Documents wiring, usage, and programming precautions. |
| src/devices/Ft200X/Ft200XDevice.cs | Implements the public binding. |
| src/devices/Ft200X/Ft200X.slnx | Groups development projects. |
| src/devices/Ft200X/Ft200X.csproj | Configures the binding project. |
| src/devices/Ft200X/category.txt | Categorizes the binding. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
pgrawehr
left a comment
There was a problem hiding this comment.
Looks good. Seems useful to simulate I2C devices for testing.
| int count = adapter.Read(incoming.AsSpan(0, (int)Math.Min(available, (uint)incoming.Length))); | ||
| for (int i = 0; i < count; i++) | ||
| { | ||
| if (sensor.TryProcessByte(incoming[i], response)) |
There was a problem hiding this comment.
What about creating an abstraction that handles the reading from the adapter and forwarding to the sensor directly? This code isn't very flexible (e.g. for a typical sensor, the response length is dependent on the command), while still having quite a bit of complexity.
Just a suggestion.
There was a problem hiding this comment.
This is just a sample :-D Let me look at this but won't be able to test it before next week.
There was a problem hiding this comment.
@pgrawehr I made some adjustments to the sample, let me know if that works for you or if you had anything else in mind.
There was a problem hiding this comment.
@pgrawehr just tested the next sample and it's working. Let le know if that's what you had in mind, otherwise, I'll adjust a bit more.

Adding FT200X. This is a client I2C device from FTDI.
Adjusted the FTCommon project as there are more FTDI which can be setup as I2C client.
Added tests.
Added a sample with a fake temperature sensor. Make a real test with a real I2C master.
Microsoft Reviewers: Open in CodeFlow