Skip to content

Make ConfigurablePpi a subtrait of Ppi#244

Merged
jonas-schievink merged 1 commit intonrf-rs:masterfrom
timokroeger:ppi-trait
Oct 7, 2020
Merged

Make ConfigurablePpi a subtrait of Ppi#244
jonas-schievink merged 1 commit intonrf-rs:masterfrom
timokroeger:ppi-trait

Conversation

@timokroeger
Copy link
Copy Markdown
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