Mikroelektronika MIKROE-724 データシート

ページ / 726
286
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Cf_Fat_Init
Cf_Fat_QuickFormat
Prototype
sub function Cf_Fat_Init() as word
Description Initializes CF card, reads CF FAT16 boot sector and extracts necessary data needed by the library.
Parameters None.
Returns
0
 - if CF card was detected and successfully initialized 
1
 - if FAT16 boot sector was not found 
255
 - if card was not detected 
Requires
Nothing.
Example
‘  init the FAT library
if (Cf_Fat_Init() = 0) then
  ...
end if
Notes
None.
Prototype
sub  function  Cf_Fat_QuickFormat(dim  byref  cf_fat_label  as  string[11])  as 
word
Description Formats to FAT16 and initializes CF card.
Parameters 
cf_fat_label
: volume label (11 characters in length). If less than 11 characters are provided, the 
label will be padded with spaces. If null string is passed, the volume will not be labeled. 
Returns
0
 - if CF card was detected, successfully formated and initialized 
1
 - if FAT16 format was unsuccessful 
255
 - if card was not detected 
Requires
Nothing.
Example
‘ format and initialize the FAT library
if ( Cf_Fat_QuickFormat(“mikroE”) = 0) then
  ...
end if
Notes
- This routine can be used instead or in conjunction with Cf_Fat_Init routine. 
- If CF card already contains a valid boot sector, it will remain unchanged (except volume label field)   
and only FAT and ROOT tables will be erased. Also, the new volume label will be set.