vlfd-rs 2.0.1

Modern Rust driver for the VLFD board
Documentation

vlfd-rs

vlfd-rs is a Rust driver for a VeriComm-compatible USB interface board. This release redesigns the public API around explicit sessions:

  • Board: owns the USB connection and cached device state
  • IoSession: handles VeriComm FIFO transfers
  • ProgramSession: handles FPGA programming transfers
  • Programmer: convenience wrapper for bitstream upload flows

Features

  • Pure-Rust USB transport powered by nusb
  • Explicit board / I/O / programming session boundaries
  • Reusable-buffer output APIs for lower-allocation I/O paths
  • High-level configuration refresh and write helpers
  • Bitstream upload support for the integrated FPGA programmer
  • Hotplug callbacks powered by a nusb-based polling watcher

Quick Start

use vlfd_rs::{Board, IoConfig, Result};

fn main() -> Result<()> {
    let mut board = Board::open()?;
    let mut io = board.configure_io(&IoConfig::default())?;

    let tx = [0x1234u16; 4];
    let mut rx = [0u16; 4];
    io.transfer(&tx, &mut rx)?;

    io.finish()?;
    Ok(())
}

Programming Example

use std::path::Path;
use vlfd_rs::{Programmer, Result};

fn main() -> Result<()> {
    let mut programmer = Programmer::open()?;
    programmer.program(Path::new("path/to/bitstream.txt"))?;
    programmer.close()?;
    Ok(())
}

Installation

Add the crate to your Cargo.toml:

[dependencies]
vlfd-rs = "2.0.0"

API Notes

  • This is a breaking release; the old monolithic Device API is removed
  • Transport remains blocking from the public API perspective
  • Internally the USB layer uses nusb and MaybeFuture::wait()

Benchmarking

cargo run --example bench_transfer -- cpu --words 1024 --iterations 200000
cargo run --example bench_transfer -- device --words 512 --iterations 1000

License

Apache-2.0