| Crates.io | xum1541 |
| lib.rs | xum1541 |
| version | 0.3.2 |
| created_at | 2025-01-22 10:39:23.265758+00 |
| updated_at | 2025-04-22 10:19:59.147542+00 |
| description | Rust driver to access Commodore disk drives using xum1541 USB device |
| homepage | |
| repository | https://github.com/piersfinlayson/xum1541 |
| max_upload_size | |
| id | 1526495 |
| size | 230,438 |
A native Rust implementation of the xum1541 (ZoomFloppy) protocol for communicating with Commodore disk drives.
This project reimplements OpenCBM's xum1541 plugin natively in Rust, offering several key improvements:
Note, this is not a drop-in replacement for the OpenCBM plugin - it will not work with the OpenCBM library and applications.
cargo add xum1541
use xum1541::{BusBuilder, DeviceChannel, Error};
fn main() -> Result<(), Error> {
// Connect to the XUM1541 device via USB
let mut bus = BusBuilder::new().build()?;
// Initialize the bus
bus.initialize()?;
// Reset the IEC
bus.reset()?;
// Instuct device 8 to talk using channel 15
bus.talk(DeviceChannel::new(8, 15)?)?;
// Read up to 256 bytes of data from the drive
let mut data = vec![0u8; 256];
bus.read(&mut data)?;
// Print it out (this should be the drive status)
println!(
"Retrieved data from drive: {}",
std::str::from_utf8(&data).unwrap()
);
// Tell the drive to stop talking
bus.untalk()?;
// No need to close the XUM1541 device, it will be closed when bus goes
// out of scope
Ok(())
}
git clone https://github.com/piersfinlayson/xum1541.git
cd xum1541
cargo build --release
Run the test suite:
cargo test
Contributions are welcome! Please feel free to submit a Pull Request.
GPLv3
This project is under active development. Please report any issues or feature requests through GitHub issues.