summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt2008-09-17 00:14:24 +0000
committermatt2008-09-17 00:14:24 +0000
commit2853848d37a3f70ffc7527fdaf8bf13993c703dd (patch)
tree34beb2de69fdffaa168ab2340f3a9dc352d62597
parentad482436a7c9e97f4bc1f7407dccd85a4cade6c5 (diff)
downloadgnuradio-2853848d37a3f70ffc7527fdaf8bf13993c703dd.tar.gz
gnuradio-2853848d37a3f70ffc7527fdaf8bf13993c703dd.tar.bz2
gnuradio-2853848d37a3f70ffc7527fdaf8bf13993c703dd.zip
control CS line on SD card
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9589 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--usrp2/fpga/control_lib/sd_spi_wb.v12
1 files changed, 11 insertions, 1 deletions
diff --git a/usrp2/fpga/control_lib/sd_spi_wb.v b/usrp2/fpga/control_lib/sd_spi_wb.v
index 53036d363..7a6258b56 100644
--- a/usrp2/fpga/control_lib/sd_spi_wb.v
+++ b/usrp2/fpga/control_lib/sd_spi_wb.v
@@ -34,6 +34,10 @@ module sd_spi_wb
reg [7:0] clkdiv;
wire ready;
reg ack_d1;
+
+ reg cs_reg;
+ assign sd_csn = ~cs_reg; // FIXME
+
always @(posedge clk)
if(rst) ack_d1 <= 0;
else ack_d1 <= wb_ack_o;
@@ -51,8 +55,14 @@ module sd_spi_wb
endcase // case(wb_adr_i)
always @(posedge clk)
- if(wb_we_i & wb_stb_i & wb_cyc_i & wb_ack_o)
+ if(rst)
+ begin
+ clkdiv <= 200;
+ cs_reg <= 0;
+ end
+ else if(wb_we_i & wb_stb_i & wb_cyc_i & wb_ack_o)
case(wb_adr_i)
+ ADDR_STATUS : cs_reg <= wb_dat_i;
ADDR_CLKDIV : clkdiv <= wb_dat_i;
endcase // case(wb_adr_i)