View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
MMC_SPI.c vs MMCSD.c |
Posted: Fri Jul 27, 2012 5:05 am |
|
|
Hi! I want to ask is there a difference between these 2 source files? Is there a difference if I would use mmc_spi.c or mmcsd.c?
I found ex_mmcsd, but there is nothing about mmc_spi. I`m using spi interface to communicate with the sd card. Should I have to use mmc_spi.c?
I`ll be glad if someone post an example for mmc_spi.c.
Thanks! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Fri Jul 27, 2012 5:22 am |
|
|
A quick look at those drivers and one appears to have more functions available though since I don't use MMS/SD cards (pita) for storage I can't comment further other than I suggest you printout the drivers and compare 'side by side' to see what is different.They are 'selfdocumented' a real bonus to say 'what does what'...
I'd highlight common code and/or functions so that whatever is left is the 'added' or 'other feature' code. Since MMC/Sd cards can be use a few ways, I'm assuming one driver is more 'flexible' than the other or better for some applications ?
hth
jay |
|
|
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Fri Jul 27, 2012 5:28 am |
|
|
Look at this link
http://pinouts.ru/Memory/sdcard_pinout.shtml
The sd card could be connected in SD mode or in SPI mode.
So should I use mmcsd for SD mode and mmc_spi for SPI mode???
In the both .c files I found SPI settings, so I want to know what is the difference(if there is such).
Thanks! |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Jul 28, 2012 2:39 pm |
|
|
As Temtronic already told you the code contains comments on what each module does. Have you studied this?
Basically the two drivers have a large overlap.
Both are using SPI, not the SD-mode.
mmc_spi.c is older and well tested. mmcsd.c is newer and has a few nice additions like data buffering which makes reading and writing to the same memory page much faster and reduces memory card wearing out. mmcsd.c is however less tested, it uses the '#USE SPI' directive which had problems the last time I looked into it (v4.077).
The CCS FAT driver, fat.c, is based on mmcsd.c |
|
|
|