X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fpwm%2FPWMPeriphery.scala;h=f83cbafdfe9780ea83e865a8d94b65c4de9a8c4a;hb=06f0d2074237f3fa23275446f1ee74614e61f96e;hp=31ad5f6f3a999dc32de46efc8b6149ce4beb7429;hpb=00086c26e6601fef104623af301caa3facd9b80c;p=sifive-blocks.git diff --git a/src/main/scala/devices/pwm/PWMPeriphery.scala b/src/main/scala/devices/pwm/PWMPeriphery.scala index 31ad5f6..f83cbaf 100644 --- a/src/main/scala/devices/pwm/PWMPeriphery.scala +++ b/src/main/scala/devices/pwm/PWMPeriphery.scala @@ -18,6 +18,9 @@ class PWMPins[T <: Pin] (pingen: ()=> T, val c: PWMParams) extends Bundle { val pwm: Vec[T] = Vec(c.ncmp, pingen()) + override def cloneType: this.type = + this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type] + def fromPWMPort(port: PWMPortIO) { (pwm zip port.port) foreach {case (pin, port) => pin.outputPin(port)