This module supports the adaption of file system implementations (from other sources). weAut_01 has a slot for small memory cards (SMCs). The communication with SMCs via SPI is supported by weAutSys' respective driver implementation.
SMCs are well suited to carry a file system, FAT32 being the quasi standard there. Principally weAut_01' EEPROM and flash memory content could (partly) be organised as file system too.
weAutSys offers file systems for MMCs implemented by ChaN's fatFS. This adaption of fatFS to weAut_01 / weAutSys is suitable to handle two constraints
User software utilising a SMC file system have, of course, to consider those boundary conditions, too.
Files | |
file | smc2fs.h |
weAutSys' file system adaption to a small memory card | |
Data Structures | |
struct | FS_WORK |
Work space for file system operations (structure FS_WORK) More... | |
Defines | |
#define | fMountSMC() |
Mount / initialise the SMC file system as drive 0. | |
#define | lockFsWorkFor(ls) |
Set the lock on fsWork. | |
#define | SMC_FS_CLIUSE 0xCB |
SMC file system (structure) locked for (application) CLI. | |
#define | SMC_FS_SYSTUSE 0xFB |
SMC file system (structure) locked for runtime / system use. | |
#define | unlockFsWorkFrom(ls) |
Unset the lock on fsWork. | |
Functions | |
uint8_t | stdPutFilInf (FILINFO *filInf, const uint8_t inf) |
Write file info data to standard output. | |
Variables | |
FATFS | fileSystSMC |
File system object (the one for SMC) | |
FS_WORK | fsWork |
Work space for file system operations. |
#define fMountSMC | ( | ) |
Mount / initialise the SMC file system as drive 0.
See also: fmount(0, &fileSystSMC);
#define SMC_FS_SYSTUSE 0xFB |
SMC file system (structure) locked for runtime / system use.
#define SMC_FS_CLIUSE 0xCB |
#define lockFsWorkFor | ( | ls | ) |
Set the lock on fsWork.
ls | lock signature (uint8_t); see SMC_FS_SYSTUSE |
#define unlockFsWorkFrom | ( | ls | ) |
uint8_t stdPutFilInf | ( | FILINFO * | filInf, |
const uint8_t | inf | ||
) |
Write file info data to standard output.
This function outputs the information on the file filInf
to the standard output stream.
The bits of the parameter inf
control the information output:
Bit 7 (0x80) : output leading blank
Bit 5 (0x20) : output last modified date / time
Bit 4 (0x10) : output attributes
Bit 3 (0x08) : output length
Bit 0 (0x01) : output trailing new line
filInf | pointer to the file information structure |
inf | the informations to output |
Work space for file system operations.
This structure holds the state of the system or application software's ongoing file system operations. In a small realtime system file system operations on SMCs (interfaced via SPI) are relatively expensive in terms of both total processor time and size of indivisible (by yielding) sub-steps.
Hence file system operations should occur in one (well designed / planned) thread at a time only. This structure fsWork of type FS_WORK is to hold all file system related state and should remain singleton for said reasons.
As this variables singleton property is strongly recommended some functions and macros work directly on it. Their services are not available for further instances if application software chooses to have them.