Skip to main content

vlfd_rs/
lib.rs

1//! # vlfd-rs
2//!
3//! `vlfd-rs` 3.x models the device around explicit sessions instead of a
4//! single stateful façade. Open a [`Board`] to inspect and configure the
5//! hardware, then create dedicated sessions for I/O or programming.
6//!
7//! ```no_run
8//! use vlfd_rs::{Board, IoConfig, Result};
9//!
10//! fn main() -> Result<()> {
11//!     let mut board = Board::open()?;
12//!     let mut io = board.configure_io(&IoConfig::default())?;
13//!
14//!     let tx = [0x1234u16; 4];
15//!     let mut rx = [0u16; 4];
16//!     io.transfer_into(&tx, &mut rx)?;
17//!     io.finish()?;
18//!     Ok(())
19//! }
20//! ```
21//!
22//! ```no_run
23//! use std::path::Path;
24//! use vlfd_rs::{Programmer, Result};
25//!
26//! fn main() -> Result<()> {
27//!     let mut programmer = Programmer::open()?;
28//!     programmer.program(Path::new("path/to/bitstream.txt"))?;
29//!     programmer.close()?;
30//!     Ok(())
31//! }
32//! ```
33
34pub mod constants;
35
36mod config;
37mod error;
38mod program;
39mod session;
40mod usb;
41
42pub use config::Config;
43pub use error::{Error, Result};
44pub use program::{Programmer, load_bitfile, load_bitfile_from_reader};
45pub use session::{
46    Board, BoardMode, IoConfig, IoSession, IoTransferWindow, ProgramSession, TransferStageProfile,
47};
48pub use usb::{
49    HotplugDeviceInfo, HotplugEvent, HotplugEventKind, HotplugOptions, HotplugRegistration, Probe,
50    TransportConfig,
51};