-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
/// A crate for controlling NetMD and Hi-MD devices. | ||
/// | ||
/// To use this library, first you need to get a device from [cross-usb] and then open [netmd::interface::NetMDInterface] | ||
//! A crate for controlling NetMD and Hi-MD devices. | ||
//! | ||
//! This crate is entirely `async` (a necessity because of USB in WASM), but | ||
//! it can be used in programs which are not async by using a crate like | ||
//! [futures_lite](https://docs.rs/futures-lite/) with the `block_on` function. | ||
//! | ||
//! To use this library, first you need to get a device from [`cross_usb`] and | ||
//! then open a [`NetMDContext`]. | ||
//! | ||
//! ```rust | ||
//! use cross_usb::prelude::get_device; | ||
//! use minidisc::netmd::base::DEVICE_IDS_CROSSUSB; | ||
//! use minidisc::NetMDContext; | ||
//! | ||
//! // Get a device using the built-in list of descriptors for minidisc devices | ||
//! let dev_descriptor = cross_usb::get_device(DEVICE_IDS_CROSSUSB).await | ||
//! .expect("Failed to find device"); | ||
//! | ||
//! // Open a NetMD Context with the device | ||
//! let context = NetMDContext::new(dev_descriptor).await | ||
//! .expect("Could not create context"); | ||
//! | ||
//! // Perform operations on it ... | ||
//! context.list_content().await | ||
//! .expect("Could not list disc contents"); | ||
//! ``` | ||
pub mod netmd; | ||
|
||
#[doc(inline)] | ||
pub use netmd::commands::NetMDContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters