Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

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