A Flash object manages nonvolatile flash memory on the XMP
motion controller. Because all of flash memory must be written as
one contiguous piece (which takes a lot of time), and a host-resident
flash memory cache is used to provide faster writing performance,
and to also reduce the number of write cycles performed.
After your application creates a Flash object (using meiFlashCreate(...)),
the Flash object then creates a host-resident flash memory cache,
initializing it using a copy of actual flash memory [by calling
meiFlashMemoryToFile(fileName=Null)]. Using the data structures
defined in xmp.h and pointers to those structures (returned by the
mpiControlMemory(...) method), your application can then
use the meiFlashData[Get/Set](...) methods to access this
memory cache. Note that the meiFlashDataSet(...) method updates
the flash cache, and doesn't update the actual flash memory. To
write the flash memory cache to actual flash memory, your application
must call meiFlashMemoryFromFile(fileName=Null).
Use the FlashDataGet/Set(...) methods to move data between
your application and the flash cache. Use the FlashMemoryTo/FromFile(...)
methods to move data between the flash cache (or file) and the
actual flash memory. Typically, your application would:
- Create a Flash object [using meiFlashCreate(...)].
- Pass the MEIFlash handle to the FlashConfig[Get/Set](...)
methods of the objects to be configured (which in turn call the
- Write the flash cache to actual flash memory [using meiFlashMemoryFromFile(...)].
- Delete the Flash object.