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 Check whether the specified eFuse flag is set or not.
261 * @param __HANDLE__ specifies the eFuse Handle.
262 * @param __FLAG__ specifies the flag to check.
263 * This parameter can be one of the following values:
264 * @arg @ref EFUSE_FLAG_WRITE_KEYRAM_BUSY Write keyram operation is in process
265 * @arg @ref EFUSE_FLAG_READ_TRIM_DONE Read trim from eFuse has done
266 * @arg @ref EFUSE_FLAG_CRC_CHECK_DONE eFuse CRC check done
267 * @arg @ref EFUSE_FLAG_CRC_CHECK_SUCCESS CRC check succeeded
268 * @arg @ref EFUSE_FLAG_INIT_CHECK_DONE eFuse initial value check done
269 * @arg @ref EFUSE_FLAG_INIT_CHECK_SUCCESS eFuse initial value check succeeded
270 * @arg @ref EFUSE_FLAG_WRITE_DONE eFuse one word write done
271 * @arg @ref EFUSE_FLAG_TEST_DONE Read from eFuse has done in test mode
272 * @retval The new state of __FLAG__ (TRUE or FALSE).
273 */
274 #define __HAL_EFUSE_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)
275 /** @} */
276
277 /** @} */
278
279 /* Exported functions --------------------------------------------------------*/
280 /** @addtogroup HAL_EFUSE_DRIVER_FUNCTIONS Functions
281 * @{
282 */
283
284 /** @addtogroup EFUSE_Exported_Functions_Group1 Initialization and de-initialization functions
285 * @brief Initialization and de-initialization functions
286 *
287 @verbatim
288 ===============================================================================
289 ##### Initialization and de-initialization functions #####
290 ===============================================================================
291 [..] This subsection provides a set of functions allowing to initialize and
292 de-initialize the EFUSEx peripheral:
293
294 (+) User must implement hal_efuse_msp_init() function in which he configures
295 all related peripherals resources (GPIO, DMA, IT and NVIC ).
296
297 (+) Call the function hal_efuse_init() to configure the selected device with
298 the selected configuration:
299 (++) info_mode
300
301 (+) Call the function hal_efuse_deinit() to restore the default configuration
302 of the selected EFUSEx peripheral.
303
304 @endverbatim
305 * @{
306 */
307
308 /**
309 ****************************************************************************************
310 * @brief Initialize the eFuse according to the specified parameters
311 * in the efuse_init_t and initialize the associated handle.
312 *
313 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
314 *
315 * @retval ::HAL_OK: Operation is OK.
316 * @retval ::HAL_ERROR: Parameter error or operation not supported.
317 * @retval ::HAL_BUSY: Driver is busy.
318 * @retval ::HAL_TIMEOUT: Timeout occurred.
319 ****************************************************************************************
320 */
321 hal_status_t hal_efuse_init(efuse_handle_t *p_efuse);
322
323 /**
324 ****************************************************************************************
325 * @brief De-initialize the eFuse peripheral.
326 *
327 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
328 *
329 * @retval ::HAL_OK: Operation is OK.
330 * @retval ::HAL_ERROR: Parameter error or operation not supported.
331 * @retval ::HAL_BUSY: Driver is busy.
332 * @retval ::HAL_TIMEOUT: Timeout occurred.
333 ****************************************************************************************
334 */
335 hal_status_t hal_efuse_deinit(efuse_handle_t *p_efuse);
336
337 /**
338 ****************************************************************************************
339 * @brief Initialize the eFuse MSP.
340 *
341 * @note This function should not be modified. When the callback is needed,
342 * the hal_efuse_msp_deinit can be implemented in the user file.
343 *
344 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
345 ****************************************************************************************
346 */
347 void hal_efuse_msp_init(efuse_handle_t *p_efuse);
348
349 /**
350 ****************************************************************************************
351 * @brief De-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_deinit(efuse_handle_t *p_efuse);
360
361 /** @} */
362
363 /** @addtogroup EFUSE_Exported_Functions_Group2 IO operation functions
364 * @brief eFuse Data manage functions
365 *
366 * @{
367 */
368
369 /**
370 ****************************************************************************************
371 * @brief Write the eFuse memory data.
372 *
373 * @note Address should be eFuse memory address.
374 *
375 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
376 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
377 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
378 * @param[in] nword: Size of data to be write, unit word.
379 *
380 * @retval ::HAL_OK: Operation is OK.
381 * @retval ::HAL_ERROR: Parameter error or operation not supported.
382 * @retval ::HAL_BUSY: Driver is busy.
383 * @retval ::HAL_TIMEOUT: Timeout occurred.
384 ****************************************************************************************
385 */
386 hal_status_t hal_efuse_write(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
387
388 /**
389 ****************************************************************************************
390 * @brief Read the eFuse memory data.
391 *
392 * @note Address should be eFuse memory address.
393 *
394 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
395 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x000 ~ 0x80.
396 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
397 * @param[in] nword: Size of data to be read, unit word.
398 *
399 * @retval ::HAL_OK: Operation is OK.
400 * @retval ::HAL_ERROR: Parameter error or operation not supported.
401 * @retval ::HAL_BUSY: Driver is busy.
402 * @retval ::HAL_TIMEOUT: Timeout occurred.
403 ****************************************************************************************
404 */
405 hal_status_t hal_efuse_read(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
406
407 /**
408 ****************************************************************************************
409 * @brief Read the key from eFuse memory and write to keyram.
410 *
411 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
412 * @param[in] p_mask: Pointer to a KEYRAM handle which contains the configuration information for the specified KEYRAM MASK.
413 *
414 * @retval ::HAL_OK: Operation is OK.
415 * @retval ::HAL_ERROR: Parameter error or operation not supported.
416 * @retval ::HAL_BUSY: Driver is busy.
417 * @retval ::HAL_TIMEOUT: Timeout occurred.
418 ****************************************************************************************
419 */
420 hal_status_t hal_efuse_write_keyram(efuse_handle_t *p_efuse, keyram_mask_t *p_mask);
421
422 /**
423 ****************************************************************************************
424 * @brief Check the eFuse memory with 0, if memory are all 0, return HAL_OK, then return HAL_ERROR.
425 *
426 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
427 *
428 * @retval ::HAL_OK: Operation is OK.
429 * @retval ::HAL_ERROR: Parameter error or operation not supported.
430 * @retval ::HAL_BUSY: Driver is busy.
431 * @retval ::HAL_TIMEOUT: Timeout occurred.
432 ****************************************************************************************
433 */
434 hal_status_t hal_efuse_initial_value_check(efuse_handle_t *p_efuse);
435
436 /**
437 ****************************************************************************************
438 * @brief Calculate CRC of the eFuse memory data.
439 *
440 * @note Address must be main info eFuse memory address.
441 *
442 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
443 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
444 * @param[in] nword: Size of data to be read, unit word, this parament can be a value between: 1 ~ 60.
445 * @param[in] p_result: Pointer to result.
446 *
447 * @retval ::HAL_OK: Operation is OK.
448 * @retval ::HAL_ERROR: Parameter error or operation not supported.
449 * @retval ::HAL_BUSY: Driver is busy.
450 * @retval ::HAL_TIMEOUT: Timeout occurred.
451 ****************************************************************************************
452 */
453 hal_status_t hal_efuse_crc_calculate(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t nword, uint32_t *p_result);
454
455 /**
456 ****************************************************************************************
457 * @brief Read trim from eFuse memory data.
458 *
459 * @note Address must be main info eFuse memory address.
460 *
461 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
462 * @param[in] word_offset: eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
463 * @param[in] p_data: Pointer to data buffer for storage eFuse data.
464 * @param[in] nword: Size of data to be read, unit word, this parament can be a value between: 1 ~ 20.
465 *
466 * @retval ::HAL_OK: Operation is OK.
467 * @retval ::HAL_ERROR: Parameter error or operation not supported.
468 * @retval ::HAL_BUSY: Driver is busy.
469 * @retval ::HAL_TIMEOUT: Timeout occurred.
470 ****************************************************************************************
471 */
472 hal_status_t hal_efuse_read_trim(efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword);
473
474 /**
475 ****************************************************************************************
476 * @brief Set the main or backup info of the eFuse memory.
477 *
478 * @param[in] p_efuse: Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
479 *
480 * @retval ::HAL_OK: Operation is OK.
481 * @retval ::HAL_ERROR: Parameter error or operation not supported.
482 * @retval ::HAL_BUSY: Driver is busy.
483 * @retval ::HAL_TIMEOUT: Timeout occurred.
484 ****************************************************************************************
485 */
486 hal_status_t hal_efuse_set_main_backup(efuse_handle_t *p_efuse);
487
488 /** @} */
489
490 /** @} */
491
492 #ifdef __cplusplus
493 }
494 #endif
495
496 #endif /* __GR55xx_HAL_EFUSE_H__ */
497
498 /** @} */
499
500 /** @} */
501
502 /** @} */
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