Iocon

Struct Iocon 

Source
pub struct Iocon { /* private fields */ }

Implementations§

Source§

impl Iocon

Source

pub const fn new() -> Self

Source

pub fn configure_pin(&self, pin: LPCPin, config: Config)

Configures the function, pull mode, and digital mode of a given pin.

§Overview

This function applies a standard configuration value to the selected pin, based on the provided Config settings:

  • function: the peripheral function assigned to the pin
  • pull: the pull-up/pull-down resistor configuration
  • digital_mode: whether the pin is used in digital mode
§Current Limitations

At the moment, only GPIO and alarm functionality are supported. Many pins are commented out in the match statement because they belong to peripherals (e.g., UART, SPI, I2C, etc.) that are not yet implemented. These pins will require additional configuration logic once their corresponding peripheral drivers are added.

§Notes
  • Pins such as P1_4 (on-board blue LED) and P1_9 (user button) are already supported for basic GPIO usage.
  • Attempting to configure a pin that is not yet implemented will result in no action (_ => {} branch).
§Future Work

As new peripherals are implemented for the lpc55sx, the commented-out pin entries will be enabled and configured accordingly.

§Example
// Configure P0_0 as a GPIO output with pull-up enabled
device.configure_pin(LPCPin::P0_0, Config {
    function: Function::Gpio,
    pull: Pull::Up,
    digital_mode: DigitalMode::Enabled,
});
Source

pub fn set_pull_none(&self, pin: LPCPin)

Source

pub fn set_pull_up(&self, pin: LPCPin)

Source

pub fn set_pull_down(&self, pin: LPCPin)

Auto Trait Implementations§

§

impl Freeze for Iocon

§

impl !RefUnwindSafe for Iocon

§

impl !Send for Iocon

§

impl !Sync for Iocon

§

impl Unpin for Iocon

§

impl !UnwindSafe for Iocon

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.