From 9fdd36085466bdce2e3c91fe61a8bd774c31980b Mon Sep 17 00:00:00 2001 From: RuigeLee Date: Fri, 19 Sep 2025 14:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=85=A2=E9=80=9Fqspi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/scala/backBoard/shin/SpiInterface.scala | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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