diff --git a/src/main/scala/backBoard/SpiSlv.scala b/src/main/scala/backBoard/SpiSlv.scala index 66c2ceb..62841bf 100644 --- a/src/main/scala/backBoard/SpiSlv.scala +++ b/src/main/scala/backBoard/SpiSlv.scala @@ -66,9 +66,12 @@ trait BackBoardSpiSlv{ this: BackBoardSlvLocal => bitSel := 0.U byteSel := 0.U cmd_100M := 0.U - exReg_100M := upReg(0) } .elsewhen( isSckPosedge & ~shiftCSn(1) & byteSel === 0.U ){ //CS为低,且SCK上跳的第0byte cmd_100M := Cat( cmd_100M(6,0), shiftMOSI(1) ) + } + + when( shiftCSn(2) & ~shiftCSn(1) ){ //CS下跳 + exReg_100M := upReg(0) } .elsewhen( isSckPosedgeNext(1) & ~shiftCSn(1) & bitSel === 0.U ){ //CS为低,且SCK上跳补一拍 的第0bit when( byteSel === 1.U ){ exReg_100M := upReg(1) @@ -83,6 +86,7 @@ trait BackBoardSpiSlv{ this: BackBoardSlvLocal => exReg_100M := Cat( exReg_100M(6 ,0), shiftMOSI(1) ) } + when( isSckPosedgeNext(1) & ~shiftCSn(1) & byteSel === 3.U & bitSel === 0.U & spiCmd === 3.U ){ exMask_100M := Cat( exReg_100M, exMask_100M(7,0) ) } .elsewhen( isSckPosedgeNext(1) & ~shiftCSn(1) & byteSel === 4.U & bitSel === 0.U & spiCmd === 3.U ){