高云FPGA:SPI发送前2byte代码规范化修复
This commit is contained in:
@@ -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 ){
|
||||
|
||||
Reference in New Issue
Block a user