User manual

DSM tutorials
The structure that contains variables shared between the server and API functions also contains
expressions for the interfaces to the device. The advantage of this is that the same API functions and
server code can be used to control multiple 28F640J3A flash memory devices at the same time. A
different copy of the structure is created for each device and then the server is run multiple times in
parallel with the application, once for each device. The structure has the following definition:
struct _Flash
{
interface bus_ts (unsigned DataIn) *DataBus
(unsigned DataOut, unsigned OE);
interface bus_clock_in (unsigned Input) *StatusBus ();
unsigned 1 CEn;
unsigned 1 WEn;
unsigned 1 OEn;
unsigned 1 DataOE;
unsigned 22 Addr;
unsigned 16 Data;
unsigned 1 ByteEnable;
unsigned 22 APIAddress;
unsigned 16 APIData;
unsigned 6 APIBlockNumber;
chan unsigned 3 APICommand;
};
typedef struct _Flash Flash;
The declaration and the definition of the structure type are placed in separate files to indicate that the
structure should be treated as opaque. Putting expressions for the interfaces inside the
Flash structure
separates the interface definitions that connect to the flash device from the implementation of the device
driver. The interfaces will now be defined in the context of an application or PSL that uses the device
driver to control a specific 28F640J3A flash memory device.
The members of the
Flash structure are:
www.celoxica.com
Page 40