mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-07 16:33:39 +00:00
55 lines
1.8 KiB
Go
55 lines
1.8 KiB
Go
package legacy
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"tinygo.org/x/drivers/internal/pin"
|
|
)
|
|
|
|
// 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 pin.Output) {
|
|
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 pin.Input) {
|
|
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 pin.Input) {
|
|
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 pin.Input) {
|
|
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")
|
|
)
|