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

Make ConfigurablePpi a subtrait of Ppi #244

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

timokroeger
Copy link
Contributor

This allows to create nice generic driver APIs with impl ConfigurablePpi arguments
Example:

fn link_pins(
    gpiote: &hal::gpiote::Gpiote,
    mut ppi: impl ConfigurablePpi,
    out_pin: Pin<Output<PushPull>>,
    in_pin: Pin<Input<PullUp>>,
) {
    // ...
}

This allows to create nice generic driver APIs with `impl ConfigurablePpi` arguments
Example:
```` rust
fn link_pins(
    gpiote: &hal::gpiote::Gpiote,
    mut ppi: impl ConfigurablePpi,
    out_pin: Pin<Output<PushPull>>,
    in_pin: Pin<Input<PullUp>>,
) {
    // ...
}
`````
@jonas-schievink jonas-schievink merged commit 87a0cca into nrf-rs:master Oct 7, 2020
@timokroeger timokroeger deleted the ppi-trait branch October 9, 2020 08:21
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.

2 participants