
// -----------------------------------------------------------------------
// LcdBusy.c
// -----------------------------------------------------------------------
#include "Lcd.h"

// -----------------------------------------------------------------------
// Check if the LCD is busy doing stuff
// -----------------------------------------------------------------------
extern	bool_t			LcdBusy			( void ) {
	uint8_t	busdata;
	if	( LcdExist() ) {
		ApplicationIrqDisable();
		ApplicationLcdBusRead();
		ApplicationLcdSetRW( 1 );
		ApplicationLcdSetRS( 0 );
		ApplicationLcdSetE( 1 );
		busdata = ApplicationLcdGetBus();
		ApplicationLcdSetE( 0 );
		ApplicationLcdBusRelease();
		ApplicationIrqEnable();
	}
	else {
		busdata = 0;
	}
	return	busdata & 0x80 ? 1 : 0;
}

// -----------------------------------------------------------------------
// EOF: LcdBusy.c
// -----------------------------------------------------------------------

