-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RP2xxx] Update pins helper to create pins as comptime-available data…
… instead of zero-sized-types (#303) * Create Runtime-PWM abstraction * Pins configuration refactor This refactor maintains one of the very nice properties of the original approach: `pins.led_a` (for example) is comptime known. In order to preserve this property while also having `pins.led_a` be data (i.e. the existing gpio.Pin type) we needed to make pins accessible at comptime—before .apply has been called. This refactor has a couple of parts * Move `Pins(comptime config: GlobalConfiguration) type` to `PinsType(self: GlobalConfiguration) type` * Move the return value from `GlobalConfiguration.apply` to `GlobalConfiguration.pins` (so `.apply` returns `void`. This allows `GlobalConfiguration.pins()` to be called at comptime, which allows sub-values of `pins` to be read at comptime. * Change pins to be data instead of a type--replace Pwm with the new RuntimePwm and replace pins.GPIO with the existing gpio.Pin. The value of this is set in GlobalConfiguration.pins. ADC is left broken, since I believe it's broken on main. Will be fixed in a later commit. * Replace Pwm * Update examples (and update Pwm again) * Attempt to update ADC and create comment
- Loading branch information
1 parent
6207849
commit b07430e
Showing
4 changed files
with
122 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.