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.

am335x uart fifo使用问题请教



大家好,

应用中由于会经常用到串口通讯,在使用uart fifo 为减少MCU Loading设置触发level,

问题一:

请问低于level没有办法触发中断的那些数据如何收发呢?

如 Tx level =4 ; 传送15个字符的数据产生3次Tx fifo中断,剩余3个字符如何做发送处理呢?

问题二:

执行API UARTIntEnable(SOC_UART_0_REGS, ( UART_INT_THR | UART_INT_RHR_CTI));

后就自动跳入UARTIsr中了,此处感觉应该是先有对fifo写的动作到达tx level 后才会触发ISR,

不知为何?

static void UARTIsr(void)

{  

static unsigned int txStrLength = sizeof(txArray);    

static unsigned int count = 0;

intId = UARTIntIdentityGet(SOC_UART_0_REGS);

switch(intId)    

 {     case UART_INTID_TX_THRES_REACH:     

          if(0 != txStrLength)            

    {                

      UARTCharPut(SOC_UART_0_REGS, txArray[count]);

      txStrLength--;                

      count++;            

 }            

else            

{                

/* Disabling the THR interrupt. */                

UARTIntDisable(SOC_UART_0_REGS, UART_INT_THR);            

}

 }

谢谢!