/** 
 * \file fat32_cfg.h
 * \brief FAT32 configuration file
 * \details File contains configuration constants for FAT32 app
 *
 * \author Juraj Golej
 * \version 1.0
 */


#ifndef FAT32_CFG_H_
#define FAT32_CFG_H_

#define FAT32_OFFSET_PART_1				0x01BE	///< Partition 1 offset (in bytes)
#define FAT32_OFFSET_PART_2				0x01CE	///< Partition 2 offset (in bytes)
#define FAT32_OFFSET_PART_3				0x01DE	///< Partition 3 offset (in bytes)
#define FAT32_OFFSET_PART_4				0x01EE	///< Partition 4 offset (in bytes)

#define FAT32_OFFSET_PART_TYPE			0x04	///< Partition type offset (in bytes)
#define FAT32_OFFSET_PART_BEGIN			0x08	///< Partition boot sector offset (in bytes)

#define FAT32_CHS						0x0B	///< Cylinder-head-sector addressing type
#define FAT32_LBA						0x0C	///< Logical addressing type

#define FAT32_OFFSET_BOOT_SECTOR_BYTES	0x0B	///< Number of bytes per one sector offset
#define FAT32_OFFSET_BOOT_CLUS_SECTORS	0x0D	///< Number of sectors per cluster offset
#define FAT32_OFFSET_BOOT_RESERVED		0x0E	///< Number of reserved sectors offset
#define FAT32_OFFSET_BOOT_FATCOUNT		0x10	///< Number of FAT tables offset
#define FAT32_OFFSET_BOOT_FATSECTORS	0x24	///< Number of sector per one FAT offset
#define FAT32_OFFSET_BOOT_ROOT_CLUS		0x2C	///< Root cluster number in data area offset

#define FAT32_SECTOR_SIZE				0x200	///< FAT32 sector size

#define FAT32_CLUSTER_MASK				0x0FFFFFFF	///< Cluster mask in FAT
#define FAT32_CLUSTER_END				0x0FFFFFF8	///< Last sector in FAT
#define FAT32_CLUSTER_FREE				0x00000000	///< Free sector in FAT

#endif /* FAT32_CFG_H_ */