00001 /*This file has been prepared for Doxygen automatic documentation generation.*/ 00014 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00015 * 00016 * Redistribution and use in source and binary forms, with or without 00017 * modification, are permitted provided that the following conditions are met: 00018 * 00019 * 1. Redistributions of source code must retain the above copyright notice, this 00020 * list of conditions and the following disclaimer. 00021 * 00022 * 2. Redistributions in binary form must reproduce the above copyright notice, 00023 * this list of conditions and the following disclaimer in the documentation 00024 * and/or other materials provided with the distribution. 00025 * 00026 * 3. The name of Atmel may not be used to endorse or promote products derived 00027 * from this software without specific prior written permission. 00028 * 00029 * 4. This software may only be redistributed and used in connection with an Atmel 00030 * AVR product. 00031 * 00032 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00033 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00034 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00035 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00036 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00037 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00038 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00039 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00040 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00041 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00042 * 00043 */ 00044 #ifndef _FILE_H_ 00045 #define _FILE_H_ 00046 00047 #include "fs_com.h" 00048 #include "fat.h" 00049 00050 //_____ D E F I N I T I O N S ______________________________________________ 00051 00054 #define FS_SEEK_SET 0x00 00055 #define FS_SEEK_END 0x01 00056 #define FS_SEEK_CUR_RE 0x02 00057 #define FS_SEEK_CUR_FW 0x03 00058 00059 00062 typedef struct { 00063 U8 u8_lun; 00064 U32 u32_addr; 00065 U16 u16_size; 00066 } Fs_file_segment; 00068 00069 00070 //_____ D E C L A R A T I O N S ____________________________________________ 00071 00077 Bool file_ispresent( void ); 00078 00091 Bool file_open( U8 fopen_mode ); 00092 00110 Bool file_read( Fs_file_segment _MEM_TYPE_SLOW_ *segment ); 00111 00120 U16 file_read_buf( U8 _MEM_TYPE_SLOW_ *buffer , U16 u16_buf_size ); 00121 00127 U16 file_getc( void ); 00128 00146 Bool file_write( Fs_file_segment _MEM_TYPE_SLOW_ *segment ); 00147 00159 Bool file_set_eof( void ); 00160 00169 U16 file_write_buf( U8 _MEM_TYPE_SLOW_ *buffer , U16 u16_buf_size ); 00170 00178 Bool file_putc( U8 u8_byte ); 00179 00184 U32 file_getpos( void ); 00185 00198 Bool file_seek( U32 u32_pos , U8 u8_whence ); 00199 00206 U8 file_bof( void ); 00207 00214 U8 file_eof( void ); 00215 00218 void file_flush( void ); 00219 00222 void file_close( void ); 00223 00224 00225 #endif // _FILE_H_