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

GPIO is_low output differs from rppal v0.17.0 impl compared to embedded-hal v1 impl #137

Closed
TeyKey1 opened this issue Jan 20, 2024 · 0 comments · Fixed by #138
Closed

GPIO is_low output differs from rppal v0.17.0 impl compared to embedded-hal v1 impl #137

TeyKey1 opened this issue Jan 20, 2024 · 0 comments · Fixed by #138

Comments

@TeyKey1
Copy link
Contributor

TeyKey1 commented Jan 20, 2024

It appears that both implementations of is_low differ in output for the same logic level of the input pin:

use embedded_hal::digital::InputPin;
use rppal::gpio::{Gpio, InputPin as RppalInputPin};

fn main() {
    let gpio = Gpio::new().unwrap();

    let mut interrupt = gpio.get(6).unwrap().into_input();
    println!(
        "is low hal: {}, is low rppal: {}",
        InputPin::is_low(&mut interrupt).unwrap(),
        RppalInputPin::is_low(&interrupt)
    );
}

With rppal v0.17.0 and embedded-hal v1.0.0 this code outputs: is low hal: false, is low rppal: true while with rppal v0.16.0 and embedded hal v1.0 rc2 this code outputs is low hal: true, is low rppal: true. During this test the raspi 4b pin was pulled low (0V)

I don't think the rppal v0.17.0 behavior is intended and this is likely a bug. Please let me know if there is some other reason for this change.

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 a pull request may close this issue.

1 participant