Contiki-Inga 3.x
Functions | Variables
cfs-fat.c File Reference

 FAT driver implementation
More...

#include "cfs-fat.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void cfs_fat_print_file_info (int fd)
 
void cfs_fat_print_dir_entry (struct dir_entry *dir_entry)
 
void cfs_fat_get_fat_info (struct FAT_Info *info)
 Populates the given FAT_Info with the mounted FAT_Info. More...
 
uint16_t cfs_fat_get_last_date (int fd)
 Returns the date of last modification. More...
 
uint16_t cfs_fat_get_last_time (int fd)
 Returns the time of last modification. More...
 
uint16_t cfs_fat_get_create_date (int fd)
 Returns the date of creation. More...
 
uint16_t cfs_fat_get_create_time (int fd)
 Returns the time of creation. More...
 
void cfs_fat_flush ()
 Writes the current buffered block back to the disk if it was changed.
 
uint8_t cfs_fat_mount_device (struct diskio_device_info *dev)
 Tries to mount the defined device. More...
 
void cfs_fat_umount_device ()
 Umounts the mounted device. More...
 
int cfs_open (const char *name, int flags)
 Open a file. More...
 
void cfs_close (int fd)
 Close an open file. More...
 
int cfs_read (int fd, void *buf, unsigned int len)
 Read data from an open file. More...
 
int cfs_write (int fd, const void *buf, unsigned int len)
 Write data to an open file. More...
 
cfs_offset_t cfs_seek (int fd, cfs_offset_t offset, int whence)
 Seek to a specified position in an open file. More...
 
int cfs_remove (const char *name)
 Remove a file. More...
 
int cfs_opendir (struct cfs_dir *dirp, const char *name)
 Open a directory for reading directory entries. More...
 
int cfs_readdir (struct cfs_dir *dirp, struct cfs_dirent *dirent)
 Read a directory entry. More...
 
void cfs_closedir (struct cfs_dir *dirp)
 Close a directory opened with cfs_opendir(). More...
 
uint32_t cfs_fat_file_size (int fd)
 Returns the file size of the associated file. More...
 
void cfs_fat_sync_fats ()
 Syncs every FAT with the first. More...
 
uint8_t is_a_power_of_2 (uint32_t value)
 Tests if the given value is a power of 2. More...
 
uint32_t round_down_to_power_of_2 (uint32_t value)
 Rounds the value down to the next lower power of 2. More...
 

Variables

struct file_system mounted
 From fat.c.
 
struct file fat_file_pool [FAT_FD_POOL_SIZE]
 From fat.c.
 
struct file_desc fat_fd_pool [FAT_FD_POOL_SIZE]
 From fat.c.
 

Detailed Description

 FAT driver implementation
Author
Christoph Peltz peltz.nosp@m.@ibr.nosp@m..cs.t.nosp@m.u-bs.nosp@m..de Enrico Joerns joern.nosp@m.s@ib.nosp@m.r.cs..nosp@m.tu-b.nosp@m.s.de

Definition in file cfs-fat.c.