pub struct Pac { /* private fields */ }
Expand description
Collection of low-level PAC structs
This struct serves to guard access to the low-level PAC structs. It places
them behind an unsafe
barrier.
Normally, users trade the low-level PAC structs for the higher-level
clock::v2
API. However, in some cases, the clock::v2
API may not be
sufficient. In these cases, users can access the registers directly by
calling Pac::steal
to recover the PAC structs.
Implementations
sourceimpl Pac
impl Pac
sourcepub unsafe fn steal(self) -> (OSCCTRL, OSC32KCTRL, GCLK, MCLK)
pub unsafe fn steal(self) -> (OSCCTRL, OSC32KCTRL, GCLK, MCLK)
Escape hatch allowing to access low-level PAC structs
Consume the Pac
and return the low-level PAC structs. This is
useful when the clock::v2
API does not provide a necessary feature, or
when dealing with the legacy clock::v1
API. For example, many of the
clock::v1
functions require access to the MCLK
peripheral.
Safety
Directly configuring clocks through the PAC API can invalidate the
type-level guarantees of the clock
module API.