Y2.Ft4222.Core 1.0.5

dotnet add package Y2.Ft4222.Core --version 1.0.5
NuGet\Install-Package Y2.Ft4222.Core -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Y2.Ft4222.Core" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Y2.Ft4222.Core --version 1.0.5
#r "nuget: Y2.Ft4222.Core, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Y2.Ft4222.Core as a Cake Addin
#addin nuget:?package=Y2.Ft4222.Core&version=1.0.5

// Install Y2.Ft4222.Core as a Cake Tool
#tool nuget:?package=Y2.Ft4222.Core&version=1.0.5

USB-I2C変換ボード用ドライバ

FTDI社の FT4222H を介して、USBからI2Cデバイスを制御する為のドライバです。
Windows・Linux・Mac で使用できます。

対応ハードウェア

セットアップ

  1. Visual Studioで、プロジェクトを新規作成するか既存のプロジェクトを開きます。
    (.NETに対応したプロジェクト)

  2. NuGetパッケージの「Y2.Ft4222.Core」をインストールします。

    • ソリューションエクスプローラーからプロジェクトを右クリックして「NuGetパッケージの管理」をクリックします。
    • タブを「参照」にして、パッケージソースを「nuget.org」にします。
    • 検索窓に「Y2.Ft」を入力すると「Y2.Ft4222.Core」が見つかりますので選択します。
    • バージョンは「最新の安定版」にして「インストール」をクリックします。
  3. FTDI社のライブラリ(デバイスドライバ含む)を以下の各OSの手順にしたがってインストールします。

    Windows 64bit

    • FT4222Hの製品ページ の「Downloads」から「LibFT4222 Windows Library」をダウンロードして解凍します。
    • LibFT4222-vx.x.x\imports\LibFT4222\lib\amd64\LibFT4222-64.dll をアプリケーションの実行可能ファイルと同じディレクトリにコピーします。
    • LibFT4222-64.dllLibFT4222.dll に名前を変更します。

    (レジストリ登録やPATHで登録しても可)

    Windows 32bit

    • FT4222Hの製品ページ の「Downloads」から「LibFT4222 Windows Library and Examples」をダウンロードして解凍します。
    • LibFT4222-vx.x.x\imports\LibFT4222\lib\i386\LibFT4222.dll をアプリケーションの実行可能ファイルと同じディレクトリにコピーします。

    (レジストリ登録やPATHで登録しても可)

    Linux

    • FT4222Hの製品ページ の「Downloads」から「LibFT4222 Linux Library and Examples」をダウンロードして解凍します。
    • 管理者権限で install4222.sh を実行します。

    Mac

使用方法

// スレーブアドレス 0x26のデバイスにアクセスできるようにインスタンスを生成。I2Cクロック周波数は400kHz。
var i2c = new Ft4222I2cMaster(new Ft4222I2cConnectionSettings(0, 0x26, 400));

// 読み出し
Span<byte> buffer = stackalloc byte[2];
i2c.Read(buffer);

// 書き込み
byte[] writeBuffer = { 0x12, 0x34 };
i2c.Write(writeBuffer);

// I2cMasterFlagsを指定しての読み出し
i2c.ReadEx(I2cMasterFlags.RepeatedStart, buffer);

// I2cMasterFlagsを指定しての書き込み
i2c.WriteEx(I2cMasterFlags.RepeatedStart, writeBuffer);

// Ft4222I2cMasterインスタンス生成時と異なるデバイス(スレーブアドレス 0x23)から読み出し
i2c.Read(0x23, buffer);

// Ft4222I2cMasterインスタンス生成時と異なるデバイス(スレーブアドレス 0x23)に書き込み
i2c.Write(0x23, writeBuffer);

MicrosoftのIot.DeviceのI2Cデバイスに渡して使用する事もできます。

var i2c = new Ft4222I2cMaster(new Ft4222I2cConnectionSettings(0, 0x26, 400));

var bno055Sensor = new Bno055Sensor(i2c);

Console.WriteLine($"Id: {bno055Sensor.Info.ChipId}, AccId: {bno055Sensor.Info.AcceleratorId}, GyroId: {bno055Sensor.Info.GyroscopeId}, MagId: {bno055Sensor.Info.MagnetometerId}");
Console.WriteLine($"Firmware version: {bno055Sensor.Info.FirmwareVersion}, Bootloader: {bno055Sensor.Info.BootloaderVersion}");
Console.WriteLine($"Temperature source: {bno055Sensor.TemperatureSource}, Operation mode: {bno055Sensor.OperationMode}, Units: {bno055Sensor.Units}");
Console.WriteLine($"Powermode: {bno055Sensor.PowerMode}");

関連プロジェクト

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Y2.Ft4222.Core:

Package Downloads
Y2.Dio84ReUbc.Core

USB2.0 to I2C/IO Board Drivers for DIO-8/4RE-UBC.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 168 9/15/2023
1.0.4 503 7/13/2022
1.0.3 451 8/25/2020
1.0.2 823 8/21/2020
1.0.1 537 8/20/2020
1.0.0 502 8/20/2020