mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
Changing SPI command structure
- Read/write commands should be at MSBs (7:6) - Fixed fifo read race..need to look at this again
This commit is contained in:
parent
3ca89dca2b
commit
a7003be8e9
@ -117,7 +117,7 @@ module spi_master_io(/*AUTOARG*/
|
||||
assign byte_done = (bit_count[2:0]==3'b000);
|
||||
|
||||
//read fifo on phase match (due to one cycle pipeline latency
|
||||
assign fifo_read = ((spi_state[1:0]==`SPI_IDLE) & phase_match ) |
|
||||
assign fifo_read = ((spi_state[1:0]==`SPI_SETUP) & phase_match) |
|
||||
((spi_state[1:0]==`SPI_DATA) & phase_match & byte_done);
|
||||
|
||||
//load once per byte
|
||||
|
@ -147,8 +147,7 @@ module spi_slave_io(/*AUTOARG*/
|
||||
(command_reg[7:6]==2'b00) &
|
||||
(spi_state[1:0]==`SPI_DATA);
|
||||
|
||||
assign spi_read =
|
||||
command_reg[7:6]==2'b11; //read from sclk reg
|
||||
assign spi_read = command_reg[7:6]==2'b11; //read from sclk reg
|
||||
|
||||
assign spi_remote = command_reg[7:6]==2'b10; //send remote request
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user