Página 1 de 1

duvida sobre U0IIR no lpc2378

MensagemEnviado: 20 Nov 2009 12:53
por Doth
Bom alguem poderia me explicar a utilidade deste registrador U0IIR no exemplo a seguir?
Ele é copiado para a variavel k que não é utilizada para nada.

/* Atendimento da IRQ 6 (UART0) */
void uart_irq(void)
{
int k;
k = U0IIR;
/* Caractere recebido: Le e coloca no fim da fila RX */
if(U0LSR & 1) {
filarx[rx_fim] = U0RBR;
rx_fim = (rx_fim + 1) & TAMFILA;
}
/* Transmissor livre e caractere na fila TX: Pega da fila e transmite */
if((U0LSR & 0x20) && (tx_fim != tx_ini)) {
U0THR = filatx[tx_ini];
tx_ini = (tx_ini + 1) & TAMFILA;
}
#ifdef DEBUG
FIO4PIN0 = ~rx_fim; /* Mostra contagem nos LEDs [para debugging] */
#endif
VICVectAddr = 0; /* Limpa IRQ no VIC */
}

MensagemEnviado: 20 Nov 2009 13:00
por tcpipchip
INTERRUPT IDENTIFICATION REGISTER

Talvez seja a tua unica VIC INTERRUPT...

TCPIPCHIP

MensagemEnviado: 20 Nov 2009 13:30
por Doth
Li no userguide agora, valeu.

The UnIIR provides a status code that denotes the priority and source of a pending
interrupt. The interrupts are frozen during an UnIIR access. If an interrupt occurs during
an UnIIR access, the interrupt is recorded for the next UnIIR access.

Obrigado