Contiki-Inga 3.x
Data Structures | Macros | Functions
cfs-fat.h File Reference

    FAT driver definitions
More...

#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdint.h>
#include "diskio.h"
#include "cfs/cfs.h"

Go to the source code of this file.

Data Structures

struct  FAT_Info
 Holds boot sector information. More...
 
struct  dir_entry
 Fat table entry for file. More...
 

Macros

#define CFS_CONF_OFFSET_TYPE   uint32_t
 Seek type is 32 bit for FAT files. More...
 
#define FAT_SYNC   0
 Allows to enable synchronization of FATs when unmounting device. More...
 

Functions

int cfs_fat_mkfs (struct diskio_device_info *dev)
 Formats the specified device as FAT16/32. More...
 
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...
 
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_sync_fats ()
 Syncs every FAT with the first. More...
 
void cfs_fat_flush ()
 Writes the current buffered block back to the disk if it was changed.
 
uint32_t cfs_fat_file_size (int fd)
 Returns the file size of the associated file. More...
 
void cfs_fat_print_cluster_chain (int fd)
 
void cfs_fat_print_file_info (int fd)
 
void cfs_fat_print_dir_entry (struct dir_entry *dir_entry)
 
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...
 

Detailed Description

    FAT driver definitions
Author
Christoph Peltz peltz.nosp@m.@ibr.nosp@m..cs.t.nosp@m.u-bs.nosp@m..de

Definition in file cfs-fat.h.