http://wjf88223.blog.163.com/blog/static/3516800120104179327286/
协议栈中UART有两种模式:
1、中断
2、DMA
对于这两种模式具体运用在哪一步,纠结了很久.通过UART配置结构:
typedef struct
{
uint8 *rxBuf;
uint8 rxHead;
uint8 rxTail;
uint8 rxMax;
uint8 rxCnt;
uint8 rxTick;
uint8 rxHigh;
uint8 *txBuf;
#if HAL_UART_BIG_TX_BUF
uint16 txHead;
uint16 txTail;
uint16 txMax;
uint16 txCnt;
#else
uint8 txHead;
uint8 txTail;
uint8 txMax;
uint8 txCnt;
#endif
uint8 txTick;
uint8 flag;
halUARTCBack_t rxCB;
} uartCfg_t;
可以看到协议栈为串口收发分别配置了一块内存空间rxBuf和txBuf,具体在HalUARTOpen()里配置.
而中断与DMA这两种模式具体就运用于 数据在串口缓存U0_1DBUF与rxBuf/txBuf之间传送 的过程.
串口接收DMA模式:(da
串口接收中断模式:(da
串口发送DMA模式:(da
串口发送中断模式:(da