Software Configuration

Microchip MDD File System Interface

MDDFS Interface Library Help
Software Configuration

Once your hardware is configured, the next step is to configure the MDDFS Library firmware. Library configuration is stored as a set of configuration macros in FSconfig.h and HardwareProfiles.h in the demo application folders. To begin, open FSconfig.h in a text editor program like MPLAB.

FSconfig.h

This file contains options to configure the library firmware. The configuration macros include:

Macro/Option 
Category 
Indication 
Definition 
Describes the maximum number of files that can/will be opened at once. 
Definition 
Describes the size of a sector on the device. This will almost always equal 512. 
Feature toggle 
Comment this definition out to disable the file search functions (FindFirst and FindNext). This will reduce code size. 
Feature toggle 
Comment this definition out to disable all write functionality. This will reduce code size. 
Feature toggle 
Comment this definition out to disable the format function. This will reduce code size. 
Feature toggle 
Comment this definition out to disable all directory functionality. This will reduce code size. 
Feature toggle 
Comment this definition out to disable -pgm functions. The library requires -pgm functions to be disabled when not using PIC18. This will reduce code size. 
Feature toggle 
Comment this definition out to disable the FSfprintf function. This will reduce code size. 
Feature toggle 
Comment this definition out to disable FAT32 support. FAT12 and FAT16 will still be supported. 
Create/last modified timestamp generator 
Uncomment this macro to generate timestamps automatically with the RTCC module. You must configure the RTCC for this method to work correctly. Only one timestamp generation method may be enabled at one time. 
Create/last modified timestamp generator 
Uncomment this macro to generate timestamps based on global variabled that are set manually by the user using the SetClockVars() function. Only one timestamp generation method may be enabled at one time. 
Create/last modified timestamp generator 
Uncomment this macro to generate static timestamps. These timestamps will be incremented by 1 whenever the file is accessed. This should only be used in applications when create.modified times are not required. Only one timestamp generation method may be enabled at one time. 
Static/dynamic FSFILE object allocation. 
Set the #if preprocessor definition to 1 to allocate FSFILE objects dynamically. You will be required to allocate a heap to do this. For PIC18, you will be required to include the salloc.c and salloc.h files in your project. If the #if statement is set to 0, FSFILE objects will be allocated in a static array, with the maximum number of FSFILE objects determined by the FS_MAX_FILES_OPEN macro. 
HardwareProfiles.h

The HardwareProfiles.h header file reflects the state of the hardware. It contains the following macros:

Macro 
Indication 
Returns the value of the system clock. 
Returns the value of the microcontroller's peripheral clock 
Returns the value of the microcontroller's instruction clock 
Uncomment this definition to use the SD-SPI physical layer. Only one physical layer may be enabled at one time. 
Uncomment this definition to use the CF-PMP physical layer. Only one physical layer may be enabled at one time. 
Uncomment this definition to use the CF-Manual physical layer. Only one physical layer may be enabled at one time. 
Uncomment this definition to use the USB host physical layer. This physical layer is described in greater detail at http://www.microchip.com/usb. Only one physical layer may be enabled at one time. 
Used for the SD-SPI physical layer. Set these to the I/O port register locations for the chip select, card detect, and write protect signals (e.g. PORTBbits.RB3). 
Used for the SD-SPI physical layer. Set these to the I/O tris register locations that correspond to the pins used for each signal (e.g. TRISBbits.TRISB3). 
Used for the SD-SPI physical layer. Set these to the SPI registers or bits that correspond to the module you're using (e.g. SSP1CON1, SSP1STAT, SSP1BUF, SSP1STATbits.BF, SSP1CON1bits, SSP1STATbits, PIR1bits.SSPIF). 
Used for the SD-SPI physical layer. Set these to the SPI tris/lat/port register bits for the module you're using. 
Used with the CF-PMP physical layer. Set these to the I/O port register locations for the reset, ready, and card detect signals for your card. 
Used with the CF-PMP physical layer. Set these to the I/O tris register that corresponds to the reset, ready, and card detect signals. 
Used with the CF-PMP physical layer. Set this to the tris register that corresponds to the PMP data bus. 
Used with the CF-Manual physical layer. Set these to the lat and tris registers that correspond to the address bus (PIC18). 
Used with the CF-Manual physical layer. Set these to the 4 lat pins used for your address bus. 
Used with the CF-Manual physical layer. Set these to the corresponding tris bits for your data bus. 
Used with the CF-Manual physical layer. Set these to the port, lat, and tris registers that correspond to your data bus. 
Used with the CF-Manual physical layer. Set these to the I/O lat and port bits that correspond to the chip select, output enable strobe, write enable strobe, reset, ready, and card detect signals, respectively. 
Used with the CF-Manual physical layer. Set these to tris bits that correspond to the control signals for the card. 
Microchip MDD File System Interface 1.2.0 - [Aug 18, 2008]
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.