/* * Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates * * SPDX-License-Identifier: BSD-3-Clause */ /********************************************************************************************************************** * File Name : bsp_irqs.c * Version : 1.00 * Description : bsp_irq (secure) source code *********************************************************************************************************************/ /*********************************************************************************************************************** * Includes , "Project Includes" **********************************************************************************************************************/ #include "bsp_api.h" #include "bsp_irq.h" #include "bsp_irqs.h" /*********************************************************************************************************************** * Macro definitions **********************************************************************************************************************/ #define BSP_PRV_BITS_PER_WORD (32) /*********************************************************************************************************************** * Typedef definitions **********************************************************************************************************************/ /*********************************************************************************************************************** * Exported global variables (to be accessed by other files) **********************************************************************************************************************/ /*********************************************************************************************************************** * Private global variables and functions **********************************************************************************************************************/ /*******************************************************************************************************************//** * @addtogroup BSP_MCU * * @{ **********************************************************************************************************************/ /** @} (end addtogroup BSP_MCU) */ /*******************************************************************************************************************//** * This function provides clock to DMA Controller (see section 'Precaution when use the peripheral modules * which can initiate DMA Controller.' in the user's manual for detail) and enables IM33. * It also enables any interrupt in a non-secure state. **********************************************************************************************************************/ void bsp_irq_cfg_s (void) { R_BSP_MODULE_CLKON(FSP_IP_DMAC, 0); R_BSP_MODULE_RSTOFF(FSP_IP_DMAC, 0); R_BSP_MODULE_CLKON(FSP_IP_DMAC, 1); R_BSP_MODULE_RSTOFF(FSP_IP_DMAC, 1); R_BSP_IM33_ENABLE(); #if BSP_NONSECURE_TRANSITION #if FSP_PRIV_TZ_USE_SECURE_REGS /* Place all vectors in non-secure state. */ for (uint32_t i = 0U; i < (BSP_ICU_VECTOR_MAX_ENTRIES / BSP_PRV_BITS_PER_WORD); i++) { NVIC->ITNS[i] = UINT32_MAX; } #endif #endif }