External Memory

Microchip Graphics Library

Microchip Graphics Library
External Memory

Bitmaps and Fonts can be located in external memory. To refer the data, EXTDATA structure is used:

typedef struct _EXTDATA_
{
   TYPE_MEMORY   type;         // must be set to EXTERNAL
   WORD          ID;           // memory ID
   DWORD         address;      // bitmap or font image address
} EXTDATA;

where:

  • type – shows type of memory used.
    • 0 – internal
    • 1 - external.
  • ID – unique number must be assigned by application to have a way distinguishing memory chips if the application has several of them.
  • address – start address of the bitmap or font image in the external memory.
To use the bitmap or font the pointer to EXTDATA structure must be passed into corresponding function (PutImage() or SetFont()). Each time the library will need data it will call special call back function ExternalMemoryCallback(). 

This function must be implemented in the application. Inside, the application must copy requested bytes quantity into the buffer provided. Data start address can be calculated as a sum of the start image address specified in EXTDATA structure and offset provided.

Functions
 
Name 
Description 
 
This function must be implemented in the application. The library will call this function each time when the external memory data will be required. The application must copy requested bytes quantity into the buffer provided. Data start address in external memory is a sum of the address in GFX_EXTDATA structure and offset. 
Macros
Name 
Description 
This defines the size of the buffer used by font functions to retrieve font data from the external memory. The buffer size can be increased to accommodate large font sizes. The user must be aware of the expected glyph sizes of the characters stored in the font table. To modify the size used, declare this macro in the GraphicsConfig.h file with the desired size. 
Topics
Name 
Description 
Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved