MAPS 的KSDK里面的确没有,
现在在KSDK1.3.0里面的K64代码中,是有uart的中断的,我建议你参考那个代码。
KSDK1.3.0里面的fsl_uart_driver.c中
static uart_status_t UART_DRV_StartReceiveData(uint32_t instance,
uint8_t * rxBuff,
uint32_t rxSize)
{
assert(instance < UART_INSTANCE_COUNT);
uart_state_t * uartState = (uart_state_t *)g_uartStatePtr[instance];
UART_Type * base = g_uartBase[instance];
/* Check that we're not busy receiving data from a previous function call. */
if ((uartState->isRxBusy) && (!uartState->rxCallback))
{
return kStatus_UART_RxBusy;
}
if (rxSize == 0U)
{
return kStatus_UART_NoDataToDeal;
}
/* Initialize the module driver state struct to indicate transfer in progress
* and with the buffer and byte count data */
uartState->rxBuff = rxBuff;
uartState->rxSize = rxSize;
uartState->isRxBusy = true;
/* Enable the receive data overrun interrupt */
UART_HAL_SetIntMode(base, kUartIntRxOverrun, true);
/* Enable the receive data full interrupt */
UART_BWR_C2_RIE(base, 1U);
return kStatus_UART_Success;
}
|