Code Monkey home page Code Monkey logo

lib-usb3-ftdi's Introduction

usb3-ftdi

A Java device driver to access FTDI's UART/FIFO chips including the popular bitbang mode.

How to Use

Use the utility class FTDIUtility to find all FTDI devices attached to the host computer system. Set the serial port configuration and then read from and write to the device. e.g.

    // Grab the first found device:
    Collection<IUsbDevice> devices = FTDIUtility.findFTDIDevices();
    IUsbDevice usbDevice = devices.iterator().next();

    // Wrap and claim the generic USB device as a FTDI device
    // This sets the serial port configuration to [115200, 8, N, 1, N].
    FTDI ftdiDevice = FTDI.getInstance(usbDevice);

    // Write data to the FTDI device input buffer
    ftdiDevice.write(new byte[]{ .... } );

    // Read data from the FTDI device output buffer
    byte[] usbFrame = ftdiDevice.read();
    while (usbFrame.length > 0) {
      System.out.println("   READ " + usbFrame.length + " bytes: " + ByteUtility.toString(usbFrame));
      usbFrame = ftdi.read();
    }

Tested Compatibility

This (Java) library has been tested against, and is affirmed to support the following FTDI devices.

  • FTDI Devices: FT232BM/L/Q, FT245BM/L/Q, FT232RL/Q, FT245RL/Q, VNC1L with VDPS Firmware
    • idVendor : 0403
    • idProduct : 6001
  • FTDI Devices: FT2232C/D/L, FT2232HL/Q
    • idVendor : 0403
    • idProduct : 6010
  • FTDI Devices: FT4232HL/Q
    • idVendor : 0403
    • idProduct : 6011

The following FTDI chips should be supported:

  • FT4232H / FT2232H
  • FT232R / FT245R
  • FT2232L / FT2232D / FT2232C
  • FT232BM / FT245BM (and the BL/BQ variants)
  • FT8U232AM / FT8U245AM

Background

This (Java) device driver is based upon and translated from the original source code driver library in the C located here: libftdi. libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232D, FT245R and FT232H including the popular bitbang mode.

Limits

This JAVA implementation does not support EEPROM programming.

Requirements / Dependencies

This project requires javax-usb3, which is a JNI wrapper for libusb 1.x and with run-time implementations for Linux (actively supported) plus OSX and Windows (cross compiled).

License

Apache 2.0.

References

  • [FT232 UART](docs/FTDI FT232R_v104.pdf)
  • Application Notes:
    • [Determining USB Peripheral Device Class](docs/FTDI AN_174_Determining USB Peripheral Device Class.pdf)
    • [Baud Rates](docs/FTDI AN232B-05_BaudRates.pdf)
    • [Advanced Driver Options](docs/FTDI AN232B-10_Advanced_Driver_Options.pdf)
  • EEPROM bits and bytes
  • udev rules for Linux
  • libftdi

Contact

For more information about this and related software please contact Key Bridge

lib-usb3-ftdi's People

Contributors

keybridge avatar

Stargazers

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

Watchers

 avatar  avatar

lib-usb3-ftdi's Issues

How do set bit bang mode?

Hello. I would like to use bit bang mode. The original libftdi library has a ftdi_set_bitmode method. But unfortunately I cannot find anything similar in your wrapper. Could you tell me how you can set bit modes using your library?

Can not build the project in NetBeans

Here is the error code

Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:

May be the urls are too old now

.FileSystemNotFoundException calling FTDIUtility.findFTDIDevices()

I downloaded and built the latest lib-usb3-ftdi and tried a simple program that lists FTDI Devices like:

Collection<IUsbDevice> devices = FTDIUtility.findFTDIDevices();

but calling this just yields the following exception:

Exception in thread "main" java.nio.file.FileSystemNotFoundException
	at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
	at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
	at java.nio.file.Paths.get(Paths.java:143)
	at javax.usb3.utility.JNINativeLibraryLoader.load(JNINativeLibraryLoader.java:132)
	at javax.usb3.ri.UsbServices.<init>(UsbServices.java:85)
	at javax.usb3.UsbHostManager.getUsbServices(UsbHostManager.java:69)
	at javax.usb3.UsbHostManager.getUsbDeviceList(UsbHostManager.java:223)
	at com.ftdichip.usb.FTDIUtility.findFTDIDevices(FTDIUtility.java:151)
	at org.fogbeam.examples.libftdi.blink_led.BlinkLEDMain1.main(BlinkLEDMain1.java:17)

Any thoughts?

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.