Add safety docs from atsamd-rs to GPIO traits

This commit is contained in:
9names 2021-12-03 21:47:29 +11:00
parent 5dafe3985f
commit a7d5dc2bee
2 changed files with 14 additions and 0 deletions

View file

@ -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.

View file

@ -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.