User manual

RC200/203 Manual
www.celoxica.com Page 67
To perform a read or write using logical addressing you need to:
1. Call
RC200SmartMediaCheckLogicalFormat().
If this macro returns 1 to indicate failure you need to perform a logical format
on the card using the Celoxica FTU2 program.
2. Set the address, using
RC200SmartMediaSetLogicalAddress().
3. Call
RC200SmartMediaRead() or RC200SmartMediaWrite() for each byte of
data. For the last byte of data, set the
LastData compile-time constant to 1.
4. Call
RC200SmartMediaOperationEnd() to complete the read or write process
after all the data has been read or written.
To perform a read or write using physical addressing you need to:
1. Set the address, using
RC200SmartMediaSetAddress().
2. Call
RC200SmartMediaRead() or RC200SmartMediaWrite() for each byte of
data. For the last byte of data, set the
LastData compile-time constant to 1.
3. Call
RC200SmartMediaOperationEnd() to complete the read or write process
after all the data has been read or written.
Do not use the SmartMedia macros at the same time as any other accesses to the
CPLD. If you have called RC200SmartMediaSetLogicalAddress(),
RC200SmartMediaSetAddress(), RC200SmartMediaRead() or RC200SmartMediaWrite(),
you need to get the return value from RC200Smar before tMediaOperationEnd()
accessing the CPLD again. If you have used any of the other SmartMedia macros, you
can access the CPLD after they have completed.
5.15.2 SmartMedia management tasks
extern macro proc RC200SmartMediaRun (ClockRate);
Parameters:
of the clock domain of the call to this
Description:
a are not run in parallel with
other CPLD control commands.
ClockRate
macro, in Hz.
: Clock rate
Timing: Does not terminate in normal use.
Runs the SmartMedia physical layer driver.
You must run this macro in parallel with the CPLD controller
macro,
RC200CPLDRun(). The SmartMedia can only function
once you have enabled the CPLD. You must ensure that
communications with SmartMedi