Datasheet

SPI_Glcd_Image
Library Example
The example demonstrates how to communicate to KS0108 Glcd via the SPI module, using seri-
al to parallel convertor MCP23S17.
const code char truck_bmp[1024];
// Port Expander module connections
sbit SPExpanderRST at PORTB.B0;
sbit SPExpanderCS at PORTB.B1;
sbit SPExpanderRST_Direction at DDRB.B0;
sbit SPExpanderCS_Direction at DDRB.B1;
// End Port Expander module connections
void Delay2s(){ // 2 seconds delay function
Delay_ms(2000);
}
void main() {
char *someText;
char counter;
465
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void SPI_Glcd_Image(const code char *image);
Returns Nothing.
Description
Displays bitmap on Glcd.
Parameters :
-
image: image to be displayed. Bitmap array can be located in both code and
RAM memory (due to the mikroC PRO for AVR pointer to const and pointer to
RAM equivalency).
Use the mikroC PRO’s integrated Glcd Bitmap Editor (menu option Tools › Glcd
Bitmap Editor) to convert image to a constant array suitable for displaying on Glcd.
Requires Glcd needs to be initialized for SPI communication, see SPI_Glcd_Init routines.
Example
// Draw image my_image on Glcd
SPI_Glcd_Image(my_image);