2.4. eFuse API Reference¶
The eFuse API is located in the CIPHER module, providing the following APIs:
CVI_EFUSE_GetSize:Query the size of the eFuse area.
CVI_EFUSE_Read:Read eFuse area.
CVI_EFUSE_Write:Write to eFuse area.
CVI_EFUSE_EnableSecureBoot:Enable secure boot.
CVI_EFUSE_IsSecureBootEnabled:Query the secure boot status.
CVI_EFUSE_EnableFastBoot:Enable fast boot.
CVI_EFUSE_IsFastBootEnabled:Query the fast boot status.
CVI_EFUSE_Lock:Lock the eFuse area.
CVI_EFUSE_IsLocked:Query whether the eFuse area is locked.
2.4.1. CVI_EFUSE_GetSize¶
【Description】
Query the size of the eFuse area.
【Syntax】
CVI_S32 CVI_EFUSE_GetSize(CVI_EFUSE_AREA_E area, CVI_U32 *size);
【Parameter】
Parameter
Description
Input/Output
area
Specify eFuse area
Input
size
eFuse area size (unit: byte)
Output
【Return Value】
Return Value
Description
>= 0
Success
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.2. CVI_EFUSE_Read¶
【Description】
Read the eFuse area.
【Syntax】
CVI_S32 CVI_EFUSE_Read(CVI_EFUSE_AREA_E area, CVI_U8 *buf, CVI_U32 buf_size);
【Parameter】
Parameter
Description
Input/Output
area
Specify eFuse area
Input
buf
Used to store eFuse data
Output
buf_size
Buffer size (unit: byte)
Input
【Return Value】
Return Value
Description
>= 0
Success
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.3. CVI_EFUSE_Write¶
【Description】
Write to eFuse area.
【Syntax】
CVI_S32 CVI_EFUSE_Write(CVI_EFUSE_AREA_E area, const CVI_U8 *buf, CVI_U32 buf_size);
【Parameter】
Parameter
Description
Input/Output
area
Specify eFuse area
Input
buf
Data to write to eFuse
Input
buf_size
Buffer size (unit: byte)
Input
【Return Value】
Return Value
Description
>= 0
Success
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.4. CVI_EFUSE_EnableSecureBoot¶
【Description】
Enable secure boot.
【Syntax】
CVI_S32 CVI_EFUSE_EnableSecureBoot(void);
【Parameter】
None.
【Return Value】
Return Value
Description
>= 0
Success
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.5. CVI_EFUSE_IsSecureBootEnabled¶
【Description】
Query the secure boot status.
【Syntax】
CVI_S32 CVI_EFUSE_IsSecureBootEnabled(void);
【Parameter】
None.
【Return Value】
Return Value
Description
> 0
Secure boot is enabled
0
Secure boot is not enabled
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.6. CVI_EFUSE_EnableFastBoot¶
【Description】
Enable fast boot.
【Syntax】
CVI_S32 CVI_EFUSE_EnableFastBoot(void);
【Parameter】
None.
【Return Value】
Return Value
Description
0
Fast boot enabled
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libsys.a
- 【Note】
None.
- 【Example】
Refer to
sample_fastboot.c
。
Attention
Cannot be changed after the fast boot is enabled.
2.4.7. CVI_EFUSE_IsFastBootEnabled¶
【Description】
Query the fast boot status.
【Syntax】
CVI_S32 CVI_EFUSE_IsFastBootEnabled(void);
【Parameter】
None.
【Return Value】
Return Value
Description
0
Fast boot enabled
< 0
Fast boot not enabled
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libsys.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.8. CVI_EFUSE_Lock¶
【Description】
Lock the eFuse area.
【Syntax】
CVI_S32 CVI_EFUSE_Lock(CVI_EFUSE_LOCK_E lock);
【Parameter】
Parameter
Description
Input/Output
area
Specify the eFuse area to lock
Input
【Return Value】
Return Value
Description
>= 0
The specified eFuse partition is locked.
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。
2.4.9. CVI_EFUSE_IsLocked¶
【Description】
Query whether the eFuse area is locked.
【Syntax】
CVI_S32 CVI_EFUSE_IsLocked(CVI_EFUSE_LOCK_E lock);
【Parameter】
Parameter
Description
Input/Output
area
Specify the eFuse area to lock
Input
【Return Value】
Return Value
Description
> 0
The specified eFuse partition is locked.
0
The specified eFuse partition has not been locked.
< 0
Failure, see error code.
- 【Requirement】
Header files:cvi_type.h cvi_unf_cipher.h
Library files:libcipher.a
- 【Note】
None.
- 【Example】
Refer to
sample_efuse.c
。