diff options
author | matt <matt@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-09-17 00:14:24 +0000 |
---|---|---|
committer | matt <matt@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-09-17 00:14:24 +0000 |
commit | c9157f4a3d86850f8974d6222efe28215f6b45f5 (patch) | |
tree | 8caea0e4b7aa9e663a3f91d92add16896418ef58 /control_lib | |
parent | bff331ff524d9f889982fdcc1f590e6244fc1954 (diff) | |
download | uhd-c9157f4a3d86850f8974d6222efe28215f6b45f5.tar.gz uhd-c9157f4a3d86850f8974d6222efe28215f6b45f5.tar.bz2 uhd-c9157f4a3d86850f8974d6222efe28215f6b45f5.zip |
control CS line on SD card
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9589 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'control_lib')
-rw-r--r-- | control_lib/sd_spi_wb.v | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/control_lib/sd_spi_wb.v b/control_lib/sd_spi_wb.v index 53036d363..7a6258b56 100644 --- a/control_lib/sd_spi_wb.v +++ b/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) |