16#include <basictypes.h>
20 PARTITION_TYPE_EMPTY = 0x00,
21 PARTITION_TYPE_FAT12 = 0x01,
22 PARTITION_TYPE_FAT16 = 0x04,
23 PARTITION_TYPE_NTFS = 0x07,
24 PARTITION_TYPE_EXFAT = 0x07,
25 PARTITION_TYPE_LINUX = 0x93,
27 PARTITION_TYPE_EFFS = 0x25,
32 PARTITION_FLAG_FREE = 0x00,
33 PARTITION_FLAG_INUSE = 0x01,
34 PARTITION_FLAG_EXTENDED = 0x02,
35 PARTITION_FLAG_BOOT = 0x80,
40 PARTITION_ERROR_NOERR = 0,
42 PARTITION_ERROR_OVERLAP = -1,
43 PARTITION_ERROR_TOOBIG = -2,
44 PARTITION_ERROR_IDX = -3,
45 PARTITION_ERROR_TYPE = -4,
46 PARTITION_ERROR_TABLE_FULL= -5,
47 PARTITION_ERROR_BOUNDS = -6,
48 PARTITION_ERROR_UNKNOWN = -255,
115uint32_t hamming_checksum(
const uint8_t *dat, uint32_t datBits, uint8_t codeLen);
116int hamming_validate(
const uint8_t *dat, uint32_t datBits, uint32_t checksum, uint8_t codeLen);
117int hamming_validateOrFix(uint8_t *dat, uint32_t datBits, uint32_t checksum, uint8_t codeLen);
118int hamming_anneal(uint8_t *dat, uint32_t datBits, uint32_t checksum, uint8_t codeLen, uint8_t errBit);
123int createPartitionTable(
PartitionTable *pt, uint8_t sectorLenExp, uint64_t totalSectors);
127 uint64_t startSector, uint64_t sectorCount,
128 uint8_t type,
bool makeBootable);
140#define HAL_FS_MOUNT_SYS "A:/sys"
141#define HAL_FS_MOUNT_APP "A:/app"
142#define HAL_FS_MOUNT_USR "A:/usr"
144#define HAL_FS_SYS_FILE_DIR "files"
145#define HAL_FS_PATH_SYS HAL_FS_MOUNT_SYS "/" HAL_FS_SYS_FILE_DIR "/"
146#define HAL_FS_PATH_APP HAL_FS_MOUNT_APP "/"
147#define HAL_FS_PATH_USR HAL_FS_MOUNT_USR "/"
149#define HAL_FS_NAME_CONFIG "config"
150#define HAL_FS_NAME_CERTSTORE "certs"
151#define HAL_FS_NAME_USERPARAM "usrparam"
152#define HAL_FS_NAME_APP "app"
154#define HAL_FS_VER_SUFFIX ".x"
156#define HAL_FS_FILE_CONFIG HAL_FS_PATH_SYS HAL_FS_NAME_CONFIG
157#define HAL_FS_FILE_CERTSTORE HAL_FS_PATH_SYS HAL_FS_NAME_CERTSTORE
158#define HAL_FS_FILE_USERPARAM HAL_FS_PATH_SYS HAL_FS_NAME_USERPARAM
159#define HAL_FS_FILE_APP HAL_FS_PATH_SYS HAL_FS_NAME_APP
Filesystem Configuration.
Definition effs_pt.h:100
uint8_t dSizeExp
Max size of fat+directory+block index.
Definition effs_pt.h:106
uint8_t sSizeExp
Sector size wanted to use (less than block size.
Definition effs_pt.h:104
uint8_t pAsBytePtr[1]
Definition effs_pt.h:111
uint8_t csum
Hamming code csum of struct.
Definition effs_pt.h:109
uint8_t cacheSizeExp
Write cache size.
Definition effs_pt.h:107
uint8_t separatedir
If directory used separatelly from FAT (NAND)
Definition effs_pt.h:108
uint16_t maxblock
Maximum number of block can be used.
Definition effs_pt.h:103
uint8_t blSizeExp
Block size in bytes.
Definition effs_pt.h:105
uint64_t endAddr(uint32_t sectorSize)
uint32_t firstSector
Index of first sector for this partition.
Definition effs_pt.h:63
uint32_t flags
Any special flags for the partition.
Definition effs_pt.h:60
uint64_t startAddr(uint32_t sectorSize)
uint64_t setStart(uint64_t startSector)
uint64_t setSectors(uint64_t sCount)
uint32_t partitionType
What type of filesystem is this partition.
Definition effs_pt.h:62
uint32_t sectorCount
How many sectors are in this partition.
Definition effs_pt.h:61
PartitionEntry part[8]
Partition entries.
Definition effs_pt.h:88
uint8_t pAsBytePtr[1]
Definition effs_pt.h:91
uint64_t sectorLen()
Definition effs_pt.h:96
uint32_t totalSectors
Total sectors available, see.
Definition effs_pt.h:87
uint8_t sectorLenExp
Sector Length, see Table Length.
Definition effs_pt.h:86
uint64_t setSectors(uint64_t sCount)
uint8_t bootExe[422]
If direct execution is ever supported...
Definition effs_pt.h:84
uint8_t tableLenExp
Table Length => 2**tableLenExp: 2**8 => 256 bytes.
Definition effs_pt.h:85
uint8_t csums[16]
Hamming code csum of 31 byte blocks comprising the Table.
Definition effs_pt.h:89