Giter VIP home page Giter VIP logo

ftd2xx-embedded-hal's Introduction

ARCHIVED

This has been superseded by ftdi-embedded-hal.

Maintenance crates.io docs.rs Build Status

ftd2xx-embedded-hal

Inspired by ftdi-embedded-hal this is an embedded-hal implementation for the for the FTDI chips using the libftd2xx drivers.

This enables development of embedded device drivers without the use of a microcontroller. The FTDI D2xx devices interface with your PC via USB, and provide a multi-protocol synchronous serial engine to interface with most UART, SPI, and I2C embedded devices.

Note: This is strictly a development tool. The crate contains runtime borrow checks and explicit panics to adapt the FTDI device into the embedded-hal traits.

Quickstart

  • Enable the "static" feature flag to use static linking.
  • Linux users only: Add udev rules.
[dependencies.ftd2xx-embedded-hal]
version = "~0.9.1"
features = ["static"]

Examples

SPI

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

let ftdi = Ft232hHal::new()?.init_default()?;
let mut spi = ftdi.spi()?;

I2C

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

let ftdi = Ft232hHal::new()?.init_default()?;
let mut i2c = ftdi.i2c()?;

GPIO

use embedded_hal::prelude::*;
use ftd2xx_embedded_hal::Ft232hHal;

let ftdi = Ft232hHal::new()?.init_default()?;
let mut gpio = ftdi.ad6();

Limitations

  • Limited trait support: SPI, I2C, Delay, and OutputPin traits are implemented.
  • Limited device support: FT232H, FT2232H, FT4232H.

ftd2xx-embedded-hal's People

Contributors

aholtzma-am avatar blisto91 avatar davidlattimore avatar dependabot[bot] avatar newam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ftd2xx-embedded-hal's Issues

Question: merge ftd2xx-embedded-hal and ftdi-embedded-hal

Hi @newAM

I planned to work on some updates for ftdi-embedded-hal including i2c fixes, gpio input support, mpsse commands handling and probably some other topics. Meanwhile some time ago I discovered your project ft2xx-embedded-hal. So I took a look at this project to compare approaches and probably to get some new ideas. I really liked what I saw, in particular your approach to MPSSE handling using command builder. My first intention was to port that approach to ftdi-embedded-hal. However after pondering a little bit about it, I think that a more reasonable option is to merge ftdi-embedded-hal into ftd2xx-embedded-hal adding some kind of libftdi backend.

From my perspective the plan looks as follows:

  • to split MPSSE command builder from libftd2xx-rs into a separate crate
  • to remove MPSSE related code duplication from libftd2xx-rs using this new crate
  • to extract low-level libftd2xx parts of ftd2xx-embedded-hal into a separate layer, e.g. using traits to define FTDI backend low-level operations such as open/read/write
  • to add libftdi support to your HAL, e.g. using Cargo features to choose between libftdi and libftd2xx
  • to continue adding features (e.g. gpio input) testing both backends

Naturally, before starting to hack around your crates and sending PRs, I would like to know what do you think about it.

Regards,
Sergey

I2C questions

Hi there.

Is the I2C implementation supposed to be working or is it still a bit too early?
My I2C circuit always seemed to reply with ack even when the power was off (using an ftdi calbe to talk with a seperate board) and then i started looking through the code a bit.
I noticed in the source things like ack's not getting handled.
Haven't looked at everything and have mostly toyed with the write function.

Like what you are doing so far and hope to replace my own hacky wrapper around libftd2xx-rs with this in the future.

Edit: Scratch the part about SDA not being driven high. That seems to have been my own fault.

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.