otp - OTP Operation Library#

Adapted Air780E Air780EP Air780EPS Air201

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

----------------------------
--- This library has been abandoned, do not use ---
----------------------------

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