[−][src]Struct lpc81x_hal::Peripherals
Singleton container for the peripherals modeled by this HAL crate.
All of the functionality of this library begins in the Peripherals
singleton. The initial content represents the state of the system and
peripherals at reset (after the built-in bootloader launches the user
program) and these objects can be moved elsewhere to configure the
peripherals for a particular application.
All of the main interface peripherals take pin objects as arguments.
Unassigned pins start off in the pins
field of Peripheraps
, and can
be moved elsewhere to assign them to functions. This interface ensures
at compile time that two outputs cannot be sharing the same pin, which is
forbidden by the LPC81x "switch matrix" peripheral.
Fields
pins: Pins
The main accessors for the device pins.
pin_inputs: PinInputs
Alternative accessors for the device pins' digital inputs.
This is an alternative to pins
that provides access only to the input
parts, and crucially allows access to the input parts even when
ownership of the members of pins
have been transferred elsewhere.
spi0: SPI0<Inactive, Unassigned, Unassigned, Unassigned, Unassigned>
The first SPI device, initially inactive.
spi1: SPI1<Inactive, Unassigned, Unassigned, Unassigned, Unassigned>
The second SPI device, initially inactive.
This device is only present in models LPC812M101JDH16 and LPC812M101JDH20 (TSSOP packages).
Methods
impl Peripherals
[src]
pub fn take() -> Option<Self>
[src]
Obtain (only once) the singleton Peripherals object.
On subsequent calls, returns None
.
pub unsafe fn steal() -> Self
[src]
pub fn model(&self) -> Model
[src]
Returns a value representing the specific LPC8xx model of the current device, allowing dynamic inspection of some details that vary by model.
pub fn release_pac(self) -> Peripherals
[src]
Consumes the HAL-level peripherals to unwrap the PAC-level peripherhals.
pub unsafe fn steal_pac(&self) -> Peripherals
[src]
Returns the PAC-level peripherals while leaving the caller with ownership of the HAL-level peripherals too.
This is unsafe because the raw PAC peripherals API may be used to reconfigure the hardware in a way that the HAL isn't aware of.
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self