Skip to content
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

Rename Ft232h to Ftxxxx #913

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Main Build
on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectReference Include="..\..\..\..\..\..\Meadow.Core\source\implementations\windows\Meadow.Windows\Meadow.Windows.csproj" />
<ProjectReference Include="..\..\..\..\..\..\Meadow.Core\source\Meadow.Core\Meadow.Core.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\Displays.TftSpi\Driver\Displays.TftSpi.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\ICs.IOExpanders.Ft232h\Driver\ICs.IOExpanders.Ft232h.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\ICs.IOExpanders.Ftxxxx\Driver\ICs.IOExpanders.Ftxxxx.csproj" />
<ProjectReference Include="..\..\Driver\Graphics.MicroLayout.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectReference Include="..\..\..\..\..\..\Meadow.Core\source\implementations\windows\Meadow.Windows\Meadow.Windows.csproj" />
<ProjectReference Include="..\..\..\..\..\..\Meadow.Core\source\Meadow.Core\Meadow.Core.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\Displays.Max7219\Driver\Displays.Max7219.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\ICs.IOExpanders.Ft232h\Driver\ICs.IOExpanders.Ft232h.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation.Peripherals\ICs.IOExpanders.Ftxxxx\Driver\ICs.IOExpanders.Ftxxxx.csproj" />
<ProjectReference Include="..\..\Driver\Graphics.MicroLayout.csproj" />
</ItemGroup>

Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@

namespace Meadow.Foundation.ICs.IOExpanders;

public class Ft2232Expander : FtdiExpander
/// <summary>
/// Represents an FT2232 USB IO expander
/// </summary>
public class Ft2232 : FtdiExpander
{
internal Ft2232Expander()
internal Ft2232()
{
}

/// <inheritdoc/>
public override II2cBus CreateI2cBus(int channel = 0, I2cBusSpeed busSpeed = I2cBusSpeed.Standard)
{
// TODO: depends on part
// TODO: make sure no SPI is in use
var bus = new Ft23xxxI2cBus(this, busSpeed);
var bus = new Ft23xxI2cBus(this, busSpeed);
bus.Configure();
return bus;
}

/// <inheritdoc/>
public override ISpiBus CreateSpiBus(int channel, SpiClockConfiguration configuration)
{
// TODO: make sure no SPI is in use

throw new NotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace Meadow.Foundation.ICs.IOExpanders;

public class Ft232hExpander : FtdiExpander
/// <summary>
/// Represents an FT232H USB IO expander
/// </summary>
public class Ft232h : FtdiExpander
{
internal Ft232hExpander()
internal Ft232h()
{
}

Expand All @@ -22,9 +25,8 @@ public override II2cBus CreateI2cBus(int channel = 0, I2cBusSpeed busSpeed = I2c
public override ISpiBus CreateSpiBus(int channel, SpiClockConfiguration configuration)
{
// TODO: make sure no SPI is in use

var bus = new Ft232hSpiBus(this, configuration);
bus.Configure();
return bus;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Meadow.Hardware;
using System;

namespace Meadow.Foundation.ICs.IOExpanders;

/// <summary>
/// Represents an FT4232 USB IO expander
/// </summary>
public class Ft4232 : FtdiExpander
{
internal Ft4232()
{
}

/// <inheritdoc/>
public override II2cBus CreateI2cBus(int channel = 0, I2cBusSpeed busSpeed = I2cBusSpeed.Standard)
{
// TODO: depends on part
var bus = new Ft23xxI2cBus(this, busSpeed);
bus.Configure();
return bus;
}

/// <inheritdoc/>
public override ISpiBus CreateSpiBus(int channel, SpiClockConfiguration configuration)
{
throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Meadow.Foundation.ICs.IOExpanders;

public abstract partial class FtdiExpander
{
public class Ft23xxxI2cBus : I2CBus, II2cBus
public class Ft23xxI2cBus : I2CBus, II2cBus
{
internal Ft23xxxI2cBus(FtdiExpander expander, I2cBusSpeed busSpeed)
internal Ft23xxI2cBus(FtdiExpander expander, I2cBusSpeed busSpeed)
: base(expander, busSpeed)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal static FtdiExpander Create(
{
FtdiExpander expander = deviceType switch
{
FtDeviceType.Ft232H => new Ft232hExpander
FtDeviceType.Ft232H => new Ft232h
{
Index = index,
Flags = flags,
Expand All @@ -60,7 +60,7 @@ internal static FtdiExpander Create(
Description = description,
Handle = handle
},
FtDeviceType.Ft2232 => new Ft2232Expander
FtDeviceType.Ft2232 => new Ft2232
{
Index = index,
Flags = flags,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<Version>1.9.0</Version>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
<Authors>Wilderness Labs, Inc</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<AssemblyName>Ft2xxx</AssemblyName>
<Company>Wilderness Labs, Inc</Company>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageId>Meadow.Foundation.ICs.IOExpanders.Ft232h</PackageId>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation</RepositoryUrl>
<PackageTags>Meadow.Foundation,IOExpanders,expander,IO,Ft232h,ft2232,ft4232</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Ft2xxx family of USB IOExpanders for GPIO, I2C, SPI on Windows</Description>
</PropertyGroup>
<ItemGroup>
<None Include=".\Readme.md" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<None Include="..\..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
Loading
Loading