X-Git-Url: https://git.libre-soc.org/?p=sifive-blocks.git;a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fgpio%2FGPIO.scala;h=e7a48299d132df91965224608386f61812b810f4;hp=4884227c49027a712bba6d6951cce768c1e356f1;hb=ef4f2ed888cd614858c6b2647c1eb6f988ff3973;hpb=4d74e8f67f871df93f7bb2dfb2fa8bffb641fc4a diff --git a/src/main/scala/devices/gpio/GPIO.scala b/src/main/scala/devices/gpio/GPIO.scala index 4884227..e7a4829 100644 --- a/src/main/scala/devices/gpio/GPIO.scala +++ b/src/main/scala/devices/gpio/GPIO.scala @@ -34,6 +34,14 @@ object IOFCtrl { // for the IOF class IOFPin extends Pin { val o = new IOFCtrl().asOutput + + def default(): Unit = { + this.o.oval := Bool(false) + this.o.oe := Bool(false) + this.o.ie := Bool(false) + this.o.valid := Bool(false) + } + def inputPin(pue: Bool = Bool(false) /*ignored*/): Bool = { this.o.oval := Bool(false) this.o.oe := Bool(false) @@ -53,7 +61,7 @@ class IOFPin extends Pin { // Connect both the i and o side of the pin, // and drive the valid signal for the IOF. -object GPIOPinToIOF { +object BasePinToIOF { def apply(pin: BasePin, iof: IOFPin): Unit = { iof <> pin iof.o.valid := Bool(true)