for (unsigned short int i =0;i<=7;i++)
{
WR_LOW;
if ((command & 0x80) !=0) DATA_HIGH; else DATA_LOW;
_delay_us(200);
WR_HIGH;
_delay_us(5);
command = command << 1;
}
WR_LOW;
_delay_us(200);
WR_HIGH;
_delay_us(5);
CS_HIGH;
}
//这个函数可以将显示缓冲区刷新到HT1621B;用户可能需要在语句间增加必要的延时
void flood_lcd_data(void)
{
unsigned int temp_data;
CS_LOW;
_delay_us(5);
WR_LOW; //PRESENT 101 DATA CODE
DATA_HIGH;
_delay_us(200);
WR_HIGH;
_delay_us(5);
for (unsigned short int i =0;i<=5;i++)
{
WR_LOW;
DATA_LOW;
_delay_us(200);
WR_HIGH;
_delay_us(5);
}
for (unsigned short int i =0;i<=7;i++)
{
temp_data = lcd_buffer;
for (unsigned short int j=0;j<=15;j++)
{
WR_LOW;
if ((temp_data & 0x01) !=0) DATA_HIGH; else DATA_LOW;
_delay_us(200);
WR_HIGH;
_delay_us(5);
temp_data = temp_data >> 1;
}
}