Download Data Sheet - MikroElektronika

Transcript
mikroBasic PRO for PIC32
Parameters
Returns
Requires
Example
Notes
Bit
Mask
Description
0
0x01
Read Only
1
0x02
Hidden
2
0x04
System
3
0x08
Volume Label
4
0x10
Subdirectory
5
0x20
Archive
6
0x40
Device (internal use only, never found on disk)
7
0x80
Not used
- Number of the start sector for the newly created swap file, if there was enough free space on CF
card to create file of required size.
- 0 - otherwise.
CF card and CF library must be initialized for file operations. See Cf_Fat_Init.
‘ Try to create a swap file with archive atribute, whose size will be at
least 1000 sectors.
‘
If it succeeds, it sends the No. of start sector over UART
dim size as longword
...
size = Cf_Fat_Get_Swap_File(1000, “mikroE.txt”, 0x20)
if (size <> 0) then
UART1_Write(0xAA)
UART1_Write(Lo(size))
UART1_Write(Hi(size))
UART1_Write(Higher(size))
UART1_Write(Highest(size))
UART1_Write(0xAA)
end if
Long File Names (LFN) are not supported.
Library Example
This project consists of several blocks that demonstrate various aspects of usage of the Cf_Fat16 library. These are:
273
- Creation of new file and writing down to it;
- Opening existing file and re-writing it (writing from start-of-file);
- Opening existing file and appending data to it (writing from end-of-file);
- Opening a file and reading data from it (sending it to USART terminal);
- Creating and modifying several files at once;
- Reading file contents;
- Deleting file(s);
- Creating the swap file (see Help for details);
MikroElektronika