projects
/
shakti-peripherals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reformat header
[shakti-peripherals.git]
/
src
/
peripherals
/
spi
/
spi.bsv
diff --git
a/src/peripherals/spi/spi.bsv
b/src/peripherals/spi/spi.bsv
index 6c3c13f9a0417d29f9eb2c32fdd8c66e3a9b73d6..71204d54e803d904f5210141d42ced27fd13400d 100644
(file)
--- a/
src/peripherals/spi/spi.bsv
+++ b/
src/peripherals/spi/spi.bsv
@@
-38,10
+38,10
@@
package spi;
(*always_ready, always_enabled*)
interface SPI_out;
interface Get#(Bit#(1)) clk_o;
(*always_ready, always_enabled*)
interface SPI_out;
interface Get#(Bit#(1)) clk_o;
- interface Get#(Bit#(1)) io_out;
method Bit#(9) io0_sdio_ctrl;
method Bit#(9) io1_sdio_ctrl;
// index 0 is MOSI, index 1 is MISO.
method Bit#(9) io0_sdio_ctrl;
method Bit#(9) io1_sdio_ctrl;
// index 0 is MOSI, index 1 is MISO.
+ interface Get#(Bit#(2)) io_out;
interface Get#(Bit#(2)) io_out_en;
interface Put#(Bit#(2)) io_in;
interface Get#(Bit#(1)) ncs_o;
interface Get#(Bit#(2)) io_out_en;
interface Put#(Bit#(2)) io_in;
interface Get#(Bit#(1)) ncs_o;
@@
-79,14
+79,15
@@
package spi;
endinterface;
interface io_in = interface Put
method Action put(Bit#(2) in);
endinterface;
interface io_in = interface Put
method Action put(Bit#(2) in);
- Bit(#4) temp = { 0, 0, in[1], in[0] };
+ Bit#(4) temp;
+ temp[3] = 0;
+ temp[2] = 0;
+ temp[1] = in[1];
+ temp[0] = in[0];
qspi.out.io_in(temp);
endmethod
endinterface;
interface clk_o = qspi.out.clk_o;
qspi.out.io_in(temp);
endmethod
endinterface;
interface clk_o = qspi.out.clk_o;
- interface io_out = qspi.out.io_out;
- interface io_out_en = qspi.out.io_out_en;
- interface io_in = qspi.out.io_in;
interface ncs_o = qspi.ncs_o;
endinterface
interface ncs_o = qspi.ncs_o;
endinterface