Code Monkey home page Code Monkey logo

ftdi-embedded-hal-archive's Introduction

NOTE

Check new ftdi-embedded-hal project in the ftdi-rs organization for the up-to-date implementation of FTDI MPSSE embedded HAL.


ftdi-embedded-hal

Implementation of the embedded-hal traits for FTDI chips supporting Multi Protocol Synchronous Serial Engine (MPSSE).

This implementation of embedded-hal allows you to work with various SPI/I2C devices over USB. If your Linux board has accessible I2C or SPI pins, then it is possible to connect I2C/SPI devices directly. For this purpose linux-embedded-hal implementation of embedded-hal traits can be used. However normal Linux workstations usually do not have direct access to SPI/I2C, but have enough USB ports. In this case ftdi-embedded-hal can be used. For instance, this may come particularly handy for playing with various I2C/SPI devices, e.g. trying them out or working on driver development.

Devices

Currently support for GPIO/SPI/I2C on FT232H and FT2232H chips has been implemented. There are many development boards and modules for FTDI chips. The following modules have been used for development and testing:

Features, limitations, TODO

Brief list of features supported out of the box:

  • supported devices: FT232H, FT2232H
  • MPSSE mode is supported, no pure bit-banging support
  • SPI/I2C/GPIO support
    • SPI
      • MODE0, MODE2
      • 500kHz, 1MHz, 3MHz, 5MHz
    • I2C bus
      • 100kHz, 400kHz
    • GPIO
      • output mode only

Limitations:

  • FTDI device is selected by USB PID/VID, so only the first connected device will be handled
  • no gpio input support
  • i2c/spi are mutually exclusive due to h/w circuitry (not sure if anything can be done from s/w side to support both simultaneously)
  • GPIO functionality is disabled for ADBUS[0..3] and BDBUS[0..4] pins (SK/DI/DO/CS)
  • no support for SPI MODE1 and MODE3 (not sure if anything can be done from s/w side as this is a limitation for FTDI chips)
  • not enough flexibility in clock selection
    • fixed list of suppported SPI/I2C frequencies
    • clock is selected once for the first bus instance and should be the same for all the other bus instances, runtime changes are not supported
  • tests can be run only when FTDI devices are connected

TODO:

  • more cleanup and refactoring in terms of idiomatic Rust
  • suppport several connected FTDI devices with the same USB PID/VID
  • enable ADBUS[0..3] and BDBUS[0..3] pins as GPIO pins as well, just keep track of selected functionality, it is already done anyway to disable i2c and spi at the same time
  • add gpio input support
  • add support for FT4232H
  • more flexibility in clock configuration (?)
  • add more I2C/SPI/GPIO examples/tests, e.g. 74HC595, MCP3008, PCF8574, and more

Circuit examples

SPI nRF24L01+ breakout board

alt text

I2C EEPROM at24c04

alt text

Useful documents and links

Projects

Data sheets for FTDI chips and development modules:

Application notes provided by FTDI:

ftdi-embedded-hal-archive's People

Contributors

barafael avatar brandonedens avatar geomatsi avatar newam avatar rappet avatar riktw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ftdi-embedded-hal-archive's Issues

FTDI device failures will result in a failure to drop.

On an FTDI device failure drop will also fail because the mutex is poisoned.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: UnexpectedEof, error: "failed to fill whole buffer" }', ftdi-embedded-hal/src/gpio.rs:86:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', ftdi-embedded-hal/src/x232h.rs:222:20

not work with ssd1306

I have attach a logic analyzer, the result show that it setup write to 0x78 correctly, but without slave ack.

I have struggled with this device many days, look like a hardware interface issue. It work with raspberry pi , but not with FT2232H module.

I would like to know, did anyone ever success with a ssd1306 device?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.