File and Flash IO Abstraction

The  xAF library contains base classes that can be used to implement file/flash I/O on any platform. These classes are:

  • IOBase – This is the base class. Any other I/O class inherits from this class.
  • FlashInterface – This class inherits the IOBase It is the base class that other classes will inherit from to implement flash access from a given platform.
  • FileInterface – This class inherits the IOBase It is the base class that other classes will inherit from to implement file access from a given platform.

You can find the header files for these classes in the xAF repo at public/include/ folder. Examples are provided for IVP and Summit.

IVP

On IVP, the Win32 I/O files are in:

  • FlashInterfaceWin32
  • FileInterfaceWin32

You can find the source files in the xAF repo at: private/utils/xAFVirtualAmp/interface.

Summit

On Summit, you can find a reference implementation of these files on the Summit repo, on the xaf_examples branch, under customer/reference/xaf_reference_app/interface:

  • FileInterfaceSummit
  • FlashInterfaceSummit Note: This would be implemented to open a file right now instead of accessing

flash memory.

For example, this is how to use the FlashInterfaceSummit to read data:

FlashInterfaceSummit* flashTest = (FlashInterfaceSummit*)summitFlashInterface.getInstanceOf();                          flashTest->open(0, IOBase::access_read);

_________________

Rate this post!