mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
fe310: support GPIO PinInput
This is needed to support switching between input and output.
This commit is contained in:
committed by
Ron Evans
parent
a191326ea8
commit
bcfe751f62
@@ -26,6 +26,8 @@ const (
|
||||
func (p Pin) Configure(config PinConfig) {
|
||||
sifive.GPIO0.INPUT_EN.SetBits(1 << uint8(p))
|
||||
switch config.Mode {
|
||||
case PinInput:
|
||||
sifive.GPIO0.OUTPUT_EN.ClearBits(1 << uint8(p))
|
||||
case PinOutput:
|
||||
sifive.GPIO0.OUTPUT_EN.SetBits(1 << uint8(p))
|
||||
case PinPWM:
|
||||
|
||||
Reference in New Issue
Block a user