/*****************************************************************************
Name:        	Busy
Parameters:  	controller 1 or 2 (not both)			
Returns:        1 if busy or reset in proc.
Description:    This function returns the busy or reset status
*****************************************************************************/
char Busy(char controller)
{
	char temp = 0;
	
	if (controller == BOTH)  return -1;
	
	temp = LCD_read(CTRL, controller);
	if (temp & 0x80)		// was 0x90
		return TRUE;
	else
		return FALSE;
}
Ejemplo n.º 2
0
void
__LCD_write(uint8_t RS,uint8_t data,uint8_t wait){
    LCD_DATA_PORT->DIR |= 0xF0;
    LCD_RS(RS);
    LCD_RW(0);    
    LCD_DATA_PORT->DATA = (LCD_CONTROL_PORT->DATA & ~(0xF0))|(data&0xF0);
    LCD_EN(1);
    LCD_EN(0);
    data <<=4;   
    LCD_DATA_PORT->DATA = (LCD_CONTROL_PORT->DATA & ~(0xF0))|(data&0xF0);
    LCD_EN(1);
    LCD_EN(0);
    if(wait){
        while(LCD_read(0) & 0x80);
    }
}