MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the OTP module of MCUXpresso SDK devices.
Main clock has to be set to a frequency stated in user manual prior to using OTP driver. OTP memory is manipulated by calling provided API stored in ROM. MCUXpresso SDK driver encapsulates this.
This example shows how to write to OTP.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/otp
Enumerations | |
enum | otp_bank_t { kOTP_Bank0 = 0x1U, kOTP_Bank1 = 0x2U, kOTP_Bank2 = 0x4U, kOTP_Bank3 = 0x8U } |
Bank bit flags. More... | |
enum | otp_word_t { kOTP_Word0 = 0x1U, kOTP_Word1 = 0x2U, kOTP_Word2 = 0x4U, kOTP_Word3 = 0x8U } |
Bank word bit flags. More... | |
enum | otp_lock_t { kOTP_LockDontLock = 0U, kOTP_LockLock = 1U } |
Lock modifications of a read or write access to a bank register. More... | |
enum | _otp_status { kStatus_OTP_WrEnableInvalid = MAKE_STATUS(kStatusGroup_OTP, 0x1U), kStatus_OTP_SomeBitsAlreadyProgrammed = MAKE_STATUS(kStatusGroup_OTP, 0x2U), kStatus_OTP_AllDataOrMaskZero = MAKE_STATUS(kStatusGroup_OTP, 0x3U), kStatus_OTP_WriteAccessLocked = MAKE_STATUS(kStatusGroup_OTP, 0x4U), kStatus_OTP_ReadDataMismatch = MAKE_STATUS(kStatusGroup_OTP, 0x5U), kStatus_OTP_UsbIdEnabled = MAKE_STATUS(kStatusGroup_OTP, 0x6U), kStatus_OTP_EthMacEnabled = MAKE_STATUS(kStatusGroup_OTP, 0x7U), kStatus_OTP_AesKeysEnabled = MAKE_STATUS(kStatusGroup_OTP, 0x8U), kStatus_OTP_IllegalBank = MAKE_STATUS(kStatusGroup_OTP, 0x9U), kStatus_OTP_ShufflerConfigNotValid = MAKE_STATUS(kStatusGroup_OTP, 0xAU), kStatus_OTP_ShufflerNotEnabled = MAKE_STATUS(kStatusGroup_OTP, 0xBU), kStatus_OTP_ShufflerCanOnlyProgSingleKey, kStatus_OTP_IllegalProgramData = MAKE_STATUS(kStatusGroup_OTP, 0xCU), kStatus_OTP_ReadAccessLocked = MAKE_STATUS(kStatusGroup_OTP, 0xDU) } |
OTP error codes. More... | |
Functions | |
static status_t | OTP_Init (void) |
Initializes OTP controller. More... | |
static status_t | OTP_EnableBankWriteMask (otp_bank_t bankMask) |
Unlock one or more OTP banks for write access. More... | |
static status_t | OTP_DisableBankWriteMask (otp_bank_t bankMask) |
Lock one or more OTP banks for write access. More... | |
static status_t | OTP_EnableBankWriteLock (uint32_t bankIndex, otp_word_t regEnableMask, otp_word_t regDisableMask, otp_lock_t lockWrite) |
Locks or unlocks write access to a register of an OTP bank and possibly lock un/locking of it. More... | |
static status_t | OTP_EnableBankReadLock (uint32_t bankIndex, otp_word_t regEnableMask, otp_word_t regDisableMask, otp_lock_t lockWrite) |
Locks or unlocks read access to a register of an OTP bank and possibly lock un/locking of it. More... | |
static status_t | OTP_ProgramRegister (uint32_t bankIndex, uint32_t regIndex, uint32_t value) |
Program a single register in an OTP bank. More... | |
static uint32_t | OTP_GetDriverVersion (void) |
Returns the version of the OTP driver in ROM. More... | |
Driver version | |
#define | FSL_OTP_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
OTP driver version 2.0.0. More... | |
#define FSL_OTP_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Current version: 2.0.0
Change log:
enum otp_bank_t |
enum otp_word_t |
enum otp_lock_t |
enum _otp_status |
|
inlinestatic |
|
inlinestatic |
bankMask | bit flag that specifies which banks to unlock. |
|
inlinestatic |
bankMask | bit flag that specifies which banks to lock. |
|
inlinestatic |
bankIndex | OTP bank index, 0 = bank 0, 1 = bank 1 etc. |
regEnableMask | bit flag that specifies for which words to enable writing. |
regDisableMask | bit flag that specifies for which words to disable writing. |
lockWrite | specifies if access set can be modified or is locked till reset. |
|
inlinestatic |
bankIndex | OTP bank index, 0 = bank 0, 1 = bank 1 etc. |
regEnableMask | bit flag that specifies for which words to enable reading. |
regDisableMask | bit flag that specifies for which words to disable reading. |
lockWrite | specifies if access set can be modified or is locked till reset. |
|
inlinestatic |
bankIndex | OTP bank index, 0 = bank 0, 1 = bank 1 etc. |
regIndex | OTP register index. |
value | value to write. |
|
inlinestatic |