Skip to content

Commit e08aa51

Browse files
committed
Make ConfigurablePpi a subtrait of Ppi
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>>, ) { // ... } `````
1 parent 47c478c commit e08aa51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nrf-hal-common/src/ppi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub trait Ppi {
8282
}
8383

8484
/// Traits that extends the [Ppi](trait.Ppi.html) trait, marking a channel as fully configurable.
85-
pub trait ConfigurablePpi {
85+
pub trait ConfigurablePpi: Ppi {
8686
/// Sets the task that must be triggered when the configured event occurs. The user must provide
8787
/// a reference to the task.
8888
fn set_task_endpoint<T: Task>(&mut self, task: &T);

0 commit comments

Comments
 (0)