On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTFiles-32 Programming Manual
Introduction
The FAT File System Structure
The ISO 9660 File System Structure
The exFAT File System Structure
RTFiles-32 in Embedded Applications
RTFiles-32 APIs
Configuring RTFiles-32
Demo Programs
Advanced Topics
Optimizing for Best Throughput
Optimizing for Best Data Security
Real-Time File I/O
Using RTFiles-32 with RTTarget-32
Win32 API Emulation with RTTarget-32
Using RTFiles-32 with RTKernel-32
Custom Disk Device Drivers
Custom Flash MTD Drivers
Porting RTFiles-32 to other Platforms
RTFiles-32 Reference Manual
RTIP-32
RTPEG-32
RTUSB-32
|
Custom Disk Device Drivers
Each disk device driver must define three items:
- A structure of type RTFDriver containing the driver's API.
- A unique structure type defining the data required for each device to be handled by the drive. Since a driver must be able to handle several devices, a unique data area is reserved for each device. The data must be statically allocated by the application and a pointer to the data must be placed in the DriverData field of the device list. It is passed in parameter DriveData to all driver functions. The layout of the device data is arbitrary, but must be defined by the driver.
- Optionally, device-specific flags to control device options. A driver may define device flags to control options for the device. Such flags may be specified in the DeviceFlags field in the device list; they will be passed to the Flags parameter of disk device driver API function MountDevice. The lower 16 bits of the device flags are reserved for RTFiles-32's device independent flags. If a custom driver defines its own flags, bits 16 to 31 must be used.
Custom drivers are used just like the drivers included with RTFiles-32. References to a custom driver can be placed in the RTFiles-32 device list to become effective.
Please refer to the source code of the supplied drivers for examples. In particular, the example DrvDemo contains a very simple driver example in source files Drvsimpl.h and Drvsimpl.c. It is recommended to use this sample driver as a starting point to implement custom drivers. The complete reference of the device driver API is included in the RTFiles-32 Reference Manual.
Advanced Topics
Using RTFiles-32 with RTKernel-32
Custom Flash MTD Drivers
|