/LibMpsseNet

F# thin wrapper around FTDI Chip Multi Protocol Synchronous Serial Engine (MPSSE) 1.0.5.

Primary LanguageF#

LibMpsseNet

LibMpsseNet is a thin F# wrapper for FTDI Chip Multi Protocol Synchronous Serial Engine (MPSSE) library 1.0.5.

MPSSE provides a flexible means of interfacing synchronous serial devices to a USB port. The FT-serices device supported includes the FT2232D, FT2232H, FT4232H and FT232H.

Requirements

LibMpsseNet requires libmpsse.lib C library to be present from the LibMPSSE library.

API

API closely follows the API in the MPSSE documentation that can be found in the FTDI Chip Application Notes.

AN 177 User Guide for LibMPSSE-I2C

AN 178 User Guide for LibMPSSE-SPI

Example

use lib = useLibMpsse ()
    
let config =
    { ClockRate = I2cClockRate.FastMode
      LatencyTimer = 255uy
      Enable3PhaseClocking = true
      EnableLoopback = false
      EnableClockStretching = false
      PinStateConfig = Disable }
        
let status =
    i2cOpenChannel 0u
    |> Result.bind (i2cInitChannel config)

// some code
    
status
|> Result.map i2cCloseChannel
|> ignore