Return to sdmmc.c CVS log | Up to [local] / funnyos / dev / sdmmc |
File: [local] / funnyos / dev / sdmmc / sdmmc.c (download)
Revision 1.2, Fri Dec 21 17:45:26 2007 UTC (16 years, 5 months ago) by nbrk
another step towards SD/MMC SPI protocol support; add functions to initialize, read block, read CID, get tokens.. still not completed and not much tested (doesn't work for now). |
/* * $Id: sdmmc.c,v 1.2 2007/12/21 17:45:26 nbrk Exp $ */ #include <sys/types.h> #include <dev/sdmmc/sdmmcvar.h> struct sdmmc_cmdframe sdmmc_command(uint8_t cmd, uint32_t arg, uint8_t crc) { /* * Construct command frame and return it. */ struct sdmmc_cmdframe cmdframe; cmdframe.sc_cmd = CMDFRAME_CMD(cmd); cmdframe.sc_arg = arg; cmdframe.sc_crc = cmd != 0 ? CMDFRAME_CRC(crc) : crc; return(cmdframe); }