| Crates.io | vlfd-rs |
| lib.rs | vlfd-rs |
| version | 1.0.0 |
| created_at | 2025-09-24 06:14:10.107856+00 |
| updated_at | 2025-09-28 14:47:32.328113+00 |
| description | Modern Rust driver for the VLFD board |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1852560 |
| size | 36,124 |
vlfd-rs is a modern Rust driver for a VeriComm-compatible USB interface board. It exposes ergonomic APIs for bringing the hardware online, exchanging FIFO data, and programming the onboard FPGA fabric.
use vlfd_rs::{Device, IoSettings, Result};
fn main() -> Result<()> {
let mut device = Device::connect()?;
let mut settings = IoSettings::default();
device.enter_io_mode(&settings)?;
let mut tx = [0x1234u16; 4];
let mut rx = [0u16; 4];
device.transfer_io(&mut tx, &mut rx)?;
device.exit_io_mode()?;
Ok(())
}
Add the crate to your Cargo.toml:
[dependencies]
vlfd-rs = "1.0"
use vlfd_rs::{Device, HotplugEventKind, HotplugOptions};
fn main() -> vlfd_rs::Result<()> {
let device = Device::new()?;
let _registration = device.usb().register_hotplug_callback(
HotplugOptions::default(),
|event| match event.kind {
HotplugEventKind::Arrived => println!("Device arrived: {:?}", event.device),
HotplugEventKind::Left => println!("Device left: {:?}", event.device),
},
)?;
loop {
std::thread::sleep(std::time::Duration::from_secs(1));
}
}
Apache-2.0