machine: rename PinInputPullUp/PinInputPullDown

Some targets used capital PullUp/PullDown, while the documented standard
is Pullup/Pulldown. This commit fixes this mismatch, while preserving
compatibility with aliases that are marked deprecated.
This commit is contained in:
Ayke van Laethem
2022-09-18 18:11:54 +02:00
committed by Ron Evans
parent 6e6666519c
commit bc946f346d
5 changed files with 35 additions and 17 deletions
+10 -4
View File
@@ -23,11 +23,17 @@ type PinChange uint8
// Pin modes.
const (
PinInput PinMode = iota
PinInputPullUp
PinInputPullDown
PinInputPullup
PinInputPulldown
PinOutput
)
// Deprecated: use PinInputPullup and PinInputPulldown instead.
const (
PinInputPullUp = PinInputPullup
PinInputPullDown = PinInputPulldown
)
// FPIOA internal pull resistors.
const (
fpioaPullNone fpioaPullMode = iota
@@ -89,10 +95,10 @@ func (p Pin) Configure(config PinConfig) {
case PinInput:
p.setFPIOAIOPull(fpioaPullNone)
input = true
case PinInputPullUp:
case PinInputPullup:
p.setFPIOAIOPull(fpioaPullUp)
input = true
case PinInputPullDown:
case PinInputPulldown:
p.setFPIOAIOPull(fpioaPullDown)
input = true
case PinOutput: