Skip to content

Commit

Permalink
Fix signal fn recommendation (#2692)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani authored Dec 6, 2024
1 parent 5135965 commit d2f15d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documentation/API-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In general, the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines
## Construction and Destruction of Drivers

- Drivers must take peripherals via the `PeripheralRef` pattern - they don't consume peripherals directly.
- If a driver requires pins, those pins must be configured using `fn with_signal_name(self, pin: impl Peripheral<P = InputConnection> + 'd) -> Self)` or `fn with_signal_name(self, pin: impl Peripheral<P = OutputConnection> + 'd) -> Self)`
- If a driver requires pins, those pins should be configured using `fn with_signal_name(self, pin: impl Peripheral<P = impl PeripheralInput> + 'd) -> Self` or `fn with_signal_name(self, pin: impl Peripheral<P = impl PeripheralOutput> + 'd) -> Self`
- If a driver supports multiple peripheral instances (for example, I2C0 is one such instance):
- The peripheral instance type must be positioned as the last type parameter of the driver type.
- The peripheral instance type must default to a type that supports any of the peripheral instances.
Expand Down

0 comments on commit d2f15d6

Please sign in to comment.