3.2.5 Systems with Indirect Access to the Data File

These systems access programming data indirectly via a paging mechanism. Paging is a method of copying a certain range of data from the memory containing the data file and pasting it into a limited size memory buffer that DirectC can access.

To implement paging:

  1. Enable the USE_PAGING compiler option.
  2. Define Page_buffer_size. The minimum buffer size is 16 bytes.
  3. Modify the dp_get_page_data function.

This function copies the requested data from the external memory device into the page buffer. See Data File Bit Orientation for additional information. For correct operation:

  1. Fill the entire page buffer unless the end of the image is reached. See Data File Format.
  2. Update return_bytes to reflect the number of valid bytes in the page.
Every time access to a data block within the image data file is needed, SPI-DirectC programming functions call the dp_get_data function. The dp_get_data function calculates the relative address location of the requested data and checks, if it already exists in the current page data. The paging mechanism is triggered, if the requested data is not within the page buffer.