X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fi2c%2FI2CPeriphery.scala;h=f4394073eceb3784414b66a756dea9c184f2f7a0;hb=0a80d1987d35046858c36a4fa462410b54a126f0;hp=1cc927f46adf7b5243c76d31c23c0f703e4ac295;hpb=9ae6413273bcb498af3a9542e0f4dffe084eee83;p=sifive-blocks.git diff --git a/src/main/scala/devices/i2c/I2CPeriphery.scala b/src/main/scala/devices/i2c/I2CPeriphery.scala index 1cc927f..f439407 100644 --- a/src/main/scala/devices/i2c/I2CPeriphery.scala +++ b/src/main/scala/devices/i2c/I2CPeriphery.scala @@ -19,20 +19,14 @@ trait HasPeripheryI2C extends HasPeripheryBus { } trait HasPeripheryI2CBundle { - val i2cs: Vec[I2CPort] - - def I2CtoGPIOPins(syncStages: Int = 0): Seq[I2CPinsIO] = i2cs.map { i => - val pins = Module(new I2CGPIOPort(syncStages)) - pins.io.i2c <> i - pins.io.pins - } + val i2c: Vec[I2CPort] } trait HasPeripheryI2CModuleImp extends LazyMultiIOModuleImp with HasPeripheryI2CBundle { val outer: HasPeripheryI2C - val i2cs = IO(Vec(outer.i2cParams.size, new I2CPort)) + val i2c = IO(Vec(outer.i2cParams.size, new I2CPort)) - (i2cs zip outer.i2c).foreach { case (io, device) => + (i2c zip outer.i2c).foreach { case (io, device) => io <> device.module.io.port } }