legacy.PinOutput->pin.Output and add High+Low methods on drivers.PinOutput and use them in drivers

This commit is contained in:
Patricio Whittingslow
2025-09-16 17:53:18 -03:00
committed by deadprogram
parent 2e007a6de7
commit 8ac285e821
30 changed files with 280 additions and 245 deletions
+23
View File
@@ -0,0 +1,23 @@
package pin
import "tinygo.org/x/drivers"
// Here to aid relevant documentation links of [drivers.PinOutput] and [drivers.PinInput].
var _ drivers.PinOutput
// Output represents a pin hardware abstraction layer for a pin that can output a digital signal.
//
// This is an alternative to [drivers.PinOutput] abstraction which is a function type and has
// not been standardized as of yet as a standard HAL in the drivers package,
// [discussion ongoing here].
//
// [discussion ongoing here]: https://github.com/orgs/tinygo-org/discussions/5043
type Output interface {
Set(level bool)
}
// Input represents a pin hardware abstraction layer.
// See [Output] for more information on why this type exists separate to drivers.
type Input interface {
Get() (level bool)
}