User manual
RC200/203 Manual
www.celoxica.com Page 68
5.15.3 Initializing the SmartMedia device
extern macro proc RC200SmartMediaInit (ResultPtr);
Parameters:
ResultPtr: Pointer to register of type unsigned 1. Returns 0
for success, 1 for failure.
Timing: 240 clock cycles or more.
Description: Initializes the SmartMedia device and controller.
You must call this macro when the board is switched on, or
when a SmartMedia card is inserted. It performs a reset of the
device and reads the ID to identify the size of the card.
The ID read returns a Maker and Device code which the
controller stores internally.
5.15.4 SmartMedia manufacturer and device code
extern macro expr RC200SmartMediaGetMakerCode ();
extern macro expr RC200SmartMediaGetDeviceCode ();
The manufacturer and device code of a SmartMedia device can be determined after a
successful call to
RC200SmartMediaInit() by calling RC200SmartMediaGetMakerCode()
and
RC200SmartMediaGetDeviceCode(). Both return values of type unsigned 8. For
example:
unsigned 8 Maker, Device;
Maker = RC200SmartMediaGetMakerCode ();
Device = RC200SmartMediaGetDeviceCode ();
5.15.5 Resetting the SmartMedia
extern macro proc RC200SmartMediaReset (ResultPtr);
Parameters:
ResultPtr: Pointer to register of type unsigned 1. Returns
0 for success, 1 for failure.
Timing: 110 clock cycles or more.
Description:
Resets the SmartMedia device. You can reset the device at
any time; the reset operation is the only one that can be run
ignoring the busy status returned by the SmartMedia device.