Datasheet
Mmc_Fat_Init
276
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
function Mmc_Fat_Init(): byte;
Returns
- 0 - if MMC/SD card was detected and successfully initialized
- 1 - if FAT16 boot sector was not found
- 255 - if MMC/SD card was not detected
Description
Initializes MMC/SD card, reads MMC/SD FAT16 boot sector and extracts neces-
sary data needed by the library.
Note: MMC/SD card has to be formatted to FAT16 file system.
Requires
Global variables :
- Mmc_Chip_Select: Chip Select line
- Mmc_Chip_Select_Direction: Direction of the Chip Select pin
must be defined before using this function.
The appropriate hardware SPI module must be previously initialized. See the
SPI1_Init, SPI1_Init_Advanced routines.
Example
// init the FAT library
if (Mmc_Fat_Init() = 0) then
begin
...
end