Ответ: Вот пример на С для АВР.
void touch_init(void)
{
cbi(cs_touch_port,cs_touch);
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
spi_trans(0x98);
sbi(cs_touch_port,cs_touch);
}
unsigned char touch_read(void)
{ if(touch_int_port&0x40)
return(0);
else
{
unsigned char a=0,b=0;
cbi(cs_touch_port,cs_touch);
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
spi_trans(0x98);
a=spi_trans(0x00);
b=spi_trans(0xd8);
touch_x=(a<<1)|((b&0x80)>>7);
a=spi_trans(0x00);
b=spi_trans(0x00);
touch_y=(a<<1)|((b&0x80)>>7);
sbi(cs_touch_port,cs_touch);
return(1);
}
}