mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-12 10:53:43 +00:00
legacy.PinOutput->pin.Output and add High+Low methods on drivers.PinOutput and use them in drivers
This commit is contained in:
committed by
deadprogram
parent
2e007a6de7
commit
8ac285e821
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user