manufacturer of I/O-rich SBCs, operator interfaces, handheld instruments, and development tools for embedded control low cost single board computers, embedded controllers, and operator interfaces for scientific instruments & industrial control development tools for embedded control order our low cost I/O-rich embedded control products embedded controller manufacturer profile single board computers & embedded controllers development tools & starter kits for your embedded design operator interfaces with touchscreens and graphical user interface plug-in expansion modules for digital & analog I/O C language & Forth language integrated development tools, IDE single board and embedded computer accessories embedded controller enclosures, bezels, environmental gaskets
Table of Contents

Introduction

Specifications

Hardware

Flash Card

Connecting To the Wildcard Bus

Selecting the Wildcard Address

Installing the CF Card

CF Card Software Package User Guide and Glossary

How To Install the CF Software

Using the Driver Code with C

Using the Driver Code with Forth

CF Card Software

Categorized List of Functions and Constants

ATA Failure Codes

ATA Primitives

CF Card Information

Directory

File Access and Position Modes

File I/O

File Processing

File System Error Handling

Initialization

Overview of Glossary Notation

Using the File System Functions

Commonly Used Terms

String Parameters and the Use of THIS_PAGE

Access Privileges

Root Directory Only and File Name Restrictions

File Position Indicator

Error Handling

Real-Time Clock on the Host Computer Enables Time/Date Marking of Files 12

Initialization

Automatic Initialization and File Processing

Upgrade note for former Memory Interface Board (MIB) Users

How To Create and Use an AUTOEXEC.QED File

Compile a Program into Flash Memory

Create a Set of Image Files

Transfer the Image File Contents into Memory

Restrictions on Software Upgrades

Recovering from Buggy AUTOSTART.QED Files

Compact Flash Card Software Package Main Glossary

Upgrade Notice for Prior Users of the Memory Interface Board

Sample FILEDEMO.C File (pdf)

Sample FILEDEMO.4th File (pdf)

CF Wildcard Hardware Schematic

The Compact-Flash Wildcard and
CF Card Software Package User Guide

<< Previous | Next>>

C: A_MODE
4th: A_MODE ( -- n )
A constant that is passed as a file-access privilege parameter to the File_Open function to indicate that the file is append-only. If A_MODE is specified, reads are not allowed, and all data written to the file will automatically case the file position to be moved to the end of the file regardless of the originally specified file position. See also R_MODE, W_MODE, RPLUS_MODE, WPLUS_MODE, and APLUS_MODE.

C: ulong Card_Size( void )
4th: Card_Size ( -- d.size )
Returns the card size as a 32-bit number. It is calculated as:
    SECTOR_SIZE * (1 + LAST_SECTOR)
where LAST_SECTOR is a value obtained by ATA_ID_Drive. The returned card size does not include the "hidden" sectors at the physical start of the drive where the master boot record is kept (see Hidden_Sectors). This software package supports ATA flash cards or hard drives up to 128 Gigabytes. Note that the file system must be initialized by Init_File_System or Init_File_IO before using this function; otherwise the returned value is meaningless.

C: void Clear_File_Error( int file_id )
4th: Clear_File_Error ( file_id -- )
Clears the file error flag so that an immediately following call to the File_Error function would return zero, and an immediate call to Report_File_Errors would report no errors. Also zeros the file-open error flag so that an immediate call to Report_File_Open_Errors would report no errors. This function is called by File_Rewind. See the glossary entries that begin with "Err_" for a list of bit-mapped error codes.

C: void Dir( void )
4th: Dir ( -- )
Prints to the active serial port a directory listing for the root directory that is similar in format to the a DOS DIR command. Does not list hidden, system, volume-label, directory, or erased files. Lists the filename and extension, filesize, time and date of last modification (using 24 hour time reporting), and summarizes the number of files listed and the total size in bytes. Typically typed interactively from the terminal to the QED-Forth monitor as:
    Dir
Implementation Details: The format of each line is as follows:
    filename ext filesize mm-dd-yyyy hh:mm
where the filename is 8 characters and ext is 3 characters (both are padded with spaces on the right if necessary), mm=month, dd=date, yyyy=4digit year, hh=hour (24-hour military style), and mm=minutes. The format of the final summary line is:
    nn file(s) dddddddd bytes
The function prints "Initialization Error!" if the file system has not been initialized (see Init_File_System), and prints "Error: Can't read disk!" if a read error occurs.

C: void Dir_Names( void )
4th: Dir_Names ( -- )
Prints to the active serial port a directory listing for the files in the root directory, listing only the name and extension of each file. Does not list hidden, system, volume-label, directory, or erased files. See the glossary entry for Dir for more details. Implementation Details: The format of each line is as follows:
    filename ext
where the filename is 8 characters and ext is 3 characters (both are padded with spaces on the right if necessary).

C: void Dir_Open( void )
4th: Dir_Open ( -- )
Prints to the active serial port a directory listing for the open files in the root directory. Uses the same format as the DIR command, except that the file_id is also listed for each open file. See DIR. Typically typed interactively from the terminal to the QED-Forth monitor as:
    Dir_Open
Implementation Details: Unlike Dir, the Dir_Open function extracts file information from RAM-based structures, and so may report information (especially file size and date/time) that has not yet been flushed to the disk. See File_Flush.

C: int Do_Autoexec ( void )
4th: Do_Autoexec ( -- error )
If a CF Card is present, this routine calls Init_File_System and Process_Autoexec to search for a file named AUTOEXEC.QED and process it if it is found. See the entries for Init_File_IO and Process_Autoexec for detailed descriptions. Note that the Set_CF_Module function must be executed before calling this function. The module number must correspond to the module address set by the module address selection jumpers and the module port (see Table 1 above). This function is typically called from within the Priority Autostart routine of an application, so that the CF Card (if present) is initialized and automated processing of AUTOEXEC.QED can be used for automated software upgrades or data exchanges.
Note: this function uses the top 16 Kbytes of the page 3 RAM. User-available RAM on page 3 in the STANDARD.MAP thus ends at 0x4000. If you need this page 3 RAM for other purposes, do not use this function; rather, set call Set_CF_Module, call Init_File_IO with parameters of your choosing to set up an appropriate memory map, and then explicitly call Process_Autoexec.

<< Previous | Next>>


Home|Site Map|Products|Manuals|Resources|Order|About Us
Copyright (c) 2006 Mosaic Industries, Inc.
Your source for single board computers, embedded controllers, and operator interfaces for instruments and automation