projects
/
sifive-blocks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8dcfba
)
SPI: Make it easier to build arbitrary bundles
author
Megan Wachs
<megan@sifive.com>
Wed, 20 Sep 2017 23:21:21 +0000
(16:21 -0700)
committer
Megan Wachs
<megan@sifive.com>
Wed, 20 Sep 2017 23:21:21 +0000
(16:21 -0700)
src/main/scala/devices/spi/SPIPins.scala
patch
|
blob
|
history
diff --git
a/src/main/scala/devices/spi/SPIPins.scala
b/src/main/scala/devices/spi/SPIPins.scala
index 780e8cc35f5dc6fffa4321ede941769837cc6965..c46e90a84efe144f04488ac8d7a668e83d4e5eca 100644
(file)
--- a/
src/main/scala/devices/spi/SPIPins.scala
+++ b/
src/main/scala/devices/spi/SPIPins.scala
@@
-5,7
+5,7
@@
import Chisel._
import chisel3.experimental.{withClockAndReset}
import sifive.blocks.devices.pinctrl.{PinCtrl, Pin}
import chisel3.experimental.{withClockAndReset}
import sifive.blocks.devices.pinctrl.{PinCtrl, Pin}
-class SPI
Pins[T <: Pin
] (pingen: ()=> T, c: SPIParamsBase) extends SPIBundle(c) {
+class SPI
Signals[T <: Data
] (pingen: ()=> T, c: SPIParamsBase) extends SPIBundle(c) {
val sck = pingen()
val dq = Vec(4, pingen())
val sck = pingen()
val dq = Vec(4, pingen())
@@
-14,6
+14,13
@@
class SPIPins[T <: Pin] (pingen: ()=> T, c: SPIParamsBase) extends SPIBundle(c)
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
+}
+
+class SPIPins[T <: Pin] (pingen: ()=> T, c: SPIParamsBase) extends SPISignals(pingen, c) {
+
+ override def cloneType: this.type =
+ this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
+
def fromPort(spi: SPIPortIO, clock: Clock, reset: Bool,
syncStages: Int = 0, driveStrength: Bool = Bool(false)) {
def fromPort(spi: SPIPortIO, clock: Clock, reset: Bool,
syncStages: Int = 0, driveStrength: Bool = Bool(false)) {