[an error occurred while processing this directive]
|
int I2C_write(Uint16 *data,int length,int master,Uint16 slaveaddress,int transfermode,int timeout) {
int i,j,k,l,m;
int old_intm;
Uint16 temp=1;
old_intm = IRQ_globalDisable();
/* set in transmit mode */
I2C_FSET(I2CMDR,TRX,1);...
for (i=0;i<32000;i++) { /* delay loop */
asm (" NOP");
}
...
IRQ_globalRestore(old_intm);return 0;
} /* end of I2C_send */Оказывается, чтобы передать что-то по I2C надо запретить прерывания и использовать пустые циклы для таймингов... Красивое решение, блокировать процесор передавая данные по тормозному I2C
Составить ответ ||| Конференция ||| Архив
Ответы
E-mail: info@telesys.ru