1 /*
2  * Copyright 2021 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  */
8 
9 #ifndef _FSL_EFUSE_H_
10 #define _FSL_EFUSE_H_
11 
12 #include "fsl_flash.h"
13 
14 /*!
15  * @addtogroup efuse_driver
16  * @{
17  */
18 
19 /*! @file */
20 
21 /*******************************************************************************
22  * Definitions
23  ******************************************************************************/
24 
25 /*******************************************************************************
26  * API
27  ******************************************************************************/
28 
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif
32 
33 /*!
34  * @name EFUSE APIs
35  * @{
36  */
37 
38 /*!
39  * @brief Initialize EFUSE controller.
40  *
41  * This function enables EFUSE Controller clock.
42  *
43  * @retval #kStatus_Success 0 Operation succeeded without error.
44  * @retval #kStatus_Fail 1 The operation failed with a generic error.
45  * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only.
46  * @retval #kStatus_OutOfRange 3 Requested value is out of range.
47  * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined.
48  * @retval #kStatus_Timeout An invalid 5 A timeout occurred
49  * @retval #kStatus_NoTransferInProgress 6 No send in progress.
50  */
51 status_t EFUSE_Init(void);
52 
53 /*!
54  * @brief De-Initialize EFUSE controller.
55  *
56  * This functin disables EFUSE Controller Clock.
57  *
58  * @retval #kStatus_Success 0 Operation succeeded without error.
59  * @retval #kStatus_Fail 1 The operation failed with a generic error.
60  * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only.
61  * @retval #kStatus_OutOfRange 3 Requested value is out of range.
62  * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined.
63  * @retval #kStatus_Timeout An invalid 5 A timeout occurred
64  * @retval #kStatus_NoTransferInProgress 6 No send in progress.
65  */
66 status_t EFUSE_Deinit(void);
67 
68 /*!
69  * @brief Read Fuse value from eFuse word.
70  *
71  * This function read fuse data from eFuse word to specified data buffer.
72  *
73  * @param addr Fuse address
74  * @param data Buffer to hold the data read from eFuse word
75  *
76  * @retval #kStatus_Success 0 Operation succeeded without error.
77  * @retval #kStatus_Fail 1 The operation failed with a generic error.
78  * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only.
79  * @retval #kStatus_OutOfRange 3 Requested value is out of range.
80  * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined.
81  * @retval #kStatus_Timeout An invalid 5 A timeout occurred
82  * @retval #kStatus_NoTransferInProgress 6 No send in progress.
83  */
84 status_t EFUSE_Read(uint32_t addr, uint32_t *data);
85 
86 /*!
87  * @brief Program value to eFuse block.
88  *
89  * This function program data to specified eFuse address.
90  *
91  * @param addr Fuse address
92  * @param data data to be programmed into eFuse Fuse block
93  *
94  * @retval #kStatus_Success 0 Operation succeeded without error.
95  * @retval #kStatus_Fail 1 The operation failed with a generic error.
96  * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only.
97  * @retval #kStatus_OutOfRange 3 Requested value is out of range.
98  * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined.
99  * @retval #kStatus_Timeout An invalid 5 A timeout occurred
100  * @retval #kStatus_NoTransferInProgress 6 No send in progress.
101  */
102 status_t EFUSE_Program(uint32_t addr, uint32_t data);
103 
104 /*@}*/
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 /*@}*/
111 
112 #endif /*! _FSL_EFUSE_H_ */
113