![46a0bad7f95915147ae3c839b3f1e874](C:\Users\Lenovo\Desktop\My FreeRtos\Hal-Stm32F1-Intelligent-door-lock-system\46a0bad7f95915147ae3c839b3f1e874.jpg)
HAL_UART_Receive_IT(&AS608_UART, AS608_USART_RX_BUF, sizeof(AS608_USART_RX_BUF));
__HAL_UART_ENABLE_IT(&AS608_UART, UART_IT_IDLE); //Only enable it can enter the interrupt
//Reason(No update the pointer)
void HAL_UART2_IdleCpltCallback(UART_HandleTypeDef *huart)
{
if (__HAL_UART_GET_FLAG(&AS608_UART, UART_FLAG_IDLE) != RESET)
{
__HAL_UART_CLEAR_IDLEFLAG(&AS608_UART);
AS608_UART.pRxBuffPtr = AS608_USART_RX_BUF;//importance
AS608_UART.RxXferCount = sizeof(AS608_USART_RX_BUF);//importance
USART2_RX_STA = 1;
HAL_UART_Receive_IT(&AS608_UART, AS608_USART_RX_BUF, sizeof(AS608_USART_RX_BUF));
}
}
//idle interrupt will collect all data when its uart doesn't work and this condition also occur in no model insert the uart,detect the voltage always low and enter irqH continously.
-
forget its work voltage is 4.2~6V
-
its clock period limited at 20ms
use stm32cubemx spi created by default configuration,exceed the frequency that rc522 can accept