From bcfe751f62302cbb17f11236dc03775122ab6974 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 21 Oct 2024 12:01:04 +0200 Subject: fe310: support GPIO PinInput This is needed to support switching between input and output. --- src/machine/machine_fe310.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/machine/machine_fe310.go b/src/machine/machine_fe310.go index 37f3ee07e..4a15ad76e 100644 --- a/src/machine/machine_fe310.go +++ b/src/machine/machine_fe310.go @@ -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: -- cgit v1.2.3