drv

package
v0.0.0-...-b952502 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 0 Imported by: 0

README

ft232h/drv

GoDoc

Peripheral device drivers

The official device drivers required to control the FT232H are quite complex and require an understanding of microcontroller programming in C. This ft232h module greatly simplifies that programming interface, bridging many of those peripherals with the native Go ecosystem on a common PC.

Adding support for a peripheral device is straight-forward. There's no required Go interface patterns to implement. Each serial (and GPIO) capability of the FT232H is exposed as a named member of the type FT232H struct. Each member has its own conventional methods associated with it (configure, read, write, etc.), which a device driver can interact with directly.

The idea is to create a single driver package at drv/FOO to implement the definitions and procedures provided by each supported peripheral device. This would allow a consuming application to reuse one driver without having to import the entire driver library.

Alternatively, you can just interact with the ft232h module directly from an application.

See the godoc documentation for API details.

Supported devices

The following peripheral devices currently have driver support.

GPIO

TBD

SPI

  • ILI9341 - github.com/ardnew/ft232h/drv/ili9341
    • Driver for the ILI9341 320x240 TFT LCD chipset using ft232h.SPI and ft232h.GPIO interfaces – including methods to draw pixels, rectangles, and 16-bit RGB bitmaps.
    • boing - demo application

I²C

TBD

JTAG

TBD

UART

TBD

Documentation

Overview

Peripheral device driver packages based on github.com/ardnew/ft232h.

Developing Peripheral Device Drivers

TBD(andrew@ardnew.com): add driver development details

API Design

The design of this module API was intended to marry the following principles, ordered by importance, and the bulleted items underneath each are how they are realized:

  1. Simple / Concise –- Clear, consistent, conventional behavior - Document all exported features - Transparent infrastructure, auto-configure as much as possible - Minimize subtleties and unapparent side-effects (or document those that exist) - Prefer Go-native and fixed-size composite types - Design flexible, high-level protocol methods - Integrate command-line flags
  2. Robust / General Purpose -– Maximize peripheral device support - Provide clear, descriptive error messages - Integration test every revision automatically - Verify correct behavior at edge cases - Isolate system-dependent functionality - Expose low-level device methods for granular control
  3. Performant / Efficient –- Utilize resources effectively - Minimize USB transactions and HID interframe delays - Maximize throughput of serial protocol transfers

FTDI Native Drivers

FTDI uses a custom (vendor-defined) protocol to communicate with their USB devices and releases proprietary driver software `D2XX` (binary-only) that application programmers (see: YOU) should use with FTDI USB devices.

The `D2XX` driver is thus only available for systems officially supported by FTDI. These drivers are fairly low-level, containing only C source code headers and a thin user guide as documentation.

These drivers have been modified and recompiled into a single static library for each supported platform and distributed with this Go module, so the user isn't required to compile them on his/her own.

For more details and instructions on compiling the library yourself, refer to the godoc of package github.com/ardnew/ft232h/native.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL