Skip to content

[WIP] Sketch out an API for managing interrupts#28

Draft
Rahix wants to merge 1 commit intomainfrom
interrupts
Draft

[WIP] Sketch out an API for managing interrupts#28
Rahix wants to merge 1 commit intomainfrom
interrupts

Conversation

@Rahix
Copy link
Owner

@Rahix Rahix commented Mar 31, 2024

Example usage:

let pca_irq = todo!("GPIO pin of the MCU");
let mut pca9555 = port_expander::Pca9555::new(i2c, true, false, false);
let pca_pins = pca9555.split();

loop {
    // Wait for an interrupt
    while !pca_irq.is_low() {}

    // Read info
    let changed: [bool; 2] = port_expander::fetch_pin_change([&pca_pins.io0_0, &pca_pins.io0_3]).unwrap();
}

@Rahix Rahix force-pushed the interrupts branch 2 times, most recently from 238775e to 6331614 Compare March 31, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant