|
PebbleOS
|
One-time programmable slots holding factory data. More...
Enumerations | |
| enum | OtpWriteResult { OtpWriteSuccess = 0 , OtpWriteFailAlreadyWritten = 1 , OtpWriteFailCorrupt = 2 } |
| Result of otp_write_slot(). More... | |
Functions | |
| uint8_t * | otp_get_lock (const uint8_t index) |
| Get the lock byte of a slot. | |
| bool | otp_is_locked (const uint8_t index) |
| Check whether the OTP storage is locked. | |
| char * | otp_get_slot (const uint8_t index) |
| Read a slot. | |
| OtpWriteResult | otp_write_slot (const uint8_t index, const char *value) |
| Write a string to an unwritten slot. | |
One-time programmable slots holding factory data.
Each slot holds a NUL-terminated string of up to 31 characters, stored in a flash security register. A slot can be written once.
| enum OtpWriteResult |
Result of otp_write_slot().
| Enumerator | |
|---|---|
| OtpWriteSuccess | Slot written and verified. |
| OtpWriteFailAlreadyWritten | Slot already holds data. |
| OtpWriteFailCorrupt | Invalid slot or value, or the write could not be verified. |
| uint8_t * otp_get_lock | ( | const uint8_t | index | ) |
Get the lock byte of a slot.
| index | Slot index. |
| char * otp_get_slot | ( | const uint8_t | index | ) |
Read a slot.
| index | Slot index. |
| bool otp_is_locked | ( | const uint8_t | index | ) |
Check whether the OTP storage is locked.
Locking applies to the whole security register holding the slots.
| index | Slot index. |
| OtpWriteResult otp_write_slot | ( | const uint8_t | index, |
| const char * | value | ||
| ) |
Write a string to an unwritten slot.
| index | Slot index. |
| value | NUL-terminated string, at most 31 characters. |