gr55xx_hal_efuse.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_hal_efuse.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of eFuse HAL library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup HAL_DRIVER HAL Driver
43 * @{
44 */
45
46 /** @defgroup HAL_EFUSE EFUSE
47 * @brief eFuse HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_EFUSE_H__
53 #define __GR55xx_HAL_EFUSE_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_hal_def.h"
61 #include "gr55xx_ll_efuse.h"
62
63 /* Exported types ------------------------------------------------------------*/
64 /** @addtogroup HAL_EFUSE_ENUMERATIONS Enumerations
65 * @{
66 */
67
68 /** @defgroup HAL_EFUSE_state HAL EFUSE state
69 * @{
70 */
71
72 /**
73 * @brief HAL eFuse State Enumerations definition
74 */
75 typedef enum
76 {
77 HAL_EFUSE_STATE_RESET = 0x00, /**< Peripheral not yet initialized or disabled */
78 HAL_EFUSE_STATE_READY = 0x01, /**< Peripheral Initialized and ready for use */
79 HAL_EFUSE_STATE_BUSY = 0x02, /**< An internal process is ongoing */
80 HAL_EFUSE_STATE_ERROR = 0x04 /**< Reception process is error */
81 } hal_efuse_state_t;
82 /** @} */
83
84 /** @} */
85
86 /** @addtogroup HAL_EFUSE_STRUCTURES Structures
87 * @{
88 */
89
90 /** @defgroup EFUSE_Configuration EFUSE Configuration
91 * @{
92 */
93
94 /**
95 * @brief eFuse init Structure definition
96 */
97 typedef struct _efuse_init
98 {
99 uint32_t info_mode; /**< Specifies the info mode, enable or disable main or backup info. */
100
101 } efuse_init_t;
102
103 /** @} */
104
105 /** @defgroup EFUSE_handle EFUSE handle
106 * @{
107 */
108
109 /**
110 * @brief eFuse handle Structure definition
111 */
112 typedef struct _efuse_handle
113 {
114 efuse_regs_t *p_instance; /**< Register base address */
115
116 efuse_init_t init; /**< eFuse base required parameters */
117
118 __IO hal_lock_t lock; /**< Locking object */
119
120 __IO hal_efuse_state_t state; /**< eFuse operation state */
121
122 __IO uint32_t error_code; /**< eFuse Error code */
123
124 } efuse_handle_t;
125 /** @} */
126
127 /** @defgroup EFUSE_Keyram Keyram configuration
128 * @{
129 */
130
131 /**
132 * @brief eFuse Keyram Structure definition
133 */
134 typedef struct _keyram_mask
135 {
136 uint32_t aes_mask; /**< AES port mask. */
137
138 uint32_t hmac_mask; /**< HMAC port mask. */
139
140 uint32_t present_mcu_mask; /**< Present of MCU port mask. */
141
142 uint32_t present_xip_mask; /**< Present of XIP port mask. */
143
144 uint32_t efuse_mask; /**< eFuse port mask. */
145
146 uint32_t enc_key_low; /**< encrypt key low 32bit mask. */
147
148 uint32_t enc_key_high; /**< encrypt key high 32bit mask. */
149 } keyram_mask_t;
150
151 /** @} */
152
153 /** @} */
154
155 /** @addtogroup HAL_EFUSE_CALLBACK_STRUCTURES Callback Structures
156 * @{
157 */
158
159 /** @defgroup HAL_EFUSE_Callback Callback
160 * @{
161 */
162
163 /**
164 * @brief HAL_EFUSE Callback function definition
165 */
166
167 typedef struct _hal_efuse_callback
168 {
169 void (*efuse_msp_init)(efuse_handle_t *p_efuse); /**< EFUSE init MSP callback */
170 void (*efuse_msp_deinit)(efuse_handle_t *p_efuse); /**< EFUSE de-init MSP callback */
171 } hal_efuse_callback_t;
172
173 /** @} */
174
175 /** @} */
176
177 /**
178 * @defgroup HAL_EFUSE_MACRO Defines
179 * @{
180 */
181
182 /* Exported macro ------------------------------------------------------------*/
183 /** @defgroup EFUSE_Exported_Macros EFUSE Exported Macros
184 * @{
185 */
186
187 /** @defgroup EFUSE_Error_Code EFUSE Error Code
188 * @{
189 */
190 #define HAL_EFUSE_ERROR_NONE ((uint32_t)0x00000000) /**< No error */
191 #define HAL_EFUSE_ERROR_TIMEOUT ((uint32_t)0x00000001) /**< Timeout error */
192 #define HAL_EFUSE_ERROR_INVALID_PARAM ((uint32_t)0x00000002) /**< Invalid parameters error */
193 /** @} */
194
195 /** @defgroup EFUSE_Flags EFUSE Flags
196 * @{
197 */
198 #define EFUSE_FLAG_WRITE_KEYRAM_BUSY LL_EFUSE_WRITE_KEYRAM_BUSY /**< Write keyram operation is in process */
199 #define EFUSE_FLAG_READ_TRIM_DONE LL_EFUSE_READ_TRIM_DONE /**< Read trim from eFuse has done */
200 #define EFUSE_FLAG_CRC_CHECK_DONE LL_EFUSE_CRC_CHECK_DONE /**< eFuse CRC check done */
201 #define EFUSE_FLAG_CRC_CHECK_SUCCESS LL_EFUSE_CRC_CHECK_SUCCESS /**< CRC check succeeded */
202 #define EFUSE_FLAG_INIT_CHECK_DONE LL_EFUSE_INIT_CHECK_DONE /**< eFuse initial value check done */
203 #define EFUSE_FLAG_INIT_CHECK_SUCCESS LL_EFUSE_INIT_CHECK_SUCCESS /**< eFuse initial value check succeeded */
204 #define EFUSE_FLAG_WRITE_DONE LL_EFUSE_WRITE_DONE /**< eFuse one word write done */
205 #define EFUSE_FLAG_TEST_DONE LL_EFUSE_TEST_DONE /**< Read from eFuse has done in test mode */
206 /** @} */
207
208 /** @defgroup EFUSE_Loyout_Map EFUSE Loyout Map
209 * @{
210 */
211 #define EFUSE_OFFSET_USER_DSVD (0x0000UL) /**< Reserved offset in backup info block */
212 #define EFUSE_OFFSET_BBLK_TRIM (0x0020UL) /**< Triming offset in backup info block */
213 #define EFUSE_OFFSET_BBLK_CONFIG (0x005CUL) /**< Configuration offset in backup info block */
214 #define EFUSE_OFFSET_BBLK_SWD (0x0060UL) /**< SWD Enable offset in backup info block */
215 #define EFUSE_OFFSET_BBLK_EncMode (0x0062UL) /**< Encryption Mode offset in backup info block */
216 #define EFUSE_OFFSET_BBLK_CRC32 (0x0064UL) /**< CRC32 offset in backup info block */
217 #define EFUSE_OFFSET_BBLK_CHIP_ID (0x0068UL) /**< Chip ID offset in backup info block */
218 #define EFUSE_OFFSET_BBLK_PRODUCT_ID (0x006EUL) /**< Product ID offset in backup info block */
219 #define EFUSE_OFFSET_BBLK_FW_PUBLICKEY (0x0070UL) /**< Firmware public key offset in backup info block */
220 #define EFUSE_OFFSET_BBLK_ROOT_PUBLICKEY (0x0080UL) /**< Root public key offset in backup info block */
221 #define EFUSE_OFFSET_BBLK_ECC_KEY (0x0090UL) /**< ECC key offset in backup info block */
222 #define EFUSE_OFFSET_BBLK_FW_KEY (0x00B0UL) /**< Firmware key offset in backup info block */
223 #define EFUSE_OFFSET_BBLK_HMAC_KEY (0x00D0UL) /**< HMAC key offset in backup info block */
224 #define EFUSE_OFFSET_BBLK_DATA_KEY (0x00F0UL) /**< Data key offset in backup info block */
225 #define EFUSE_OFFSET_MBLK_TRIM (0x0110UL) /**< Triming offset in main info block */
226 #define EFUSE_OFFSET_MBLK_CONFIG (0x014CUL) /**< Configuration offset in main info block */
227 #define EFUSE_OFFSET_MBLK_SWD (0x0150UL) /**< SWD Enable offset in main info block */
228 #define EFUSE_OFFSET_MBLK_EncMode (0x0152UL) /**< Encryption Mode offset in main info block */
229 #define EFUSE_OFFSET_MBLK_CRC32 (0x0154UL) /**< CRC32 offset in main info block */
230 #define EFUSE_OFFSET_MBLK_CHIP_ID (0x0158UL) /**< Chip ID offset in main info block */
231 #define EFUSE_OFFSET_MBLK_PRODUCT_ID (0x015EUL) /**< Product ID offset in main info block */
232 #define EFUSE_OFFSET_MBLK_FW_PUBLICKEY (0x0160UL) /**< Firmware public key offset in main info block */
233 #define EFUSE_OFFSET_MBLK_ROOT_PUBLICKEY (0x0170UL) /**< Root public key offset in main info block */
234 #define EFUSE_OFFSET_MBLK_ECC_KEY (0x0180UL) /**< ECC key offset in main info block */
235 #define EFUSE_OFFSET_MBLK_FW_KEY (0x01A0UL) /**< Firmware key offset in main info block */
236 #define EFUSE_OFFSET_MBLK_HMAC_KEY (0x01C0UL) /**< HMAC key offset in main info block */
237 #define EFUSE_OFFSET_MBLK_DATA_KEY (0x01E0UL) /**< Data key offset in main info block */
238 #define EFUSE_OFFSET_END (0x0200UL) /**< eFuse Offset end */
239 /** @} */
240
241 /** @} */
242
243 /* Exported macro ------------------------------------------------------------*/
244 /** @defgroup EFUSE_Exported_Macros EFUSE Exported Macros
245 * @{
246 */
247
248 /** @brief Enable the eFuse main or backup.
249 * @param __HANDLE__ Specifies the eFuse Handle.
250 * @retval None.
251 */
252 #define __HAL_EFUSE_ENABLE_MAIN_BACKUP(__HANDLE__) ll_efuse_enable_main_backup((__HANDLE__)->p_instance)
253
254 /** @brief Disable the eFuse main or backup.
255 * @param __HANDLE__ Specifies the eFuse Handle.
256 * @retval None.
257 */
258 #define __HAL_EFUSE_DISABLE_MAIN_BACKUP(__HANDLE__) ll_efuse_disable_main_backup((__HANDLE__)->p_instance)
259
260 /** @brief Enable the eFuse PGENB.
261 * @param __HANDLE__ Specifies the eFuse Handle.
262 * @retval None.
263 */
264 #define __HAL_EFUSE_ENABLE_PGENB(__HANDLE__) ll_efuse_enable_pgenb((__HANDLE__)->p_instance)
265
266 /** @brief Disable the eFuse PGENB.
267 * @param __HANDLE__ Specifies the eFuse Handle.
268 * @retval None.
269 */
270 #define __HAL_EFUSE_DISABLE_PGENB(__HANDLE__) ll_efuse_disable_pgenb((__HANDLE__)->p_instance)
271
272 /** @brief Check whether the specified eFuse flag is set or not.
273 * @param __HANDLE__ specifies the eFuse Handle.
274 * @param __FLAG__ specifies the flag to check.
275 * This parameter can be one of the following values:
276 * @arg @ref EFUSE_FLAG_WRITE_KEYRAM_BUSY Write keyram operation is in process
277 * @arg @ref EFUSE_FLAG_READ_TRIM_DONE Read trim from eFuse has done
278 * @arg @ref EFUSE_FLAG_CRC_CHECK_DONE eFuse CRC check done
279 * @arg @ref EFUSE_FLAG_CRC_CHECK_SUCCESS CRC check succeeded
280 * @arg @ref EFUSE_FLAG_INIT_CHECK_DONE eFuse initial value check done
281 * @arg @ref EFUSE_FLAG_INIT_CHECK_SUCCESS eFuse initial value check succeeded
282 * @arg @ref EFUSE_FLAG_WRITE_DONE eFuse one word write done
283 * @arg @ref EFUSE_FLAG_TEST_DONE Read from eFuse has done in test mode
284 * @retval The new state of __FLAG__ (TRUE or FALSE).
285 */
286 #define __HAL_EFUSE_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)
287 /** @} */
288
289 /** @} */
290
291 /* Exported functions --------------------------------------------------------*/
292 /** @addtogroup HAL_EFUSE_DRIVER_FUNCTIONS Functions
293 * @{
294 */
295
296 /** @defgroup EFUSE_Exported_Functions_Group1 Initialization and de-initialization functions
297 * @brief Initialization and de-initialization functions
298 *
299 @verbatim
300 ===============================================================================
301 ##### Initialization and de-initialization functions #####
302 ===============================================================================
303 [..] This subsection provides a set of functions allowing to initialize and
304 de-initialize the EFUSEx peripheral:
305
306 (+) User must implement hal_efuse_msp_init() function in which he configures
307 all related peripherals resources (GPIO, DMA, IT and NVIC ).
308
309 (+) Call the function hal_efuse_init() to configure the selected device with
310 the selected configuration:
311 (++) info_mode
312
313 (+) Call the function hal_efuse_deinit() to restore the default configuration
314 of the selected EFUSEx peripheral.
315
316 @endverbatim
317 * @{
318 */
319
320 /**
321 ****************************************************************************************
322 * @brief Initialize the eFuse according to the specified parameters
323 * in the efuse_init_t and initialize the associated handle.
324 *
325 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
326 *
327 * @retval ::HAL_OK: Operation is OK.
328 * @retval ::HAL_ERROR: Parameter error or operation not supported.
329 * @retval ::HAL_BUSY: Driver is busy.
330 * @retval ::HAL_TIMEOUT: Timeout occurred.
331 ****************************************************************************************
332 */
333 hal_status_t hal_efuse_init(efuse_handle_t *p_efuse);
334
335 /**
336 ****************************************************************************************
337 * @brief De-initialize the eFuse peripheral.
338 *
339 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
340 *
341 * @retval ::HAL_OK: Operation is OK.
342 * @retval ::HAL_ERROR: Parameter error or operation not supported.
343 * @retval ::HAL_BUSY: Driver is busy.
344 * @retval ::HAL_TIMEOUT: Timeout occurred.
345 ****************************************************************************************
346 */
347 hal_status_t hal_efuse_deinit(efuse_handle_t *p_efuse);
348
349 /**
350 ****************************************************************************************
351 * @brief Initialize the eFuse MSP.
352 *
353 * @note This function should not be modified. When the callback is needed,
354 * the hal_efuse_msp_deinit can be implemented in the user file.
355 *
356 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
357 ****************************************************************************************
358 */
359 void hal_efuse_msp_init(efuse_handle_t *p_efuse);
360
361 /**
362 ****************************************************************************************
363 * @brief De-initialize the eFuse MSP.
364 *
365 * @note This function should not be modified. When the callback is needed,
366 * the hal_efuse_msp_deinit can be implemented in the user file.
367 *
368 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
369 ****************************************************************************************
370 */
371 void hal_efuse_msp_deinit(efuse_handle_t *p_efuse);
372
373 /** @} */
374
375 /** @defgroup EFUSE_Exported_Functions_Group2 IO operation functions
376 * @brief eFuse Data manage functions
377 *
378 * @{
379 */
380
381 /**
382 ****************************************************************************************
383 * @brief Write the eFuse memory data.
384 *
385 * @note Address should be eFuse memory address.
386 *
387 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
388 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
389 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
390 * @param[in] nword: Size of data to be write, unit word.
391 *
392 * @retval ::HAL_OK: Operation is OK.
393 * @retval ::HAL_ERROR: Parameter error or operation not supported.
394 * @retval ::HAL_BUSY: Driver is busy.
395 * @retval ::HAL_TIMEOUT: Timeout occurred.
396 ****************************************************************************************
397 */
398 hal_status_t hal_efuse_write(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
399
400 /**
401 ****************************************************************************************
402 * @brief Read the eFuse memory data.
403 *
404 * @note Address should be eFuse memory address.
405 *
406 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
407 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x000 ~ 0x80.
408 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
409 * @param[in] nword: Size of data to be read, unit word.
410 *
411 * @retval ::HAL_OK: Operation is OK.
412 * @retval ::HAL_ERROR: Parameter error or operation not supported.
413 * @retval ::HAL_BUSY: Driver is busy.
414 * @retval ::HAL_TIMEOUT: Timeout occurred.
415 ****************************************************************************************
416 */
417 hal_status_t hal_efuse_read(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
418
419 /**
420 ****************************************************************************************
421 * @brief Read the key from eFuse memory and write to keyram.
422 *
423 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
424 * @param[in] p_mask: Pointer to a KEYRAM handle which contains the configuration information for the specified KEYRAM MASK.
425 *
426 * @retval ::HAL_OK: Operation is OK.
427 * @retval ::HAL_ERROR: Parameter error or operation not supported.
428 * @retval ::HAL_BUSY: Driver is busy.
429 * @retval ::HAL_TIMEOUT: Timeout occurred.
430 ****************************************************************************************
431 */
432 hal_status_t hal_efuse_write_keyram(efuse_handle_t *p_efuse, keyram_mask_t *p_mask);
433
434 /**
435 ****************************************************************************************
436 * @brief Check the eFuse memory with 0, if memory are all 0, return HAL_OK, then return HAL_ERROR.
437 *
438 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
439 *
440 * @retval ::HAL_OK: Operation is OK.
441 * @retval ::HAL_ERROR: Parameter error or operation not supported.
442 * @retval ::HAL_BUSY: Driver is busy.
443 * @retval ::HAL_TIMEOUT: Timeout occurred.
444 ****************************************************************************************
445 */
446 hal_status_t hal_efuse_initial_value_check(efuse_handle_t *p_efuse);
447
448 /**
449 ****************************************************************************************
450 * @brief Calculate CRC of the eFuse memory data.
451 *
452 * @note Address must be main info eFuse memory address.
453 *
454 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
455 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
456 * @param[in] nword: Size of data to be read, unit word, this parament can be a value between: 1 ~ 60.
457 * @param[in] p_result: Pointer to result.
458 *
459 * @retval ::HAL_OK: Operation is OK.
460 * @retval ::HAL_ERROR: Parameter error or operation not supported.
461 * @retval ::HAL_BUSY: Driver is busy.
462 * @retval ::HAL_TIMEOUT: Timeout occurred.
463 ****************************************************************************************
464 */
465 hal_status_t hal_efuse_crc_calculate(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t nword, uint32_t *p_result);
466
467 /**
468 ****************************************************************************************
469 * @brief Read trim from eFuse memory data.
470 *
471 * @note Address must be main info eFuse memory address.
472 *
473 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
474 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
475 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
476 * @param[in] nword: Size of data to be read, unit word, this parament can be a value between: 1 ~ 20.
477 *
478 * @retval ::HAL_OK: Operation is OK.
479 * @retval ::HAL_ERROR: Parameter error or operation not supported.
480 * @retval ::HAL_BUSY: Driver is busy.
481 * @retval ::HAL_TIMEOUT: Timeout occurred.
482 ****************************************************************************************
483 */
484 hal_status_t hal_efuse_read_trim(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
485
486 /**
487 ****************************************************************************************
488 * @brief Set the main or backup info of the eFuse memory.
489 *
490 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
491 *
492 * @retval ::HAL_OK: Operation is OK.
493 * @retval ::HAL_ERROR: Parameter error or operation not supported.
494 * @retval ::HAL_BUSY: Driver is busy.
495 * @retval ::HAL_TIMEOUT: Timeout occurred.
496 ****************************************************************************************
497 */
498 hal_status_t hal_efuse_set_main_backup(efuse_handle_t *p_efuse);
499
500 /** @} */
501
502 /** @} */
503
504 #ifdef __cplusplus
505 }
506 #endif
507
508 #endif /* __GR55xx_HAL_EFUSE_H__ */
509
510 /** @} */
511
512 /** @} */
513
514 /** @} */
hal_efuse_read
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_efuse_set_main_backup
hal_status_t hal_efuse_set_main_backup(efuse_handle_t *p_efuse)
Set the main or backup info of the eFuse memory.
gr55xx_ll_efuse.h
Header file containing functions prototypes of eFuse LL library.
_keyram_mask::present_xip_mask
uint32_t present_xip_mask
Definition: gr55xx_hal_efuse.h:142
efuse_handle_t
struct _efuse_handle efuse_handle_t
eFuse handle Structure definition
_keyram_mask::aes_mask
uint32_t aes_mask
Definition: gr55xx_hal_efuse.h:136
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
_efuse_handle
eFuse handle Structure definition
Definition: gr55xx_hal_efuse.h:113
_efuse_init::info_mode
uint32_t info_mode
Definition: gr55xx_hal_efuse.h:99
_keyram_mask::present_mcu_mask
uint32_t present_mcu_mask
Definition: gr55xx_hal_efuse.h:140
efuse_init_t
struct _efuse_init efuse_init_t
eFuse init Structure definition
_efuse_handle::init
efuse_init_t init
Definition: gr55xx_hal_efuse.h:116
_keyram_mask
eFuse Keyram Structure definition
Definition: gr55xx_hal_efuse.h:135
_hal_efuse_callback::efuse_msp_init
void(* efuse_msp_init)(efuse_handle_t *p_efuse)
Definition: gr55xx_hal_efuse.h:169
hal_efuse_callback_t
struct _hal_efuse_callback hal_efuse_callback_t
HAL_EFUSE Callback function definition.
hal_efuse_crc_calculate
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_efuse_write
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_EFUSE_STATE_RESET
@ HAL_EFUSE_STATE_RESET
Definition: gr55xx_hal_efuse.h:77
hal_efuse_init
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_efuse_read_trim
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.
_keyram_mask::hmac_mask
uint32_t hmac_mask
Definition: gr55xx_hal_efuse.h:138
_hal_efuse_callback
HAL_EFUSE Callback function definition.
Definition: gr55xx_hal_efuse.h:168
_efuse_handle::p_instance
efuse_regs_t * p_instance
Definition: gr55xx_hal_efuse.h:114
_efuse_init
eFuse init Structure definition
Definition: gr55xx_hal_efuse.h:98
keyram_mask_t
struct _keyram_mask keyram_mask_t
eFuse Keyram Structure definition
hal_efuse_msp_deinit
void hal_efuse_msp_deinit(efuse_handle_t *p_efuse)
De-initialize the eFuse MSP.
hal_efuse_initial_value_check
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.
_keyram_mask::enc_key_low
uint32_t enc_key_low
Definition: gr55xx_hal_efuse.h:146
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
HAL_EFUSE_STATE_READY
@ HAL_EFUSE_STATE_READY
Definition: gr55xx_hal_efuse.h:78
_keyram_mask::efuse_mask
uint32_t efuse_mask
Definition: gr55xx_hal_efuse.h:144
_efuse_handle::state
__IO hal_efuse_state_t state
Definition: gr55xx_hal_efuse.h:120
_keyram_mask::enc_key_high
uint32_t enc_key_high
Definition: gr55xx_hal_efuse.h:148
_efuse_handle::error_code
__IO uint32_t error_code
Definition: gr55xx_hal_efuse.h:122
hal_efuse_deinit
hal_status_t hal_efuse_deinit(efuse_handle_t *p_efuse)
De-initialize the eFuse peripheral.
hal_efuse_msp_init
void hal_efuse_msp_init(efuse_handle_t *p_efuse)
Initialize the eFuse MSP.
HAL_EFUSE_STATE_BUSY
@ HAL_EFUSE_STATE_BUSY
Definition: gr55xx_hal_efuse.h:79
HAL_EFUSE_STATE_ERROR
@ HAL_EFUSE_STATE_ERROR
Definition: gr55xx_hal_efuse.h:80
hal_efuse_state_t
hal_efuse_state_t
HAL eFuse State Enumerations definition.
Definition: gr55xx_hal_efuse.h:76
hal_efuse_write_keyram
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.
_hal_efuse_callback::efuse_msp_deinit
void(* efuse_msp_deinit)(efuse_handle_t *p_efuse)
Definition: gr55xx_hal_efuse.h:170
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
_efuse_handle::lock
__IO hal_lock_t lock
Definition: gr55xx_hal_efuse.h:118