Книга: Advanced PIC Microcontroller Projects in C
7.2 mikroC Language SD Card Library Functions
7.2 mikroC Language SD Card Library Functions
The mikroC language provides an extensive set of library functions to read and write data to SD cards (and also MultiMediaCards, MMC). Data can be written to or read from a given sector of the card, or the file system on the card can be used for more sophisticated applications.
The following library functions are provided:
• Mmc_Init (initialize the card)
• Mmc_Read_Sector (read one sector of data)
• Mmc_Write_Sector (write one sector of data)
• Mmc_Read_Cid (read CID register)
• Mmc_Read_Csd (read CSD register)
• Mmc_Fat_Init (initialize FAT)
• Mmc_Fat_QuickFormat (format the card to FAT16)
• Mmc_Fat_Assign (assign the file we will be working with)
• Mmc_Fat_Reset (reset the file pointer; opens the currently assigned file for reading)
• Mmc_Fat_Rewrite (reset the file pointer and clear assigned file; opens the assigned file for writing)
• Mmc_Fat_Append (move file pointer to the end of assigned file so new data can be appended to the file)
• Mmc_Fat_Read (read the byte the file pointer points to)
• Mmc_Fat_Write (write a block of data to the assigned file)
• Mmc_Set_File_Date (write system timestamp to a file)
• Mmc_Fat_Delete (delete a file)
• Mmc_Fat_Get_File_Date (read file timestamp)
• Mmc_Fat_Get_File_Size (get file size in bytes)
• Mmc_Fat_Get_Swap_File (create a swap file)
In the remainder of this chapter we will look at some SD-card and PIC18 microcontroller-based projects.
- CHAPTER 7 Advanced PIC18 Projects — SD Card Projects
- 4.3 mikroC Library Functions
- Language Syntax
- 5. Functions
- 15. Practical: A Portable Pathname Library
- 9.2.1 Language Modes
- CHAPTER 4 Functions and Libraries in mikroC
- 4.3.7 Miscellaneous Library
- 4.3.6 ANSI C Library
- 6.1 Program Description Language (PDL)
- Sound Cards
- Procedural Languages and Triggers