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

Use GPIO19/20 as push pull output #645

Closed
elkel53930 opened this issue Jul 6, 2023 · 11 comments
Closed

Use GPIO19/20 as push pull output #645

elkel53930 opened this issue Jul 6, 2023 · 11 comments

Comments

@elkel53930
Copy link
Contributor

Hi.
I am using ESP32-S3.
I connect LEDs to GPIO19, 20 and 21 and be trying to make them blink by referring to the example.

    let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);

    let mut led_g = io.pins.gpio19.into_push_pull_output();
    let mut led_b = io.pins.gpio20.into_push_pull_output();
    let mut led_r = io.pins.gpio21.into_push_pull_output();

    let mut delay = Delay::new(&clocks);

    led_r.set_low().unwrap();
    led_g.set_low().unwrap();
    led_b.set_low().unwrap();

    loop {
        led_r.toggle().unwrap();
        led_g.toggle().unwrap();
        led_b.toggle().unwrap();
        delay.delay_ms(500u32);
    }

GPIO21 is blinking without any problem. But GPIO19 and 20 are not blinking.
GPIO19 and 20 are USB ports by default. Do I need to do further configuration?

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 6, 2023

For ESP32-C3 we already have some special handling for the USB pins - probably we need something similar for ESP32-S3 then

@elkel53930
Copy link
Contributor Author

Thank you for your reply.
I would like to contribute to this ticket. But actually, I am a Rust newbie. This is my first Rust project.
If I try to contribute with code, I am sure I will cause trouble for everyone...

@jessebraham
Copy link
Member

You should just be able to expand on the changes made in this PR: #461

I thought I had tested the S3 and didn't run into issues, but it's possible I made a mistake so we can just apply this fix regardless I suppose.

@elkel53930
Copy link
Contributor Author

Thanks for the advice!
I will give it a try.

@elkel53930
Copy link
Contributor Author

I followed your advice and modified gpio.rs and the blinking works. Thanks!

@elkel53930
Copy link
Contributor Author

May I make a PR? Please let me know if there are any rules that I should follow.

@jessebraham
Copy link
Member

No need to ask, contributions are always appreciated! We don't have a contributing guide yet, but there is a pull request template on this repository which will list some guidelines for you.

@elkel53930
Copy link
Contributor Author

Understood. And sorry to borther you.
I checked the pull request template.
However, I can not satisfy "All examples work." because I don't have ESP32 except S3 and be using a my original board.
Can I skip some examples? Do you have guidelines?

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 13, 2023

Thanks for letting us know you won't be able to check the examples on all targets.

The PR template is more meant as a reminder and the responsibility to do a final check is on the maintainer who will do the review and finally merge it. Would be nice to mention the checked targets in the PR however

@elkel53930
Copy link
Contributor Author

Thank you. I made a PR.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 20, 2023

Closed via #663

@bjoernQ bjoernQ closed this as completed Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants