06.11.2014 Views

RAiO RA8806 - Display Future

RAiO RA8806 - Display Future

RAiO RA8806 - Display Future

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Version 1.3<br />

<strong>RA8806</strong><br />

Two Layers Character/Graphic LCD Controller<br />

(2) Program Example:<br />

Unsigned char X1,X2,Y1,Y2;<br />

Touch_Panel_Enable ( ); // Set TPCR1 Bit 7 to 1<br />

TP_Auto_Enable ( ); // Set TPCR2 Bit 7 to 0<br />

TP_INT_Mask_Enable ( ); // Set INTR Bit-4 to 1<br />

:<br />

:<br />

Execute other function<br />

// Jump to ISR when interrupt<br />

:<br />

:<br />

Int EXT_INT_Service_Routine<br />

{<br />

LCD_CmdWrite ( INTR );<br />

INT_Sta = LCD_DataRead ( );<br />

// ISR entry<br />

// Check INT status<br />

If ( INT_Sta & 0x01 )<br />

// Check If TP interrupt<br />

{<br />

LCD_CmdWrite(TPXR);<br />

X1 = LCD_DataRead( ); // MSB of X<br />

LCD_CmdWrite(TPYR);<br />

Y1 = LCD_DataRead( ); // MSB of Y<br />

LCD_CmdWrite(TPZR);<br />

X2 = LCD_DataRead( ) & 0x03; // LSB two Bits of X<br />

LCD_CmdWrite(TPZR);<br />

Y2 = LCD_DataRead( ) & 0x0C; // Least two Bits of Y<br />

:<br />

:<br />

Execute corresponding function<br />

:<br />

:<br />

LCD_CmdWrite ( INTR ); // Clear Touch Panel status<br />

temp = LCD_DataRead ( ) & 0xfe;<br />

LCD_CmdWrite ( INTR );<br />

LCD_DataWrite ( temp );<br />

}<br />

Else if (INT_Sta & 0x02)<br />

// Check if Key-Scan interrupt<br />

{<br />

:<br />

:<br />

}<br />

Else if (INT_Sta & 0x04)<br />

// Check if Wakeup interrupt<br />

{<br />

:<br />

:<br />

}<br />

}<br />

<strong>RAiO</strong> TECHNOLOGY INC. 44/193 www.raio.com.tw

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!