Skip to content

Commit e5c3b06

Browse files
committed
tock-registers: add documentation pointing to manipulator-traits
Using traits exposing the manipulator methods, instead of directly offering the methods on the register types themselves, hides them from the generated Rustdoc documentation. Explicitly point to these traits in the top-level register type documentation. Signed-off-by: Leon Schuermann <[email protected]>
1 parent e511041 commit e5c3b06

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

libraries/tock-register-interface/src/registers.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ where
232232
}
233233

234234
/// Read/Write registers.
235+
///
236+
/// For accessing and manipulating the register contents, the
237+
/// [`Readable`], [`Writeable`] and [`ReadWriteable`] traits are
238+
/// implemented.
235239
// To successfully alias this structure onto hardware registers in memory, this
236240
// struct must be exactly the size of the `T`.
237241
#[repr(transparent)]
@@ -259,6 +263,9 @@ impl<T: IntLike, R: RegisterLongName> Writeable for ReadWrite<T, R> {
259263
}
260264

261265
/// Read-only registers.
266+
///
267+
/// For accessing the register contents the [`Readable`] trait is
268+
/// implemented.
262269
// To successfully alias this structure onto hardware registers in memory, this
263270
// struct must be exactly the size of the `T`.
264271
#[repr(transparent)]
@@ -277,6 +284,9 @@ impl<T: IntLike, R: RegisterLongName> Readable for ReadOnly<T, R> {
277284
}
278285

279286
/// Write-only registers.
287+
///
288+
/// For setting the register contents the [`Writeable`] trait is
289+
/// implemented.
280290
// To successfully alias this structure onto hardware registers in memory, this
281291
// struct must be exactly the size of the `T`.
282292
#[repr(transparent)]
@@ -333,6 +343,14 @@ impl<T: IntLike, R: RegisterLongName, W: RegisterLongName> Writeable for Aliased
333343
}
334344

335345
/// In memory volatile register.
346+
///
347+
/// Like [`ReadWrite`], but can be safely constructed using the
348+
/// [`InMemoryRegister::new`] method. It will always be initialized to
349+
/// the passed in, well-defined initial value.
350+
///
351+
/// For accessing and manipulating the register contents, the
352+
/// [`Readable`], [`Writeable`] and [`ReadWriteable`] traits are
353+
/// implemented.
336354
// To successfully alias this structure onto hardware registers in memory, this
337355
// struct must be exactly the size of the `T`.
338356
#[repr(transparent)]

0 commit comments

Comments
 (0)