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

AF4, etc #269

Open
pdgilbert opened this issue Nov 5, 2021 · 0 comments
Open

AF4, etc #269

pdgilbert opened this issue Nov 5, 2021 · 0 comments

Comments

@pdgilbert
Copy link

In updating some example for a recent change committed in the git version
(const generics gpio (from F4) 2f5b395) I have had to change

    type I2cBus = I2c<
        I2C1,
        (
            PA9 <Alternate<AF4, OpenDrain>>,
            PA10<Alternate<AF4, OpenDrain>>,
        ),
    >;

to

    type I2cBus = I2c<
        I2C1,
        (
            PA9 <Alternate<OpenDrain, 4u8>>,   
            PA10<Alternate<OpenDrain, 4u8>>,
        ),
    >;

Is there a simpler/clearer way I should specify this, or is there some reason to not export AF4?

For comparison, with other hals I have

    #[cfg(feature = "stm32f1xx")]
    type I2cBus = BlockingI2c<pac::I2C1, (PB8<Alternate<OpenDrain>>, PB9<Alternate<OpenDrain>>)>;

    #[cfg(feature = "stm32f3xx")]
    type I2cBus = I2c<I2C1, (PB6<AF4<OpenDrain>>, PB7<AF4<OpenDrain>>)>;


    #[cfg(feature = "stm32f4xx")]
    type I2cBus = I2c<pac::I2C1, (PB8<AlternateOD<AF4>>, PB9<AlternateOD<AF4>>)>; //NO BlockingI2c

    #[cfg(feature = "stm32f7xx")]
    type I2cBus = BlockingI2c<pac::I2C1, PB8<AlternateOD<AF4>>, PB9<AlternateOD<AF4>>>;

    #[cfg(feature = "stm32h7xx")]
    type I2cBus = I2c<I2C1>;

    #[cfg(feature = "stm32l0xx")]
    type I2cBus = BlockingI2c<pac::I2C1, (PB8<Alternate<OpenDrain>>, PB9<Alternate<OpenDrain>>)>;

    #[cfg(feature = "stm32l1xx")]
    type I2cBus = I2c<I2C1, (PB8<Output<OpenDrain>>, PB9<Output<OpenDrain>>)>;

and by far the stm32h7xx specification seems to be simplest if that can be made to work.
( CI for the examples is at https://github.com/pdgilbert/rust-integration-testing/actions )

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

No branches or pull requests

1 participant