Hola Colegas, necesito un poco de su ayuda. Estoy tratando de hacer la librería para este LCD, pero resulta que me ha costado comprender de que manera puedo crear la función de dibujar pixeles (drawpixel); ya es algo tarde y por eso ya la cabeza no me da
.
void GLCDInit(void)
{
delay_ms(40);
output_low(GLCD_RST); //reset LCD
delay_us(1);
output_high(GLCD_RST); //LCD normal operation
//Lcd_SendByte(Cmd,0b00100000);// 4-bit mode.
Lcd_SendByte(Cmd,LCD_CMODE );//8bit mode 0x30
delay_us (100);
//Lcd_SendByte(Cmd,0b00100000);// 4-bit mode again.
Lcd_SendByte(Cmd,LCD_CMODE);// 8-bit mode again. 0x30
delay_us (37);
Lcd_SendByte(Cmd,LCD_ON );// Cursor and blinking cursor disabled. 0x0C
delay_us (100);
Lcd_SendByte(Cmd,LCD_CLS);// Clears screen. 0x01
delay_ms(10);
Lcd_SendByte(Cmd,LCD_ENTRY);// Cursor moves right, no display shift. 0x06
delay_us (72);
Lcd_SendByte(Cmd,LCD_HOME);// Returns to home. Cursor moves to starting point. 0x02
}
void glcd_checkstate(){
int1 busy=1;
output_low(GLCD_RS); // LOW RS and High RW will put the lcd to
output_high(GLCD_RW); // read busy flag and address counter
while(busy){ // will cycle until busy flag is 0
output_high(GLCD_E);
if(!input(PIN_B7)){
busy=0;
}
output_low(GLCD_E);
}
}
void Lcd_SendByte(int1 DatCmd,unsigned char dByte) // Write Data or Command to LCD
{
glcd_checkstate();
if(DatCmd==1){
output_high(GLCD_RS); //data
}
else{
output_low(GLCD_RS); //command
}
output_low(GLCD_RW);
output_b(dByte);
output_high(GLCD_E); // enable
delay_us(1);
output_low(GLCD_E); // disable
}
void GLCDWriteText(unsigned char col, unsigned char row, char* string)
{
switch (row) {
case 0:
col |= 0x80;
break;
case 1:
col |= 0x90;
break;
case 2:
col |= 0x88;
break;
case 3:
col |= 0x98;
break;
default:
col |= 0x80;
break;
}
Lcd_SendByte(Cmd,col);
while (*string)
Lcd_SendByte(Data,*string++);
}
void GLCDEnableGraphics()
{
Lcd_SendByte(Cmd,0x34);// Switch to extended instruction mode.
delay_us(72);
Lcd_SendByte(Cmd,0x36); // Enable graphics mode.
delay_us(72);
}
void st7920_drawPixel(int8 x, int8 y)
{
}
Me he guiado con estos dos links
http://www.ccsinfo.com/forum/viewtopic.php?p=173306http://www.ccsinfo.com/forum/viewtopic.php?p=91958Decidí hacer mi versión debido a que he probado estas librerías, y no funciona la parte de dibujar pixel, ademas de que ocupa demasiada RAM. Bueno en fin espero podamos resolver este problemilla