Skip to content

Commit bcfe751

Browse files
aykevldeadprogram
authored andcommitted
fe310: support GPIO PinInput
This is needed to support switching between input and output.
1 parent a191326 commit bcfe751

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/machine/machine_fe310.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const (
2626
func (p Pin) Configure(config PinConfig) {
2727
sifive.GPIO0.INPUT_EN.SetBits(1 << uint8(p))
2828
switch config.Mode {
29+
case PinInput:
30+
sifive.GPIO0.OUTPUT_EN.ClearBits(1 << uint8(p))
2931
case PinOutput:
3032
sifive.GPIO0.OUTPUT_EN.SetBits(1 << uint8(p))
3133
case PinPWM:

0 commit comments

Comments
 (0)