file.h

Go to the documentation of this file.
00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
00014 /* Copyright (C) 2006-2008, 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,
00020  * this 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  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
00030  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00031  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
00032  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00033  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00034  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00035  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00036  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00038  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  */
00040 
00041 #ifndef _FILE_H_
00042 #define _FILE_H_
00043 
00044 #include "fs_com.h"
00045 #include "fat.h"
00046 
00047 //_____ D E F I N I T I O N S ______________________________________________
00048 
00051 #define  FS_SEEK_SET       0x00  
00052 #define  FS_SEEK_END       0x01  
00053 #define  FS_SEEK_CUR_RE    0x02  
00054 #define  FS_SEEK_CUR_FW    0x03  
00055 
00056 
00059 typedef struct {
00060    U8   u8_lun;            
00061    U32  u32_addr;          
00062    U16  u16_size;          
00063 } Fs_file_segment;
00065 
00066 
00067 //_____ D E C L A R A T I O N S ____________________________________________
00068 
00074 Bool  file_ispresent( void );
00075 
00088 Bool  file_open( U8 fopen_mode );
00089 
00107 Bool  file_read( Fs_file_segment _MEM_TYPE_SLOW_ *segment );
00108 
00117 U16   file_read_buf( U8 _MEM_TYPE_SLOW_ *buffer , U16 u16_buf_size );
00118 
00124 U16   file_getc( void );
00125 
00143 Bool  file_write( Fs_file_segment _MEM_TYPE_SLOW_ *segment );
00144 
00156 Bool  file_set_eof( void );
00157 
00166 U16   file_write_buf( U8 _MEM_TYPE_SLOW_ *buffer , U16 u16_buf_size );
00167 
00175 Bool  file_putc( U8 u8_byte );
00176 
00181 U32   file_getpos( void );
00182 
00195 Bool  file_seek( U32 u32_pos , U8 u8_whence );
00196 
00203 U8    file_bof( void );
00204 
00211 U8    file_eof( void );
00212 
00215 void  file_flush( void );
00216 
00219 void  file_close( void );
00220 
00221 
00222 #endif  // _FILE_H_

Generated on Fri May 15 15:41:36 2009 for ATMEL by  doxygen 1.5.3