feat(ecdsa): use RCC atomic block to enable/reset the ECDSA peripheral

This commit is contained in:
harshal.patil
2023-09-18 13:57:47 +05:30
parent 43864f7fb4
commit 57d10477da
5 changed files with 70 additions and 11 deletions

View File

@@ -9,6 +9,7 @@
#include <string.h>
#include "hal/assert.h"
#include "soc/ecdsa_reg.h"
#include "soc/pcr_struct.h"
#include "hal/ecdsa_types.h"
#ifdef __cplusplus
@@ -70,6 +71,25 @@ typedef enum {
ECDSA_MODE_SHA_CONTINUE
} ecdsa_ll_sha_mode_t;
/**
* @brief Enable the bus clock for ECDSA peripheral module
*
* @param true to enable the module, false to disable the module
*/
static inline void ecdsa_ll_enable_bus_clock(bool enable)
{
PCR.ecdsa_conf.ecdsa_clk_en = enable;
}
/**
* @brief Reset the ECDSA peripheral module
*/
static inline void ecdsa_ll_reset_register(void)
{
PCR.ecdsa_conf.ecdsa_rst_en = 1;
PCR.ecdsa_conf.ecdsa_rst_en = 0;
}
/**
* @brief Enable interrupt of a given type
*