| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 32 | kaklik | /********************************************************************* |
| 2 | * |
||
| 3 | * File system access interface layer header File |
||
| 4 | * |
||
| 5 | ********************************************************************* |
||
| 6 | * FileName: FileSystem.h |
||
| 7 | * Description: File system access interface layer |
||
| 8 | * Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
| 9 | * Compiler: Microchip C32 v1.00 or higher |
||
| 10 | * Microchip C30 v3.01 or higher |
||
| 11 | * Microchip C18 v3.20 or higher |
||
| 12 | * HI-TECH PICC-18 STD 9.50PL3 or higher |
||
| 13 | * Company: Microchip Technology, Inc. |
||
| 14 | * |
||
| 15 | * Software License Agreement |
||
| 16 | * |
||
| 17 | * Copyright (C) 2008 Microchip Technology Inc. All rights |
||
| 18 | * reserved. |
||
| 19 | * |
||
| 20 | * Microchip licenses to you the right to use, modify, copy, and |
||
| 21 | * distribute: |
||
| 22 | * (i) the Software when embedded on a Microchip microcontroller or |
||
| 23 | * digital signal controller product ("Device") which is |
||
| 24 | * integrated into Licensee's product; or |
||
| 25 | * (ii) ONLY the Software driver source files ENC28J60.c and |
||
| 26 | * ENC28J60.h ported to a non-Microchip device used in |
||
| 27 | * conjunction with a Microchip ethernet controller for the |
||
| 28 | * sole purpose of interfacing with the ethernet controller. |
||
| 29 | * |
||
| 30 | * You should refer to the license agreement accompanying this |
||
| 31 | * Software for additional information regarding your rights and |
||
| 32 | * obligations. |
||
| 33 | * |
||
| 34 | * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT |
||
| 35 | * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
||
| 36 | * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
||
| 37 | * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
| 38 | * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR |
||
| 39 | * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF |
||
| 40 | * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS |
||
| 41 | * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE |
||
| 42 | * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER |
||
| 43 | * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT |
||
| 44 | * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. |
||
| 45 | * |
||
| 46 | * Author Date Comment |
||
| 47 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
| 48 | * Aseem Swalah 7/31/08 Original |
||
| 49 | * Amit Shirbhate 7/18/09 Modified |
||
| 50 | ********************************************************************/ |
||
| 51 | #ifndef _FILE_SYSTEM_HEADER_FILE |
||
| 52 | #define _FILE_SYSTEM_HEADER_FILE |
||
| 53 | |||
| 54 | #if defined STACK_USE_MPFS2 |
||
| 55 | #include "TCPIP Stack/MPFS2.h" |
||
| 56 | typedef MPFS_HANDLE FILE_HANDLE; |
||
| 57 | #define INVALID_FILE_HANDLE MPFS_INVALID_HANDLE |
||
| 58 | #elif defined STACK_USE_MDD |
||
| 59 | #include "MDD File System/FSIO.h" |
||
| 60 | typedef FSFILE * FILE_HANDLE; |
||
| 61 | #define INVALID_FILE_HANDLE NULL |
||
| 62 | #endif |
||
| 63 | |||
| 64 | // Indicates the method for MPFSSeek |
||
| 65 | typedef enum |
||
| 66 | { |
||
| 67 | FILE_SEEK_START = 0u, // Seek forwards from the front of the file |
||
| 68 | FILE_SEEK_FORWARD, // Seek forward from the current position |
||
| 69 | FILE_SEEK_END, // Seek backwards from the end of the file |
||
| 70 | FILE_SEEK_REWIND // See backwards from the current position |
||
| 71 | } FILE_SEEK_MODE; |
||
| 72 | |||
| 73 | int FileSystemInit(void); |
||
| 74 | |||
| 75 | FILE_HANDLE FileOpen(const char * fileName, const char *mode); |
||
| 76 | |||
| 77 | FILE_HANDLE FileOpenROM(const char * fileName, const char *mode); |
||
| 78 | |||
| 79 | int FileClose(FILE_HANDLE fh); |
||
| 80 | |||
| 81 | size_t FileRead(void *ptr, size_t size, size_t n, FILE_HANDLE stream); |
||
| 82 | |||
| 83 | int FileSeek(FILE_HANDLE stream, long offset, int whence); |
||
| 84 | |||
| 85 | long FileTell(FILE_HANDLE fh); |
||
| 86 | |||
| 87 | int FileEOF(FILE_HANDLE stream); |
||
| 88 | |||
| 89 | int FileFormat(char mode, long int serialNumber, char *volumeID); |
||
| 90 | |||
| 91 | size_t FileWrite(const void *ptr, size_t size, size_t n, FILE_HANDLE stream); |
||
| 92 | |||
| 93 | size_t FileReadUInt32(DWORD *ptr, FILE_HANDLE stream); |
||
| 94 | |||
| 95 | size_t FileReadUInt16(WORD *ptr, FILE_HANDLE stream); |
||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | #endif |
||
| 100 |
Powered by WebSVN v2.8.3