weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Files | Data Structures | Defines | Functions | Variables
Files
+ + Application (layer) support + +

Overview

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 Documentation

#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.

See also:
SMC_FS_CLIUSE
#define SMC_FS_CLIUSE   0xCB

SMC file system (structure) locked for (application) CLI.

See also:
SMC_FS_SYSTUSE
Examples:
main.c.
#define lockFsWorkFor (   ls)

Set the lock on fsWork.

Note:
This (macro) is an expression
Parameters:
lslock signature (uint8_t); see SMC_FS_SYSTUSE
Returns:
true if operation was feasible
Examples:
main.c.
#define unlockFsWorkFrom (   ls)

Unset the lock on fsWork.

Note:
This (macro) is an expression
Parameters:
lslock signature (uint8_t) of current lock holder
Returns:
false if operation was feasible; true (holder) if other holds lock
Examples:
main.c.

Function Documentation

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

Parameters:
filInfpointer to the file information structure
infthe informations to output
Returns:
0: nothing was output

Variable Documentation

File system object (the one for SMC)

This is the (one) file system state object used.

In weAutSys / weAut_01 and alike there can be just one or zero file-system for a small memory card (SMC card inserted.

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.

Examples:
main.c.