My question concerns the select line - I am currently trying to get this to work on a different XMOS board, so I simply remapped the SPI pins defined by the driver. But when I studied what I thought was the select line, it sort of dead-ends.
The four pins for SD driving are defined as:
Code: Select all
on stdcore[2] : port p_sd_cmd = XS1_PORT_1H;
on stdcore[2] : port p_sd_clk = XS1_PORT_1E;
on stdcore[2] : port p_sd_dat = XS1_PORT_1F;
on stdcore[2] : port p_sd_rsv = XS1_PORT_1G;
But when I grep for the p_sd_rsv line, here's what I get:
Code: Select all
find . -name "*" -exec grep -iH "p_sd_rsv" {} \;
./Driver_SD/FAT16_server.h:void FAT16_server(chanend client1, port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv);
./Driver_SD/FAT16_server.xc:void FAT16_server(chanend client1, port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv)
./Driver_SD/FAT16_server.xc: if (SD_link_initialise(p_sd_cmd, p_sd_clk, p_sd_dat, p_sd_rsv) == XMOS_SUCCESS)
./Driver_SD/SD_link.h:XMOS_RTN_t SD_link_initialise( port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv);
./Driver_SD/SD_link.xc:XMOS_RTN_t SD_link_initialise(port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv)
./Driver_SD/SD_link.xc: SD_phy_initialise(p_sd_cmd, p_sd_clk, p_sd_dat, p_sd_rsv);
./Driver_SD/SD_phy.h:uint SD_phy_initialise(port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv);
./Driver_SD/SD_phy.xc:uint SD_phy_initialise(port p_sd_cmd, port p_sd_clk, port p_sd_dat, port p_sd_rsv)
./Driver_SD/SD_phy.xc: p_sd_rsv <: 1;
./main.xc:on stdcore[2] : port p_sd_rsv = XS1_PORT_1G;
./main.xc: on stdcore[2] : FAT16_server(ch_fs, p_sd_cmd, p_sd_clk, p_sd_dat, p_sd_rsv); //Filesystem
The problem is, I don't ever see it asserted low anywhere in the code. Why? I have to assume this driver works because Berni used it in a project and it's part of an official XMOS dev kit.
What am I missing? I guess I could go through and do the assertions, but it feels more like I'm not understanding something first.
Landon