STM32L4xx_HAL_Driver  1.14.0

AES IRQ handler. More...

Functions

void HAL_CRYP_IRQHandler (CRYP_HandleTypeDef *hcryp)
 Handle AES interrupt request. More...
 

Detailed Description

AES IRQ handler.

  ==============================================================================
                ##### AES IRQ handler management #####
  ==============================================================================
[..]  This section provides AES IRQ handler function.

Function Documentation

◆ HAL_CRYP_IRQHandler()

void HAL_CRYP_IRQHandler ( CRYP_HandleTypeDef hcryp)

Handle AES interrupt request.

Parameters
hcryppointer to a CRYP_HandleTypeDef structure that contains the configuration information for CRYP module
Return values
None

Definition at line 1377 of file stm32l4xx_hal_cryp.c.

1378 {
1379  /* Check if error occurred */
1380  if (__HAL_CRYP_GET_IT_SOURCE(hcryp, CRYP_IT_ERRIE) != RESET)
1381  {
1382  /* If Write Error occurred */
1383  if (__HAL_CRYP_GET_FLAG(hcryp, CRYP_IT_WRERR) != RESET)
1384  {
1385  hcryp->ErrorCode |= HAL_CRYP_WRITE_ERROR;
1386  hcryp->State = HAL_CRYP_STATE_ERROR;
1387  }
1388  /* If Read Error occurred */
1389  if (__HAL_CRYP_GET_FLAG(hcryp, CRYP_IT_RDERR) != RESET)
1390  {
1391  hcryp->ErrorCode |= HAL_CRYP_READ_ERROR;
1392  hcryp->State = HAL_CRYP_STATE_ERROR;
1393  }
1394 
1395  /* If an error has been reported */
1396  if (hcryp->State == HAL_CRYP_STATE_ERROR)
1397  {
1398  /* Disable Error and Computation Complete Interrupts */
1399  __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_CCFIE|CRYP_IT_ERRIE);
1400  /* Clear all Interrupt flags */
1401  __HAL_CRYP_CLEAR_FLAG(hcryp, CRYP_ERR_CLEAR|CRYP_CCF_CLEAR);
1402 
1403  /* Process Unlocked */
1404  __HAL_UNLOCK(hcryp);
1405 
1406 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1)
1407  hcryp->ErrorCallback(hcryp);
1408 #else
1409  HAL_CRYP_ErrorCallback(hcryp);
1410 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */
1411 
1412  return;
1413  }
1414 
1415  }
1416 
1417  /* Check if computation complete interrupt is enabled
1418  and if the computation complete flag is raised */
1419  if (__HAL_CRYP_GET_FLAG(hcryp, CRYP_IT_CCF) != RESET)
1420  {
1421  if (__HAL_CRYP_GET_IT_SOURCE(hcryp, CRYP_IT_CCFIE) != RESET)
1422  {
1423 #if defined(AES_CR_NPBLB)
1424  if ((hcryp->Init.ChainingMode == CRYP_CHAINMODE_AES_GCM_GMAC)
1425  || (hcryp->Init.ChainingMode == CRYP_CHAINMODE_AES_CCM))
1426 #else
1427  if ((hcryp->Init.ChainingMode == CRYP_CHAINMODE_AES_GCM_GMAC)
1428  || (hcryp->Init.ChainingMode == CRYP_CHAINMODE_AES_CMAC))
1429 #endif
1430  {
1431  /* To ensure proper suspension requests management, CCF flag
1432  is reset in CRYP_AES_Auth_IT() according to the current
1433  phase under handling */
1434  if (CRYP_AES_Auth_IT(hcryp) != HAL_OK)
1435  {
1436 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1)
1437  hcryp->ErrorCallback(hcryp);
1438 #else
1439  HAL_CRYP_ErrorCallback(hcryp);
1440 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */
1441  }
1442  }
1443  else
1444  {
1445  /* Clear Computation Complete Flag */
1446  __HAL_CRYP_CLEAR_FLAG(hcryp, CRYP_CCF_CLEAR);
1447  if (CRYP_AES_IT(hcryp) != HAL_OK)
1448  {
1449 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1)
1450  hcryp->ErrorCallback(hcryp);
1451 #else
1452  HAL_CRYP_ErrorCallback(hcryp);
1453 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */
1454  }
1455  }
1456  }
1457  }
1458 }
void(* ErrorCallback)(struct __CRYP_HandleTypeDef *hcryp)
__IO HAL_CRYP_STATETypeDef State
__HAL_UNLOCK(hrtc)
static HAL_StatusTypeDef CRYP_AES_IT(CRYP_HandleTypeDef *hcryp)
Handle CRYP block input/output data handling under interruption.
HAL_StatusTypeDef CRYP_AES_Auth_IT(CRYP_HandleTypeDef *hcryp)
Handle CRYP block input/output data handling under interruption for GCM, GMAC, CCM or CMAC chaining m...
return HAL_OK
void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp)
CRYP error callback.