-
Notifications
You must be signed in to change notification settings - Fork 616
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Device.GpioContains types for using general-purpose I/O (GPIO) pinsContains types for using general-purpose I/O (GPIO) pins
Description
Toggling a Gpio pin is a very, very common operation. To accomplish that, with what's available today, one has to either:
- Keep a variable to hold the pin state and then update the pin and the variable.
- Perform a read pin, toggle state and perform a write pin.
Most of modern MCUs provide a low level way of doing this with one or maybe a couple of instructions. Even if it requires implementing 2. in native code it would still be far more efficient that using 1. or 2. in managed code.
Considering the above, I'm proposing that a System.Device.Gpio.Toggle(int pinNumber) method should exist.
PS: We already have this on nanoFramework Windows.Devices.Gpio API, see here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Device.GpioContains types for using general-purpose I/O (GPIO) pinsContains types for using general-purpose I/O (GPIO) pins