pub struct Iocon { /* private fields */ }Implementations§
Source§impl Iocon
impl Iocon
pub const fn new() -> Self
Sourcepub fn configure_pin(&self, pin: LPCPin, config: Config)
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 pinpull: the pull-up/pull-down resistor configurationdigital_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) andP1_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,
});pub fn set_pull_none(&self, pin: LPCPin)
pub fn set_pull_up(&self, pin: LPCPin)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more