mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-24 05:01:31 +11:00
Add safety docs from atsamd-rs to GPIO traits
This commit is contained in:
parent
5dafe3985f
commit
a7d5dc2bee
|
@ -109,6 +109,13 @@ impl From<DynPinMode> for ModeFields {
|
|||
fields
|
||||
}
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// Users should only implement the [`id`] function. No default function
|
||||
/// implementations should be overridden. The implementing type must also have
|
||||
/// "control" over the corresponding pin ID, i.e. it must guarantee that each
|
||||
/// pin ID is a singleton
|
||||
pub(super) unsafe trait RegisterInterface {
|
||||
/// Provide a [`DynPinId`] identifying the set of registers controlled by
|
||||
/// this type.
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
use super::dyn_slice::{DynSliceId, DynSliceMode};
|
||||
use pac::pwm::CH;
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// Users should only implement the [`id`] function. No default function
|
||||
/// implementations should be overridden. The implementing type must also have
|
||||
/// "control" over the corresponding slice ID, i.e. it must guarantee that each
|
||||
/// slice ID is a singleton
|
||||
pub(super) unsafe trait RegisterInterface {
|
||||
/// Provide a [`DynSliceId`] identifying the set of registers controlled by
|
||||
/// this type.
|
||||
|
|
Loading…
Reference in a new issue