usbsid_pico/lib.rs
1//! # usbsid-pico
2//! ## Quick start
3//!
4//! ```rust,no_run
5//! use usbsid_pico::UsbSid;
6//!
7//! fn main() -> Result<(), Box<dyn std::error::Error>> {
8//! let mut sid = UsbSid::new();
9//! sid.init(/* threaded */ true, /* with_cycles */ true)?;
10//!
11//! // Write register 0x01 with value 0x01
12//! sid.write_ring_cycled(0x01, 0x01, 0xFFFF)?;
13//!
14//! // Read a SID register (synchronous)
15//! let val = sid.single_read(0x1B)?;
16//! println!("OSC3 random: 0x{:02X}", val);
17//!
18//! // Driver is automatically closed on drop
19//! Ok(())
20//! }
21//! ```
22//!
23//! ## C FFI
24//!
25//! The crate also exposes a C-compatible interface through the [`ffi`] module
26//! so that existing C applications can link against this library as a drop-in
27//! replacement for the original `USBSIDInterface.h/.cpp`.
28//!
29//! ## Features
30//!
31//! * `debug_memory` – enable SID-memory tracking (mirrors `DEBUG_USBSID_MEMORY`
32//! from the C++ driver).
33
34pub mod constants;
35pub mod device;
36pub mod error;
37pub mod ffi;
38pub mod ringbuffer;
39pub mod transport;
40// Re-export the most commonly used types at crate root.
41pub use constants::{sid_address, ClockSpeed, RasterRate, RefreshRate};
42pub use device::UsbSid;
43pub use error::{Result, UsbSidError};