mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 06:11:06 +00:00 
			
		
		
		
	feat(ecc): use RCC atomic block to enable/reset the ECC peripheral
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
/*
 | 
			
		||||
 * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
 | 
			
		||||
 * SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
 */
 | 
			
		||||
@@ -10,6 +10,7 @@
 | 
			
		||||
#include "hal/assert.h"
 | 
			
		||||
#include "hal/ecc_types.h"
 | 
			
		||||
#include "soc/ecc_mult_reg.h"
 | 
			
		||||
#include "soc/pcr_struct.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
@@ -21,6 +22,25 @@ typedef enum {
 | 
			
		||||
    ECC_PARAM_K,
 | 
			
		||||
} ecc_ll_param_t;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Enable the bus clock for ECC peripheral module
 | 
			
		||||
 *
 | 
			
		||||
 * @param true to enable the module, false to disable the module
 | 
			
		||||
 */
 | 
			
		||||
static inline void ecc_ll_enable_bus_clock(bool enable)
 | 
			
		||||
{
 | 
			
		||||
    PCR.ecc_conf.ecc_clk_en = enable;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Reset the ECC peripheral module
 | 
			
		||||
 */
 | 
			
		||||
static inline void ecc_ll_reset_register(void)
 | 
			
		||||
{
 | 
			
		||||
    PCR.ecc_conf.ecc_rst_en = 1;
 | 
			
		||||
    PCR.ecc_conf.ecc_rst_en = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void ecc_ll_enable_interrupt(void)
 | 
			
		||||
{
 | 
			
		||||
    REG_SET_FIELD(ECC_MULT_INT_ENA_REG, ECC_MULT_CALC_DONE_INT_ENA, 1);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user