This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于UART FIFO 中断的问题



首先用的是am335x芯片, 跑的linux系统, 需要在内核中做一个模块。 当用UART1发送字节数低于TXFIFOLVL字节数时 会重复的引起中断, 所以在发送数据后第一次进入中断时。 我想把中断从低于FIFO LVL触发修改成发送完成以后触发.

在查看了AM335X DATA SHEET之后, 发现 UART_SCR寄存器的bit3位

[3]   TXEMPTYCTLIT           0 Normal mode for THR interrupt.
                                           1 THR interrupt is generated when TX FIFO and TX shift register are empty.

于是我在UART中断中加了以下几行代码

static irqreturn_t uart1_handle_irq(int irq, void *dev_id)

{

            switch (type) {
                  case UART_IIR_THRI:

                       serial_out(up, UART_LCR, 0x00);    

                       serial_out(up, UART_SCR, 0x08);
                   break;
            }

            .........

}

但是感觉没有写进去一样还是会一直触发中断。