User manual
DSM tutorials
macro proc FlashRun (FlashPtr, ClockRate)
{
// Initialization sequence
unsigned 3 Command;
do
{
FlashPtr->APICommand ? Command;
switch (Command)
{
case FlashAPICmdRead:
// Read sequence goes here
FlashPtr->APICommand ! 0;
break;
case FlashAPICmdWrite:
// Write sequence goes here
break;
case FlashAPICmdErase:
// Erase sequence goes here
break;
default:
delay;
break;
}
}
while (1);
}
The full implementation of the server can be found in the accompanying source code.
The API functions have the following implementation:
macro proc FlashReadWord (FlashPtr, Address, DataPtr)
{
static unsigned 3 Dummy;
par
{
FlashPtr->APICommand ! FlashAPICommandReadWord;
FlashPtr->APIAddress = Address;
}
FlashPtr->APICommand ? Dummy;
*DataPtr = FlashPtr->APIData;
}
www.celoxica.com
Page 42