2.4. eFuse API Reference¶
The eFuse API is in the EFUSE module and provides the following APIs:
CVI_EFUSE_GetSize: Query the size of an eFuse area.
CVI_EFUSE_Read: Read an eFuse area.
CVI_EFUSE_Write:Write an eFuse area.
CVI_EFUSE_EnableSecureBoot: Enable Secure Boot.
CVI_EFUSE_IsSecureBootEnabled: Query Secure Boot status.
CVI_EFUSE_EnableFastBoot: Enable Fast Boot.
CVI_EFUSE_IsFastBootEnabled: Query Fast Boot status.
CVI_EFUSE_Lock: Lock an eFuse area.
CVI_EFUSE_IsLocked: Query whether an eFuse area is locked.
CVI_EFUSE_LockWrite: Lock writes to an eFuse area.
CVI_EFUSE_IsWriteLocked: Query whether writes to an eFuse area are locked.
2.4.1. CVI_EFUSE_GetSize¶
[Description]
Query the size of an eFuse area.
Syntax
CVI_S32 CVI_EFUSE_GetSize(CVI_EFUSE_AREA_E area, CVI_U32 *size);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area |
Input |
size |
eFusearea size (Unit: bytes) |
Output |
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
Success |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.2. CVI_EFUSE_Read¶
[Description]
Read an eFuse area.
Syntax
CVI_S32 CVI_EFUSE_Read(CVI_EFUSE_AREA_E area, CVI_U8 *buf, CVI_U32 buf_size);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area |
Input |
buf |
Storage for eFuse data |
Output |
buf_size |
Data length (unit: bytes) |
Input |
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
Success |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.3. CVI_EFUSE_Write¶
[Description]
Write an eFuse area.
Syntax
CVI_S32 CVI_EFUSE_Write(CVI_EFUSE_AREA_E area, const CVI_U8 *buf, CVI_U32 buf_size);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area |
Input |
buf |
Data to write to eFuse |
Input |
buf_size |
Data length (unit: bytes) |
Input |
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
Success |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.4. CVI_EFUSE_EnableSecureBoot¶
[Description]
Enable Secure Boot.
Syntax
CVI_S32 CVI_EFUSE_EnableSecureBoot(void);
[Parameters]
None.
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
Secure Boot enabled |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.5. CVI_EFUSE_IsSecureBootEnabled¶
[Description]
Determine whether Secure Boot is enabled.
Syntax
CVI_S32 CVI_EFUSE_IsSecureBootEnabled(void);
[Parameters]
None.
[Return Value]
Return Value |
Description |
|---|---|
> 0 |
Secure Boot enabled |
0 |
Secure Boot not enabled |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.6. CVI_EFUSE_EnableFastBoot¶
[Description]
Enable Fast Boot.
Syntax
CVI_S32 CVI_EFUSE_EnableFastBoot(void);
[Parameters]
None.
[Return Value]
Return Value |
Description |
|---|---|
0 |
Fast Boot enabled |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_fastboot.c.
Note
Fast Boot cannot be changed after it is enabled
2.4.7. CVI_EFUSE_IsFastBootEnabled¶
[Description]
Determine whether Fast Boot is enabled.
Syntax
CVI_S32 CVI_EFUSE_IsFastBootEnabled(void);
[Parameters]
None.
[Return Value]
Return Value |
Description |
|---|---|
0 |
Fast Boot enabled |
< 0 |
Fast Boot not enabled |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.8. CVI_EFUSE_Lock¶
[Description]
Lock an eFuse area.
Syntax
CVI_S32 CVI_EFUSE_Lock(CVI_EFUSE_LOCK_E lock);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area to lock |
Input |
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
The specified eFuse partition is locked |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.9. CVI_EFUSE_IsLocked¶
[Description]
Query whether an eFuse area is locked.
Syntax
CVI_S32 CVI_EFUSE_IsLocked(CVI_EFUSE_LOCK_E lock);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area to lock |
Input |
[Return Value]
Return Value |
Description |
|---|---|
> 0 |
The specified eFuse partition is locked |
0 |
The specified eFuse partition is not locked |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.10. CVI_EFUSE_LockWrite¶
[Description]
Lock writes to an eFuse area.
Syntax
CVI_S32 CVI_EFUSE_LockWrite(CVI_EFUSE_LOCK_E lock);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area whose writes are to be locked |
Input |
[Return Value]
Return Value |
Description |
|---|---|
>= 0 |
Writes to the specified eFuse partition are locked |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.
2.4.11. CVI_EFUSE_IsWriteLocked¶
[Description]
Query whether writes to an eFuse area are locked.
Syntax
CVI_S32 CVI_EFUSE_IsWriteLocked(CVI_EFUSE_LOCK_E lock);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
area |
Specified eFuse area whose writes are to be locked |
Input |
[Return Value]
Return Value |
Description |
|---|---|
> 0 |
The specified eFuse partition is write-locked |
0 |
The specified eFuse partition is not write-locked |
< 0 |
See the error codes |
Requirements
Header files: cvi_type.h cvi_efuse.h
Library file: libefuse.a
[Note]
None.
[Example]
Reference
sample_efuse.c.