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

port gpio from f4-hal #145

Merged
merged 1 commit into from
Oct 25, 2021
Merged

port gpio from f4-hal #145

merged 1 commit into from
Oct 25, 2021

Conversation

burrbull
Copy link
Member

No description provided.

Copy link
Contributor

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @burrbull, this looks good! Definitely better than the huge macro we have right now.

I reviewed this and couldn't spot any mistakes, but I also didn't have the time to check every detail (specifically I didn't double-check most of the register manipulation.

Can you confirm that this works? Happy to merge, if someone can confirm that this works as intended.

@burrbull
Copy link
Member Author

Can you confirm that this works?

No, I can't. This works on F4 and F1 good enough, but I don't have any F7 device to test.

@hannobraun
Copy link
Contributor

Okay, then let's wait until someone had a chance to test this. I probably won't get to that for a while.

@hannobraun hannobraun added help wanted Extra attention is needed needs testing Testing is required, before code can be merged. labels Oct 21, 2021
@systec-ms
Copy link
Contributor

systec-ms commented Oct 25, 2021

I have tested the following cases on a STM32F767, everything worked fine.
For Ethernet, I used a modified stm32-eth crate.

  • 2 Leds, GPIO{E3, E4}, set_low(), set_high() // Output PushPull

  • 4 Buttons {B6, B5, C8, D13}, is_low(), is_high(), interrupt // Input PullUp

  • 4 Leds {B1, D15, D14, D12}, set_low, set_high(), is_set_low() // Output PushPull

  • UART {A9, A10}<Alternate>, into_alternate::<7>()

  • Ethernet

    • MCO2 PC9.into_alternate::<0>()

    • gpioc.pc0.into_push_pull_output().set_high()

    • MDIO

      gpioa
          .pa2
          .into_alternate::<11>()
          .set_speed(stm32_eth::hal::gpio::Speed::VeryHigh)
    • MDC (clk)

    gpioc
        .pc1
        .into_alternate::<11>()
        .set_speed(stm32_eth::hal::gpio::Speed::VeryHigh);
    • ref_clk {A1}, crs {A7}, tx {B11, B12, B13}, rx {D0, D1} into_alternate::<11>().set_speed(VeryHigh);

@systec-ms
Copy link
Contributor

In src/fmc_lcd/mod.rs the comments should still be adjusted:

/// gpiod.pd14.into_alternate_af12(),

@hannobraun
Copy link
Contributor

Thank you for testing, @systec-ms! And good catch on the doc examples that haven't been updated. I've opened #148, because that should really have been caught by the CI build.

I'm going to merge this pull request now. I think it would be unwise to hold it up because of the docs issue, as pretty much any change to GPIO going forward would introduce merge conflicts. Any pull requests that update the docs (and that solve #148) are of course appreciated!

Thanks again @burrbull!

@hannobraun hannobraun merged commit faf3818 into stm32-rs:master Oct 25, 2021
@systec-ms systec-ms mentioned this pull request Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs testing Testing is required, before code can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants