Skip to content

Commit

Permalink
fe310: support GPIO PinInput
Browse files Browse the repository at this point in the history
This is needed to support switching between input and output.
  • Loading branch information
aykevl committed Oct 21, 2024
1 parent 23d3a31 commit d264dcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/machine/machine_fe310.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d264dcb

Please sign in to comment.