[an error occurred while processing this directive]
|
// Установить текстовую страницу (стартовый адрес 0х0000)
SetTextPage(0x0000);
WriteDataLCD(40);
WriteDataLCD(0x00);
WriteCommandLCD(0x41);
// Установить графическую страницу (стартовый адрес 0х1000)
SetVisualPage(0x1000);
WriteDataLCD(40);
WriteDataLCD(0x00);
WriteCommandLCD(0x43);
// Установить режим
LCDMode(1, 1, 1, 1);
// Реализации функций
void CheckStatusLCD(void) reentrant
{
while(!(LCD_Command & 0x01));
}
void WriteCommandLCD(unsigned char byte)
{
CheckStatusLCD();
LCD_Command = byte;
}
void WriteDataLCD(unsigned char byte)
{
CheckStatusLCD();
LCD_Data = byte;
}
void LCDMode(unsigned char graphic, unsigned char text, unsigned char cursorDisplay, unsigned char cursorBlink)
{
unsigned char mode;
mode = 0x90;
if(graphic) mode |= 0x08;
if(text) mode |= 0x04;
if(cursorDisplay) mode |= 0x02;
if(cursorBlink) mode |= 0x01;
WriteCommandLCD(mode);
}
void SetVisualPage(unsigned int pageAddress)
{
WriteDataLCD(pageAddress);
WriteDataLCD(_iror_(pageAddress, 8));
WriteCommandLCD(0x42);
}
void SetTextPage(unsigned int pageAddress)
{
WriteDataLCD(pageAddress);
WriteDataLCD(_iror_(pageAddress, 8));
WriteCommandLCD(0x40);
}
E-mail: info@telesys.ru