fe310: support GPIO PinInput

This is needed to support switching between input and output.
This commit is contained in:
Ayke van Laethem
2024-10-21 12:01:04 +02:00
committed by Ron Evans
parent a191326ea8
commit bcfe751f62
+2
View File
@@ -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: