Hanna
Sourcecode Batteriemanagementsystem
Datenstrukturen | Makrodefinitionen | Funktionen | Variablen
fat.c-Dateireferenz

SD-Card Reader Bibliothek von Roland Riegel. Mehr ...

#include "byteordering.h"
#include "partition.h"
#include "fat.h"
#include "fat_config.h"
#include "sd-reader_config.h"
#include "ds1388_rtc.h"
#include <string.h>
Include-Abhängigkeitsdiagramm für fat.c:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  fat_dir_struct
 
struct  fat_file_struct
 
struct  fat_fs_struct
 
struct  fat_header_struct
 
struct  fat_read_dir_callback_arg
 
struct  fat_usage_count_callback_arg
 

Makrodefinitionen

#define FAT16_CLUSTER_BAD   0xfff7
 
#define FAT16_CLUSTER_FREE   0x0000
 
#define FAT16_CLUSTER_LAST_MAX   0xffff
 
#define FAT16_CLUSTER_LAST_MIN   0xfff8
 
#define FAT16_CLUSTER_RESERVED_MAX   0xfff6
 
#define FAT16_CLUSTER_RESERVED_MIN   0xfff0
 
#define FAT32_CLUSTER_BAD   0x0ffffff7
 
#define FAT32_CLUSTER_FREE   0x00000000
 
#define FAT32_CLUSTER_LAST_MAX   0x0fffffff
 
#define FAT32_CLUSTER_LAST_MIN   0x0ffffff8
 
#define FAT32_CLUSTER_RESERVED_MAX   0x0ffffff6
 
#define FAT32_CLUSTER_RESERVED_MIN   0x0ffffff0
 
#define FAT_DIRENTRY_DELETED   0xe5
 
#define FAT_DIRENTRY_LFNLAST   (1 << 6)
 
#define FAT_DIRENTRY_LFNSEQMASK   ((1 << 6) - 1)
 

Funktionen

static cluster_t fat_append_clusters (struct fat_fs_struct *fs, cluster_t cluster_num, cluster_t count)
 
static uint8_t fat_calc_83_checksum (const uint8_t *file_name_83)
 
static uint8_t fat_clear_cluster (const struct fat_fs_struct *fs, cluster_t cluster_num)
 
static uintptr_t fat_clear_cluster_callback (uint8_t *buffer, offset_t offset, void *p)
 
void fat_close (struct fat_fs_struct *fs)
 
void fat_close_dir (struct fat_dir_struct *dd)
 
void fat_close_file (struct fat_file_struct *fd)
 
static offset_t fat_cluster_offset (const struct fat_fs_struct *fs, cluster_t cluster_num)
 
uint8_t fat_create_dir (struct fat_dir_struct *parent, const char *dir, struct fat_dir_entry_struct *dir_entry)
 
uint8_t fat_create_file (struct fat_dir_struct *parent, const char *file, struct fat_dir_entry_struct *dir_entry)
 
uint8_t fat_delete_file (struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry)
 
static uint8_t fat_dir_entry_read_callback (uint8_t *buffer, offset_t offset, void *p)
 
static offset_t fat_find_offset_for_dir_entry (struct fat_fs_struct *fs, const struct fat_dir_struct *parent, const struct fat_dir_entry_struct *dir_entry)
 
static uint8_t fat_free_clusters (struct fat_fs_struct *fs, cluster_t cluster_num)
 
uint8_t fat_get_dir_entry_of_path (struct fat_fs_struct *fs, const char *path, struct fat_dir_entry_struct *dir_entry)
 
void fat_get_file_modification_date (const struct fat_dir_entry_struct *dir_entry, uint16_t *year, uint8_t *month, uint8_t *day)
 
void fat_get_file_modification_time (const struct fat_dir_entry_struct *dir_entry, uint8_t *hour, uint8_t *min, uint8_t *sec)
 
offset_t fat_get_fs_free (const struct fat_fs_struct *fs)
 
static uint8_t fat_get_fs_free_16_callback (uint8_t *buffer, offset_t offset, void *p)
 
static uint8_t fat_get_fs_free_32_callback (uint8_t *buffer, offset_t offset, void *p)
 
offset_t fat_get_fs_size (const struct fat_fs_struct *fs)
 
static cluster_t fat_get_next_cluster (const struct fat_fs_struct *fs, cluster_t cluster_num)
 
uint8_t fat_move_file (struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry, struct fat_dir_struct *parent_new, const char *file_new)
 
struct fat_fs_structfat_open (struct partition_struct *partition)
 
struct fat_dir_structfat_open_dir (struct fat_fs_struct *fs, const struct fat_dir_entry_struct *dir_entry)
 
struct fat_file_structfat_open_file (struct fat_fs_struct *fs, const struct fat_dir_entry_struct *dir_entry)
 
uint8_t fat_read_dir (struct fat_dir_struct *dd, struct fat_dir_entry_struct *dir_entry)
 
intptr_t fat_read_file (struct fat_file_struct *fd, uint8_t *buffer, uintptr_t buffer_len)
 
static uint8_t fat_read_header (struct fat_fs_struct *fs)
 
uint8_t fat_reset_dir (struct fat_dir_struct *dd)
 
uint8_t fat_resize_file (struct fat_file_struct *fd, uint32_t size)
 
uint8_t fat_seek_file (struct fat_file_struct *fd, int32_t *offset, uint8_t whence)
 
static void fat_set_file_modification_date (struct fat_dir_entry_struct *dir_entry, uint16_t year, uint8_t month, uint8_t day)
 
static void fat_set_file_modification_time (struct fat_dir_entry_struct *dir_entry, uint8_t hour, uint8_t min, uint8_t sec)
 
static uint8_t fat_terminate_clusters (struct fat_fs_struct *fs, cluster_t cluster_num)
 
static uint8_t fat_write_dir_entry (const struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry)
 
intptr_t fat_write_file (struct fat_file_struct *fd, const uint8_t *buffer, uintptr_t buffer_len)
 
void get_datetime (uint16_t *year, uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec)
 This function is the link between the hardware RTC and the timekeeping function to the sd-reader code. Mehr ...
 

Variablen

static struct fat_dir_struct fat_dir_handles [FAT_DIR_COUNT]
 
static struct fat_file_struct fat_file_handles [FAT_FILE_COUNT]
 
static struct fat_fs_struct fat_fs_handles [FAT_FS_COUNT]
 

Ausführliche Beschreibung

SD-Card Reader Bibliothek von Roland Riegel.

Autoren
Copyright (c) 2006-2011 by Roland Riegel feedb.nosp@m.ack@.nosp@m.rolan.nosp@m.d-ri.nosp@m.egel..nosp@m.de
Datum
2011 / 15.01.2016
$Revision: 447 $
$Date: 2016-04-01 16:59:18 +0200 (Fri, 01 Apr 2016) $
Zu beachten
FAT Date-Time Support for SD-Cards

FAT implementation (license: GPLv2 or LGPLv2.1)

Autor
Roland Riegel

Definiert in Datei fat.c.