otp - OTP Operation Library#
Adapted Air780E/Air700E Air780EP/Air780EPV Air601 Air101/Air103 Air105
Note
This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!
Tip
This library has its own demo,click this link to view the demo example of otp
otp.read(zone, offset, len)#
Read specified OTP area Read data
Parameters
Incoming Value Type |
Explanation |
---|---|
int |
Region, usually 0/1/2/3, related to specific hardware |
int |
Offset |
int |
Read length, in bytes, must be a multiple of 4 and cannot exceed 4096 bytes. |
Return Value
return value type |
explanation |
---|---|
string |
Returns the string on success, otherwise nil |
Examples
local otpdata = otp.read(0, 0, 64)
if otpdata then
log.info("otp", otpdata:toHex())
end
otp.write(zone, data, offset)#
Writes data to the specified OTP area
Parameters
Incoming Value Type |
Explanation |
---|---|
int |
Region, usually 0/1/2/3, related to specific hardware |
string |
Data, length must be a multiple of 4 |
int |
Offset |
Return Value
return value type |
explanation |
---|---|
booL |
Returns true on success, otherwise false |
Examples
None
otp.erase(zone)#
Erase the specified OTP area
Parameters
Incoming Value Type |
Explanation |
---|---|
int |
Region, usually 0/1/2/3, related to specific hardware |
Return Value
return value type |
explanation |
---|---|
bool |
Returns true on success, otherwise false |
Examples
None
otp.lock(zone)#
Lock OTP area. Special attention!! Once locked, it cannot be unlocked and OTP becomes read-only.!!!
Parameters
None
Return Value
return value type |
explanation |
---|---|
bool |
Returns true on success, otherwise false |
Examples
None