mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-15 12:23:41 +00:00
29 lines
543 B
Go
29 lines
543 B
Go
//go:build baremetal
|
|
|
|
package legacy
|
|
|
|
import "machine"
|
|
|
|
func configurePinOut(p PinOutput) {
|
|
configurePin(p, machine.PinInputPulldown)
|
|
}
|
|
|
|
func configurePinInputPulldown(p PinInput) {
|
|
configurePin(p, machine.PinInputPulldown)
|
|
}
|
|
|
|
func configurePinInput(p PinInput) {
|
|
configurePin(p, machine.PinInput)
|
|
}
|
|
|
|
func configurePinInputPullup(p PinInput) {
|
|
configurePin(p, machine.PinInputPullup)
|
|
}
|
|
|
|
func configurePin(p any, mode machine.PinMode) {
|
|
machinePin, ok := p.(machine.Pin)
|
|
if ok {
|
|
machinePin.Configure(machine.PinConfig{Mode: mode})
|
|
}
|
|
}
|