Volatile RAM file system. More...
![]() |
Defines | |
#define | SEEK_SET 0 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | NODETYPE_REG 0 |
#define | NODETYPE_DIR 1 |
#define | PNUT_MAX_NAMELEN (PNUT_DIRENT_SIZE - sizeof(PNUT_BLKNUM) - sizeof(uint8_t) - 1) |
Maximum length of a base name. | |
#define | PNUT_MAX_FILESIZE (PNUT_BLOCKS_PER_NODE * PNUT_BLOCK_SIZE) |
Maximum size of a file or directory. | |
#define | NUTBANK_SIZE 16384 |
Size of each memory bank. | |
#define | PNUT_TOTAL_BLOCKS (PNUTBANK_COUNT * (NUTBANK_SIZE / PNUT_BLOCK_SIZE)) |
Total number of blocks on this device. | |
#define | BLOCKS_PER_BANK (NUTBANK_SIZE / PNUT_BLOCK_SIZE) |
#define | NUTBANK_SR 0xFF00 |
#define | NUTBANK_START 0x8000 |
#define | NUTBANK_PTR ((char *)NUTBANK_START) |
Typedefs | |
typedef short | PNUT_BLKNUM |
Functions | |
void | BankSelect (PNUT_BLKNUM blk) |
Make the bank visible, which contains the specified block. | |
PNUT_NODE * | BankNodePointer (PNUT_BLKNUM blk) |
Select specified bank and return pointer to block. | |
int | PnutIOCtl (NUTDEVICE *dev, int req, void *conf) |
Device specific functions. | |
Variables | |
NUTDEVICE | devPnut |
Peanut device information structure. | |
Peanut File System Configuration | |
The Nut/OS Configurator may be used to override the default values. | |
#define | PNUT_DIRENT_SIZE 32 |
Size of a filesystem block. | |
#define | PNUT_BLOCKS_PER_NODE 250 |
Maximum number of blocks per node. | |
#define | PNUTBANK_COUNT 30 |
Volatile RAM file system.
#define PNUT_DIRENT_SIZE 32 |
#define PNUT_BLOCKS_PER_NODE 250 |
Maximum number of blocks per node.
Peanut supports only one node per file. Thus, this number multiplied by PNUT_BLOCK_SIZE specifies the maximum file size.
Changings this number will change the size of the node structure, which must fit into a single filesystem block.
#define PNUT_MAX_NAMELEN (PNUT_DIRENT_SIZE - sizeof(PNUT_BLKNUM) - sizeof(uint8_t) - 1) |
#define PNUT_MAX_FILESIZE (PNUT_BLOCKS_PER_NODE * PNUT_BLOCK_SIZE) |
#define PNUT_TOTAL_BLOCKS (PNUTBANK_COUNT * (NUTBANK_SIZE / PNUT_BLOCK_SIZE)) |
Total number of blocks on this device.
This value is calulated by multiplying the number of memory banks reserved for the file system by the number of blocks per bank.
For example, if all 30 banks, which are available on Ethernut 2, are reserved for PNUT and if the size of a block is 512 bytes, then 960 blocks are available.
#define BLOCKS_PER_BANK (NUTBANK_SIZE / PNUT_BLOCK_SIZE) |
Definition at line 329 of file pnutfs.c.
Referenced by BankNodePointer(), and BankSelect().
#define NUTBANK_PTR ((char *)NUTBANK_START) |
Definition at line 339 of file pnutfs.c.
Referenced by BankNodePointer().
typedef short PNUT_BLKNUM |
void BankSelect | ( | PNUT_BLKNUM | blk | ) |
Make the bank visible, which contains the specified block.
On Ethernut 2 we select a bank by writing the bank number to the bank register base address plus the bank number.
For example, writing 0x12 to 0xFF12 selects bank 18 (0x12), assuming that 0xFF00 is the bank register base address.
blk | Block number to access. |
Definition at line 352 of file pnutfs.c.
References BLOCKS_PER_BANK, and NutSegBufEnable.
Referenced by BankNodePointer().
PNUT_NODE* BankNodePointer | ( | PNUT_BLKNUM | blk | ) |
Select specified bank and return pointer to block.
Definition at line 367 of file pnutfs.c.
References BankSelect(), BLOCKS_PER_BANK, and NUTBANK_PTR.
int PnutIOCtl | ( | NUTDEVICE * | dev, | |
int | req, | |||
void * | conf | |||
) |
Device specific functions.
Definition at line 1268 of file pnutfs.c.
References FS_DIR_CLOSE, FS_DIR_CREATE, FS_DIR_OPEN, FS_DIR_READ, FS_DIR_REMOVE, FS_FILE_DELETE, FS_FILE_SEEK, FS_FILE_STATUS, FS_STATUS, FSCP_STATUS::par_path, and FSCP_STATUS::par_stp.
NUTDEVICE devPnut |