MMC Card Reader Development
Revision as of 19:43, 25 August 2009 by Tcwden (talk | contribs) (→Comparison of FatFs and stdio API)
This wiki describes the development of the MMC Card Reader Project
Contents
Architecture
- See here for block diagram
Development Roadmap
Phase 1
- Create stdio.h wrapper for file system in freertos_posix
- Use existing I2C EEPROM driver for development
Phase 2
- Circuit design for interfacing MMC
Phase 3
- SPI driver for MMC
Phase 4
- Test for normal read/write function
- hotswap (should not hang or cause voltage dip)
- multiple file read/write (protection)
Circuit and PCB
- SD Card connector
- SPI interface to main board
Software Implementation
- Use FatFs for accessing FAT16 file system.
- Create a stdio.h wrapper for freertos_posix
Comparison of FatFs and stdio API
- selected list is described below
Function | stdio.h | FatFs | Remarks |
---|---|---|---|
Open |
FILE * fopen ( const char * filename, const char * mode ); |
FRESULT f_open ( FIL* FileObject, /* Pointer to the blank file object structure */ const XCHAR* FileName, /* Pointer to the file neme */ BYTE ModeFlags /* Mode flags */ ); |
|
Read |
size_t fread ( void * ptr, size_t size, size_t count, FILE * stream ); |
FRESULT f_read ( FIL* FileObject, /* Pointer to the file object structure */ void* Buffer, /* Pointer to the buffer to store read data */ UINT ByteToRead, /* Number of bytes to read */ UINT* ByteRead /* Pointer to the variable to return number of bytes read */ ); |
|
Write |
size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream ); |
FRESULT f_write ( FIL* FileObject, /* Pointer to the file object structure */ const void* Buffer, /* Pointer to the data to be written */ UINT ByteToWrite, /* Number of bytes to write */ UINT* ByteWritten /* Pointer to the variable to return number of bytes written */ ); |
|
Close |
int fclose ( FILE * stream ); |
FRESULT f_close ( FIL* FileObject /* Pointer to the file object structure */ ); |
|