PHPackages                             microscrap/ftdi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. microscrap/ftdi

ActiveLibrary[Framework](/categories/framework)

microscrap/ftdi
===============

libFTDI Bindings for The PHP FTDI Extension

0.4.1(1w ago)072MITPHPPHP ^8.3

Since May 21Pushed 1w agoCompare

[ Source](https://github.com/microscrap/ftdi)[ Packagist](https://packagist.org/packages/microscrap/ftdi)[ Docs](https://dosr.projectsaturnstudios.com)[ RSS](/packages/microscrap-ftdi/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (2)

microscrap/ftdi - libFTDI helper bindings for ScrapyardIO
=========================================================

[](#microscrapftdi---libftdi-helper-bindings-for-scrapyardio)

PHP helper library that wraps the [**ftdi** extension](https://github.com/php-io-extensions/ftdi) with global functions and enums. Each helper delegates to `Ftdi\FTDI`.

This project provides direct bindings to [libftdi1](https://www.intra2net.com/en/developer/libftdi/) through helper-style globals.

Highlights
----------

[](#highlights)

- C-ish global helper API (`ftdi_usb_open`, `ftdi_read_data`, etc.)
- Support for serial-only devices (for example FT232RL) and MPSSE-capable devices (for example FT232H)
- USB open/read/write/flush/reset operations
- EEPROM read/write/decode/build operations
- Async transfer submission and completion

Requirements
------------

[](#requirements)

- PHP 8.3+
- **ext-ftdi** ^0.4.0 - install from [php-io-extensions/ftdi](https://github.com/php-io-extensions/ftdi)
- Runtime dependency of ext-ftdi:
    - Debian/Ubuntu/Raspberry Pi OS: `libftdi1-2` (dev package for builds: `libftdi1-dev`)
    - macOS: `brew install libftdi`

Installation
------------

[](#installation)

Confirm **ext-ftdi** is loaded before using this package:

```
php -m | grep ftdi
```

Install the helper package:

```
composer require microscrap/ftdi
```

Composer autoloads `src/Helpers/ftdi.php`, registering global helpers when installed.

Usage
-----

[](#usage)

FTDI bindings are exposed as **global helper functions** (`ftdi_new`, `ftdi_usb_open`, etc). Helpers are only defined when a function name is not already taken (`function_exists` guard), matching the style used in other microscrap binding packages.

Optional enums are available under:

- `Microscrap\Bindings\FTDI\Enums\FtdiVendorId`
- `Microscrap\Bindings\FTDI\Enums\FtdiProductId`

```
