Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reexport tock-registers interfaces #20

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,8 @@ It might compile with older versions but that may change in any new patch releas
## Usage

Please note that for using this crate's [register definitions](src/registers) (as provided by
`aarch64_cpu::registers::*`), you need to also include
[`tock-registers`](https://crates.io/crates/tock-registers) in your project. This is because the
`interface` traits provided by `tock-registers` are implemented by this crate. You should include
the same version of `tock-registers` as is being used by this crate to ensure sane
interoperatbility.

For example, in the following snippet, `X.Y.Z` should be the same version of `tock-registers` that
is mentioned in `aarch64-cpu`'s [`Cargo.toml`](Cargo.toml#L23).

```toml
[package]
name = "Your embedded project"

# Some parts omitted for brevity.

[dependencies]
tock-registers = "X.Y.Z"
aarch64-cpu = "A.B.C" # <-- Includes tock-registers itself.
```
`aarch64_cpu::registers::*`), you need to also import
`aarch64_cpu::registers::{Readable, Writeable}`.

### Example

Expand All @@ -44,7 +27,6 @@ below is a snippet of `rust-raspberrypi-OS-tutorials`'s early boot code.

```rust
use aarch64_cpu::{asm, registers::*};
use tock_registers::interfaces::Writeable; // <-- Trait needed to use `write()` and `set()`.

// Some parts omitted for brevity.

Expand Down
22 changes: 2 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,8 @@
//! ## Usage
//!
//! Please note that for using this crate's [register definitions](src/registers) (as provided by
//! `aarch64_cpu::registers::*`), you need to also include
//! [`tock-registers`](https://crates.io/crates/tock-registers) in your project. This is because the
//! `interface` traits provided by `tock-registers` are implemented by this crate. You should
//! include the same version of `tock-registers` as is being used by this crate to ensure sane
//! interoperatbility.
//!
//! For example, in the following snippet, `X.Y.Z` should be the same version of `tock-registers`
//! that is mentioned in `aarch64-cpu`'s [`Cargo.toml`](Cargo.toml#L27).
//!
//! ```toml
//! [package]
//! name = "Your embedded project"
//!
//! # Some parts omitted for brevity.
//!
//! [dependencies]
//! tock-registers = "X.Y.Z"
//! aarch64-cpu = "A.B.C" # <-- Includes tock-registers itself.
//! ```
//! `aarch64_cpu::registers::*`), you need to also import [`Readable`](registers::Readable) and
//! [`Writeable`](registers::Writeable).
//!
//! ### Example
//!
Expand All @@ -37,7 +20,6 @@
//!
//! ```rust
//! use aarch64_cpu::{asm, registers::*};
//! use tock_registers::interfaces::Writeable; // <-- Trait needed to use `write()` and `set()`.
//!
//! // Some parts omitted for brevity.
//!
Expand Down
3 changes: 3 additions & 0 deletions src/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,6 @@ pub use vbar_el2::VBAR_EL2;
pub use vbar_el3::VBAR_EL3;
pub use vtcr_el2::VTCR_EL2;
pub use vttbr_el2::VTTBR_EL2;

#[doc(inline)]
pub use tock_registers::interfaces::{Readable, Writeable};