Hardware description
Parameters:
DataPtr
: Register to store the data to be read, of type
unsigned 8
.
LastData
: Compile time constant to indicate the end of the data. Set
LastData
to 1 to indicate that the last byte of data is being read.
Timing:
160 clock cycles or more (including setting the address).
Description:
Reads sequential data, one byte at a time, from the SmartMedia device.
You need to call
RC200SmartMediaSetAddress()
before you call this macro
for the first time. The data returned is from the first valid (non-corrupt) block after
the address set by
RC200SmartMediaSetAddress()
. The read spans across
blocks and will wrap to the beginning of the card if it is not terminated before this.
When the last byte of data is being read, you should set
LastData
to 1 and then
call
RC200SmartMediaOperationEnd()
.
To perform a real-time check for errors whilst the read is in progress, use
RC200SmartMediaGetError()
.
Writing to the SmartMedia
extern macro proc RC200SmartMediaWrite (
Data
,
LastData
);
Parameters:
Data
: Register/value to write, of type
unsigned 8
.
LastData
: Compile time constant to indicate the end of the data. Set
LastData
to 1 to indicate that the last byte of data is being written.
Timing:
390 clock cycles or more (including setting the address).
Description:
Writes sequential data, one byte at a time, to the SmartMedia card.
You need to call
RC200SmartMediaSetAddress()
before you call this macro
for the first time. You can terminate the write by setting
LastData
to 1.
You must call
RC200SmartMediaOperationEnd()
at the end of the write.
The write spans across the end of the card if it is not terminated before this. Data
will be padded up to a page with "FF"s.
To perform a real-time check for errors whilst the write is in progress, use
RC200SmartMediaGetError()
.
Ï
A write process erases the entire contents of the block, even if you only write one byte.
Completing a read or write operation
extern macro proc RC200SmartMediaOperationEnd (
ResultPtr
);
www.celoxica.com
Page 63