mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-10 09:53:42 +00:00
d224b5d648
Signed-off-by: deadprogram <ron@hybridgroup.com>
55 lines
1.8 KiB
Go
55 lines
1.8 KiB
Go
package legacy
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"tinygo.org/x/drivers"
|
|
)
|
|
|
|
// ConfigurePinOut is a legacy function used to configure pins as outputs.
|
|
//
|
|
// Deprecated: Do not configure pins in drivers.
|
|
// This is a legacy feature and should only be used by drivers that
|
|
// previously configured pins in initialization to avoid breaking users.
|
|
func ConfigurePinOut(po drivers.PinOutput) {
|
|
configurePinOut(po)
|
|
}
|
|
|
|
// ConfigurePinInput is a legacy function used to configure pins as inputs.
|
|
//
|
|
// Deprecated: Do not configure pins in drivers.
|
|
// This is a legacy feature and should only be used by drivers that
|
|
// previously configured pins in initialization to avoid breaking users.
|
|
func ConfigurePinInputPulldown(pi drivers.PinInput) {
|
|
configurePinInputPulldown(pi)
|
|
}
|
|
|
|
// ConfigurePinInput is a legacy function used to configure pins as inputs.
|
|
//
|
|
// Deprecated: Do not configure pins in drivers.
|
|
// This is a legacy feature and should only be used by drivers that
|
|
// previously configured pins in initialization to avoid breaking users.
|
|
func ConfigurePinInput(pi drivers.PinInput) {
|
|
configurePinInput(pi)
|
|
}
|
|
|
|
// ConfigurePinInput is a legacy function used to configure pins as inputs.
|
|
//
|
|
// Deprecated: Do not configure pins in drivers.
|
|
// This is a legacy feature and should only be used by drivers that
|
|
// previously configured pins in initialization to avoid breaking users.
|
|
func ConfigurePinInputPullup(pi drivers.PinInput) {
|
|
configurePinInputPullup(pi)
|
|
}
|
|
|
|
// PinIsNoPin returns true if the argument is a machine.Pin type and is the machine.NoPin predeclared type.
|
|
//
|
|
// Deprecated: Drivers do not require pin knowledge from now on.
|
|
func PinIsNoPin(pin any) bool {
|
|
return pinIsNoPin(pin)
|
|
}
|
|
|
|
var (
|
|
ErrConfigBeforeInstantiated = errors.New("device must be instantiated with New before calling Configure method")
|
|
)
|