Lines Matching refs:hotfdec

178 HAL_StatusTypeDef HAL_OTFDEC_Init(OTFDEC_HandleTypeDef *hotfdec)  in HAL_OTFDEC_Init()  argument
181 if (hotfdec == NULL) in HAL_OTFDEC_Init()
187 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_Init()
189 if (hotfdec->State == HAL_OTFDEC_STATE_RESET) in HAL_OTFDEC_Init()
192 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_Init()
196 hotfdec->ErrorCallback = HAL_OTFDEC_ErrorCallback; /* Legacy weak callback */ in HAL_OTFDEC_Init()
198 if (hotfdec->MspInitCallback == NULL) in HAL_OTFDEC_Init()
200 hotfdec->MspInitCallback = HAL_OTFDEC_MspInit; /* Legacy weak MspInit */ in HAL_OTFDEC_Init()
204 hotfdec->MspInitCallback(hotfdec); in HAL_OTFDEC_Init()
207 HAL_OTFDEC_MspInit(hotfdec); in HAL_OTFDEC_Init()
212 hotfdec->State = HAL_OTFDEC_STATE_READY; in HAL_OTFDEC_Init()
224 HAL_StatusTypeDef HAL_OTFDEC_DeInit(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_DeInit() argument
227 if (hotfdec == NULL) in HAL_OTFDEC_DeInit()
233 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_DeInit()
236 hotfdec->State = HAL_OTFDEC_STATE_BUSY; in HAL_OTFDEC_DeInit()
239 if (hotfdec->MspDeInitCallback == NULL) in HAL_OTFDEC_DeInit()
241 hotfdec->MspDeInitCallback = HAL_OTFDEC_MspDeInit; /* Legacy weak MspDeInit */ in HAL_OTFDEC_DeInit()
245 hotfdec->MspDeInitCallback(hotfdec); in HAL_OTFDEC_DeInit()
248 HAL_OTFDEC_MspDeInit(hotfdec); in HAL_OTFDEC_DeInit()
252 hotfdec->State = HAL_OTFDEC_STATE_RESET; in HAL_OTFDEC_DeInit()
255 hotfdec->ErrorCode = HAL_OTFDEC_ERROR_NONE; in HAL_OTFDEC_DeInit()
258 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_DeInit()
270 __weak void HAL_OTFDEC_MspInit(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_MspInit() argument
273 UNUSED(hotfdec); in HAL_OTFDEC_MspInit()
286 __weak void HAL_OTFDEC_MspDeInit(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_MspDeInit() argument
289 UNUSED(hotfdec); in HAL_OTFDEC_MspDeInit()
310 HAL_StatusTypeDef HAL_OTFDEC_RegisterCallback(OTFDEC_HandleTypeDef *hotfdec, HAL_OTFDEC_CallbackIDT… in HAL_OTFDEC_RegisterCallback() argument
318 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_RegisterCallback()
323 if (hotfdec->State == HAL_OTFDEC_STATE_READY) in HAL_OTFDEC_RegisterCallback()
328 hotfdec->ErrorCallback = pCallback; in HAL_OTFDEC_RegisterCallback()
332 hotfdec->MspInitCallback = pCallback; in HAL_OTFDEC_RegisterCallback()
336 hotfdec->MspDeInitCallback = pCallback; in HAL_OTFDEC_RegisterCallback()
341 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_RegisterCallback()
348 else if (HAL_OTFDEC_STATE_RESET == hotfdec->State) in HAL_OTFDEC_RegisterCallback()
353 hotfdec->MspInitCallback = pCallback; in HAL_OTFDEC_RegisterCallback()
357 hotfdec->MspDeInitCallback = pCallback; in HAL_OTFDEC_RegisterCallback()
362 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_RegisterCallback()
372 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_RegisterCallback()
393 HAL_StatusTypeDef HAL_OTFDEC_UnRegisterCallback(OTFDEC_HandleTypeDef *hotfdec, HAL_OTFDEC_CallbackI… in HAL_OTFDEC_UnRegisterCallback() argument
397 if (hotfdec->State == HAL_OTFDEC_STATE_READY) in HAL_OTFDEC_UnRegisterCallback()
402 hotfdec->ErrorCallback = HAL_OTFDEC_ErrorCallback; in HAL_OTFDEC_UnRegisterCallback()
406 hotfdec->MspInitCallback = HAL_OTFDEC_MspInit; /* Legacy weak MspInit */ in HAL_OTFDEC_UnRegisterCallback()
410 hotfdec->MspDeInitCallback = HAL_OTFDEC_MspDeInit; /* Legacy weak MspDeInit */ in HAL_OTFDEC_UnRegisterCallback()
415 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_UnRegisterCallback()
422 else if (HAL_OTFDEC_STATE_RESET == hotfdec->State) in HAL_OTFDEC_UnRegisterCallback()
427 hotfdec->MspInitCallback = HAL_OTFDEC_MspInit; /* Legacy weak MspInit */ in HAL_OTFDEC_UnRegisterCallback()
431 hotfdec->MspDeInitCallback = HAL_OTFDEC_MspDeInit; /* Legacy weak MspDeInit */ in HAL_OTFDEC_UnRegisterCallback()
436 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_UnRegisterCallback()
446 hotfdec->ErrorCode |= HAL_OTFDEC_ERROR_INVALID_CALLBACK; in HAL_OTFDEC_UnRegisterCallback()
480 void HAL_OTFDEC_IRQHandler(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_IRQHandler() argument
484 isr_reg = READ_REG(hotfdec->Instance->ISR); in HAL_OTFDEC_IRQHandler()
487 SET_BIT(hotfdec->Instance->ICR, OTFDEC_ICR_SEIF); in HAL_OTFDEC_IRQHandler()
488 hotfdec->ErrorCode |= HAL_OTFDEC_SECURITY_ERROR; in HAL_OTFDEC_IRQHandler()
492 SET_BIT(hotfdec->Instance->ICR, OTFDEC_ICR_XONEIF); in HAL_OTFDEC_IRQHandler()
493 hotfdec->ErrorCode |= HAL_OTFDEC_EXECUTE_ERROR; in HAL_OTFDEC_IRQHandler()
497 SET_BIT(hotfdec->Instance->ICR, OTFDEC_ICR_KEIF); in HAL_OTFDEC_IRQHandler()
498 hotfdec->ErrorCode |= HAL_OTFDEC_KEY_ERROR; in HAL_OTFDEC_IRQHandler()
502 hotfdec->ErrorCallback(hotfdec); in HAL_OTFDEC_IRQHandler()
504 HAL_OTFDEC_ErrorCallback(hotfdec); in HAL_OTFDEC_IRQHandler()
514 __weak void HAL_OTFDEC_ErrorCallback(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_ErrorCallback() argument
517 UNUSED(hotfdec); in HAL_OTFDEC_ErrorCallback()
553 HAL_StatusTypeDef HAL_OTFDEC_RegionKeyLock(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex) in HAL_OTFDEC_RegionKeyLock() argument
559 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionKeyLock()
563 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionKeyLock()
565 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionKeyLock()
571 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionKeyLock()
587 HAL_StatusTypeDef HAL_OTFDEC_RegionSetKey(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex, uint… in HAL_OTFDEC_RegionSetKey() argument
593 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionSetKey()
603 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionSetKey()
605 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionSetKey()
627 if (HAL_OTFDEC_KeyCRCComputation(pKey) != HAL_OTFDEC_RegionGetKeyCRC(hotfdec, RegionIndex)) in HAL_OTFDEC_RegionSetKey()
630 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionSetKey()
637 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionSetKey()
656 HAL_StatusTypeDef HAL_OTFDEC_RegionSetMode(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex, uin… in HAL_OTFDEC_RegionSetMode() argument
662 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionSetMode()
667 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionSetMode()
669 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionSetMode()
676 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionSetMode()
695 HAL_StatusTypeDef HAL_OTFDEC_RegionConfig(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex, in HAL_OTFDEC_RegionConfig() argument
702 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionConfig()
714 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionConfig()
716 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionConfig()
743 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionConfig()
760 HAL_StatusTypeDef HAL_OTFDEC_ConfigAttributes(OTFDEC_HandleTypeDef *hotfdec, uint32_t Attributes) in HAL_OTFDEC_ConfigAttributes() argument
763 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_ConfigAttributes()
767 __HAL_LOCK(hotfdec); in HAL_OTFDEC_ConfigAttributes()
769 MODIFY_REG(hotfdec->Instance->PRIVCFGR, OTFDEC_PRIVCFGR_PRIV, Attributes); in HAL_OTFDEC_ConfigAttributes()
772 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_ConfigAttributes()
831 HAL_StatusTypeDef HAL_OTFDEC_EnableEnciphering(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_EnableEnciphering() argument
834 __HAL_LOCK(hotfdec); in HAL_OTFDEC_EnableEnciphering()
836 SET_BIT(hotfdec->Instance->CR, OTFDEC_CR_ENC); in HAL_OTFDEC_EnableEnciphering()
839 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_EnableEnciphering()
851 HAL_StatusTypeDef HAL_OTFDEC_DisableEnciphering(OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_DisableEnciphering() argument
854 __HAL_LOCK(hotfdec); in HAL_OTFDEC_DisableEnciphering()
856 CLEAR_BIT(hotfdec->Instance->CR, OTFDEC_CR_ENC); in HAL_OTFDEC_DisableEnciphering()
859 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_DisableEnciphering()
881 HAL_StatusTypeDef HAL_OTFDEC_Cipher(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex, in HAL_OTFDEC_Cipher() argument
890 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_Cipher()
900 __HAL_LOCK(hotfdec); in HAL_OTFDEC_Cipher()
912 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_Cipher()
927 HAL_StatusTypeDef HAL_OTFDEC_RegionEnable(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex) in HAL_OTFDEC_RegionEnable() argument
933 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionEnable()
937 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionEnable()
939 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionEnable()
945 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionEnable()
954 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionEnable()
968 HAL_StatusTypeDef HAL_OTFDEC_RegionDisable(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex) in HAL_OTFDEC_RegionDisable() argument
974 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionDisable()
978 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionDisable()
980 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionDisable()
986 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionDisable()
995 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionDisable()
1025 HAL_OTFDEC_StateTypeDef HAL_OTFDEC_GetState(const OTFDEC_HandleTypeDef *hotfdec) in HAL_OTFDEC_GetState() argument
1027 return hotfdec->State; in HAL_OTFDEC_GetState()
1040 HAL_StatusTypeDef HAL_OTFDEC_GetConfigAttributes(OTFDEC_HandleTypeDef *hotfdec, uint32_t *Attribute… in HAL_OTFDEC_GetConfigAttributes() argument
1043 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_GetConfigAttributes()
1046 __HAL_LOCK(hotfdec); in HAL_OTFDEC_GetConfigAttributes()
1048 *Attributes = READ_BIT(hotfdec->Instance->PRIVCFGR, OTFDEC_PRIVCFGR_PRIV); in HAL_OTFDEC_GetConfigAttributes()
1051 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_GetConfigAttributes()
1064 uint32_t HAL_OTFDEC_RegionGetKeyCRC(const OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex) in HAL_OTFDEC_RegionGetKeyCRC() argument
1071 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionGetKeyCRC()
1074 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionGetKeyCRC()
1092 HAL_StatusTypeDef HAL_OTFDEC_RegionGetConfig(OTFDEC_HandleTypeDef *hotfdec, uint32_t RegionIndex, in HAL_OTFDEC_RegionGetConfig() argument
1099 assert_param(IS_OTFDEC_ALL_INSTANCE(hotfdec->Instance)); in HAL_OTFDEC_RegionGetConfig()
1109 __HAL_LOCK(hotfdec); in HAL_OTFDEC_RegionGetConfig()
1111 address = (uint32_t)(hotfdec->Instance) + 0x20U + (0x30U * RegionIndex); in HAL_OTFDEC_RegionGetConfig()
1127 __HAL_UNLOCK(hotfdec); in HAL_OTFDEC_RegionGetConfig()