lpc55-hal 0.5.0

Hardware Abstraction Layer (HAL) for the NXP LPC55S6x ARM Cortex-33 microcontrollers
Documentation
use crate::{peripherals::syscon, raw, typestates::init_state};

crate::wrap_stateful_peripheral!(InputMux, INPUTMUX);

impl<State> InputMux<State> {
    pub fn enabled(mut self, syscon: &mut syscon::Syscon) -> InputMux<init_state::Enabled> {
        syscon.enable_clock(&mut self.raw);

        InputMux {
            raw: self.raw,
            _state: init_state::Enabled(()),
        }
    }

    pub fn disabled(mut self, syscon: &mut syscon::Syscon) -> InputMux<init_state::Disabled> {
        syscon.disable_clock(&mut self.raw);

        InputMux {
            raw: self.raw,
            _state: init_state::Disabled,
        }
    }
}