diff --git a/src/main/scala/backBoard/shin/SpiInterface.scala b/src/main/scala/backBoard/shin/SpiInterface.scala index 4609bb2..fa6931a 100644 --- a/src/main/scala/backBoard/shin/SpiInterface.scala +++ b/src/main/scala/backBoard/shin/SpiInterface.scala @@ -163,15 +163,10 @@ class QSpiInterface(edge: Boolean) extends SpiInterfaceBase{ qspi.isDirIn := ~isSpiRead - io.isEnR := - ( - if(edge){ + io.isEnR := (isSckPosedge & ~shiftCSn(1) & bitSel === 0.U & shiftMOSI(1) === "b1000".U & byteSel === 2.U ) | (isSckPosedge & ~shiftCSn(1) & bitSel === 0.U & isSpiRead & byteSel >= 3.U) - } else { - (isSckNegedge & ~shiftCSn(1) & bitSel === 0.U & isSpiRead & byteSel >= 2.U) - } - ) + @@ -203,8 +198,8 @@ class QSpiInterface(edge: Boolean) extends SpiInterfaceBase{ (if( edge ) {isSckPosedge} else {isSckNegedge}) & ~shiftCSn(1) ){ - when( bitSel.andR ){ - when((byteSel === 0.U || byteSel === 1.U) ){ + when( (if( edge ) { bitSel.andR } else { bitSel === 0.U }) ){ + when((byteSel === 0.U || byteSel === 1.U || byteSel === 2.U) ){ exRego := 0.U //地址1,cmd } .elsewhen( isSpiRead ){ exRego := io.datar