Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_EFUSE_H__
53 #define __GR55xx_HAL_EFUSE_H__
190 #define HAL_EFUSE_ERROR_NONE ((uint32_t)0x00000000)
191 #define HAL_EFUSE_ERROR_TIMEOUT ((uint32_t)0x00000001)
192 #define HAL_EFUSE_ERROR_INVALID_PARAM ((uint32_t)0x00000002)
198 #define EFUSE_FLAG_WRITE_KEYRAM_BUSY LL_EFUSE_WRITE_KEYRAM_BUSY
199 #define EFUSE_FLAG_READ_TRIM_DONE LL_EFUSE_READ_TRIM_DONE
200 #define EFUSE_FLAG_CRC_CHECK_DONE LL_EFUSE_CRC_CHECK_DONE
201 #define EFUSE_FLAG_CRC_CHECK_SUCCESS LL_EFUSE_CRC_CHECK_SUCCESS
202 #define EFUSE_FLAG_INIT_CHECK_DONE LL_EFUSE_INIT_CHECK_DONE
203 #define EFUSE_FLAG_INIT_CHECK_SUCCESS LL_EFUSE_INIT_CHECK_SUCCESS
204 #define EFUSE_FLAG_WRITE_DONE LL_EFUSE_WRITE_DONE
205 #define EFUSE_FLAG_TEST_DONE LL_EFUSE_TEST_DONE
211 #define EFUSE_OFFSET_USER_DSVD (0x0000UL)
212 #define EFUSE_OFFSET_BBLK_TRIM (0x0020UL)
213 #define EFUSE_OFFSET_BBLK_CONFIG (0x005CUL)
214 #define EFUSE_OFFSET_BBLK_SWD (0x0060UL)
215 #define EFUSE_OFFSET_BBLK_EncMode (0x0062UL)
216 #define EFUSE_OFFSET_BBLK_CRC32 (0x0064UL)
217 #define EFUSE_OFFSET_BBLK_CHIP_ID (0x0068UL)
218 #define EFUSE_OFFSET_BBLK_PRODUCT_ID (0x006EUL)
219 #define EFUSE_OFFSET_BBLK_FW_PUBLICKEY (0x0070UL)
220 #define EFUSE_OFFSET_BBLK_ROOT_PUBLICKEY (0x0080UL)
221 #define EFUSE_OFFSET_BBLK_ECC_KEY (0x0090UL)
222 #define EFUSE_OFFSET_BBLK_FW_KEY (0x00B0UL)
223 #define EFUSE_OFFSET_BBLK_HMAC_KEY (0x00D0UL)
224 #define EFUSE_OFFSET_BBLK_DATA_KEY (0x00F0UL)
225 #define EFUSE_OFFSET_MBLK_TRIM (0x0110UL)
226 #define EFUSE_OFFSET_MBLK_CONFIG (0x014CUL)
227 #define EFUSE_OFFSET_MBLK_SWD (0x0150UL)
228 #define EFUSE_OFFSET_MBLK_EncMode (0x0152UL)
229 #define EFUSE_OFFSET_MBLK_CRC32 (0x0154UL)
230 #define EFUSE_OFFSET_MBLK_CHIP_ID (0x0158UL)
231 #define EFUSE_OFFSET_MBLK_PRODUCT_ID (0x015EUL)
232 #define EFUSE_OFFSET_MBLK_FW_PUBLICKEY (0x0160UL)
233 #define EFUSE_OFFSET_MBLK_ROOT_PUBLICKEY (0x0170UL)
234 #define EFUSE_OFFSET_MBLK_ECC_KEY (0x0180UL)
235 #define EFUSE_OFFSET_MBLK_FW_KEY (0x01A0UL)
236 #define EFUSE_OFFSET_MBLK_HMAC_KEY (0x01C0UL)
237 #define EFUSE_OFFSET_MBLK_DATA_KEY (0x01E0UL)
238 #define EFUSE_OFFSET_END (0x0200UL)
252 #define __HAL_EFUSE_ENABLE_MAIN_BACKUP(__HANDLE__) ll_efuse_enable_main_backup((__HANDLE__)->p_instance)
258 #define __HAL_EFUSE_DISABLE_MAIN_BACKUP(__HANDLE__) ll_efuse_disable_main_backup((__HANDLE__)->p_instance)
274 #define __HAL_EFUSE_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)
hal_status_t hal_efuse_read(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
Read the eFuse memory data.
hal_status_t hal_efuse_set_main_backup(efuse_handle_t *p_efuse)
Set the main or backup info of the eFuse memory.
Header file containing functions prototypes of eFuse LL library.
uint32_t present_xip_mask
struct _efuse_handle efuse_handle_t
eFuse handle Structure definition
hal_lock_t
HAL Lock structures definition.
eFuse handle Structure definition
uint32_t present_mcu_mask
struct _efuse_init efuse_init_t
eFuse init Structure definition
eFuse Keyram Structure definition
void(* efuse_msp_init)(efuse_handle_t *p_efuse)
struct _hal_efuse_callback hal_efuse_callback_t
HAL_EFUSE Callback function definition.
hal_status_t hal_efuse_crc_calculate(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t nword, uint32_t *p_result)
Calculate CRC of the eFuse memory data.
hal_status_t hal_efuse_write(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
Write the eFuse memory data.
hal_status_t hal_efuse_init(efuse_handle_t *p_efuse)
Initialize the eFuse according to the specified parameters in the efuse_init_t and initialize the ass...
hal_status_t hal_efuse_read_trim(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
Read trim from eFuse memory data.
HAL_EFUSE Callback function definition.
efuse_regs_t * p_instance
eFuse init Structure definition
struct _keyram_mask keyram_mask_t
eFuse Keyram Structure definition
void hal_efuse_msp_deinit(efuse_handle_t *p_efuse)
De-initialize the eFuse MSP.
hal_status_t hal_efuse_initial_value_check(efuse_handle_t *p_efuse)
Check the eFuse memory with 0, if memory are all 0, return HAL_OK, then return HAL_ERROR.
hal_status_t
HAL Status structures definition.
__IO hal_efuse_state_t state
hal_status_t hal_efuse_deinit(efuse_handle_t *p_efuse)
De-initialize the eFuse peripheral.
void hal_efuse_msp_init(efuse_handle_t *p_efuse)
Initialize the eFuse MSP.
hal_efuse_state_t
HAL eFuse State Enumerations definition.
hal_status_t hal_efuse_write_keyram(efuse_handle_t *p_efuse, keyram_mask_t *p_mask)
Read the key from eFuse memory and write to keyram.
void(* efuse_msp_deinit)(efuse_handle_t *p_efuse)
This file contains HAL common definitions, enumeration, macros and structures definitions.