User manual
mikroC PRO for dsPIC
MikroElektronika
387
Library Example
The following drawing demo tests advanced routines of the Glcd library.
Copy Code To Clipboard
//Declarations------------------------------------------------------------------
const code char truck_bmp[1024];
//--------------------------------------------------------------end-declarations
// Glcd module connections
sbit GLCD_D7 at RD3_bit;
sbit GLCD_D6 at RD2_bit;
sbit GLCD_D5 at RD1_bit;
sbit GLCD_D4 at RD0_bit;
sbit GLCD_D3 at RB3_bit;
sbit GLCD_D2 at RB2_bit;
sbit GLCD_D1 at RB1_bit;
sbit GLCD_D0 at RB0_bit;
sbit GLCD_D7_Direction at TRISD3_bit;
sbit GLCD_D6_Direction at TRISD2_bit;
sbit GLCD_D5_Direction at TRISD1_bit;
sbit GLCD_D4_Direction at TRISD0_bit;
sbit GLCD_D3_Direction at TRISB3_bit;
sbit GLCD_D2_Direction at TRISB2_bit;
sbit GLCD_D1_Direction at TRISB1_bit;
sbit GLCD_D0_Direction at TRISB0_bit;
sbit GLCD_CS1 at LATB4_bit;
sbit GLCD_CS2 at LATB5_bit;
sbit GLCD_RS at LATF0_bit;
sbit GLCD_RW at LATF1_bit;
sbit GLCD_EN at LATF4_bit;
sbit GLCD_RST at LATF5_bit;
sbit GLCD_CS1_Direction at TRISB4_bit;
sbit GLCD_CS2_Direction at TRISB5_bit;
sbit GLCD_RS_Direction at TRISF0_bit;
sbit GLCD_RW_Direction at TRISF1_bit;
sbit GLCD_EN_Direction at TRISF4_bit;
sbit GLCD_RST_Direction at TRISF5_bit;
// End Glcd module connections
void delay2S(){ // 2 seconds delay function
Delay_ms(2000);
}
void main() {
unsigned short ii;
char *someText;
#dene COMPLETE_EXAMPLE // Comment this line to make simpler/smaller example
ADPCFG = 0xFFFF; // Congure AN pins as digital