RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Enumerator
Ocotp

Driver version

enum  {
  kStatus_OCOTP_AccessError = MAKE_STATUS(kStatusGroup_SDK_OCOTP, 0) , kStatus_OCOTP_CrcFail = MAKE_STATUS(kStatusGroup_SDK_OCOTP, 1) , kStatus_OCOTP_ReloadError , kStatus_OCOTP_ProgramFail = MAKE_STATUS(kStatusGroup_SDK_OCOTP, 3) ,
  kStatus_OCOTP_Locked = MAKE_STATUS(kStatusGroup_SDK_OCOTP, 4)
}
 _ocotp_status Error codes for the OCOTP driver. More...
 
void OCOTP_Init (OCOTP_Type *base, uint32_t srcClock_Hz)
 Initializes OCOTP controller.
 
void OCOTP_Deinit (OCOTP_Type *base)
 De-initializes OCOTP controller.
 
status_t OCOTP_ReloadShadowRegister (OCOTP_Type *base)
 Reload the shadow register. This function will help reload the shadow register without reseting the OCOTP module. Please make sure the OCOTP has been initialized before calling this API.
 
uint32_t OCOTP_ReadFuseShadowRegister (OCOTP_Type *base, uint32_t address)
 Read the fuse shadow register with the fuse addess.
 
status_t OCOTP_ReadFuseShadowRegisterExt (OCOTP_Type *base, uint32_t address, uint32_t *data, uint8_t fuseWords)
 Read the fuse shadow register from the fuse addess.
 
status_t OCOTP_WriteFuseShadowRegister (OCOTP_Type *base, uint32_t address, uint32_t data)
 Write the fuse shadow register with the fuse addess and data. Please make sure the wrtie address is not locked while calling this API.
 
status_t OCOTP_WriteFuseShadowRegisterWithLock (OCOTP_Type *base, uint32_t address, uint32_t data, bool lock)
 Write the fuse shadow register and lock it.
 
#define FSL_OCOTP_DRIVER_VERSION   (MAKE_VERSION(2, 1, 3))
 OCOTP driver version.
 
#define OCOTP_READ_FUSE_DATA_COUNT   (1U)
 

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

_ocotp_status Error codes for the OCOTP driver.

Enumerator
kStatus_OCOTP_AccessError 

eFuse and shadow register access error.

kStatus_OCOTP_CrcFail 

CRC check failed.

kStatus_OCOTP_ReloadError 

Error happens during reload shadow register.

kStatus_OCOTP_ProgramFail 

Fuse programming failed.

kStatus_OCOTP_Locked 

Fuse is locked and cannot be programmed.

Function Documentation

◆ OCOTP_Deinit()

void OCOTP_Deinit ( OCOTP_Type base)

De-initializes OCOTP controller.

Return values
kStatus_Successupon successful execution, error status otherwise.

◆ OCOTP_Init()

void OCOTP_Init ( OCOTP_Type base,
uint32_t  srcClock_Hz 
)

Initializes OCOTP controller.

Parameters
baseOCOTP peripheral base address.
srcClock_Hzsource clock frequency in unit of Hz. When the macro FSL_FEATURE_OCOTP_HAS_TIMING_CTRL is defined as 0, this parameter is not used, application could pass in 0 in this case.

◆ OCOTP_ReadFuseShadowRegister()

uint32_t OCOTP_ReadFuseShadowRegister ( OCOTP_Type base,
uint32_t  address 
)

Read the fuse shadow register with the fuse addess.

Deprecated:
Use OCOTP_ReadFuseShadowRegisterExt instead of this function.
Parameters
baseOCOTP peripheral base address.
addressthe fuse address to be read from.
Returns
The read out data.

◆ OCOTP_ReadFuseShadowRegisterExt()

status_t OCOTP_ReadFuseShadowRegisterExt ( OCOTP_Type base,
uint32_t  address,
uint32_t *  data,
uint8_t  fuseWords 
)

Read the fuse shadow register from the fuse addess.

This function reads fuse from address, how many words to read is specified by the parameter fuseWords. This function could read at most OCOTP_READ_FUSE_DATA_COUNT fuse word one time.

Parameters
baseOCOTP peripheral base address.
addressthe fuse address to be read from.
dataData array to save the readout fuse value.
fuseWordsHow many words to read.
Return values
kStatus_SuccessRead success.
kStatus_FailError occurs during read.

◆ OCOTP_ReloadShadowRegister()

status_t OCOTP_ReloadShadowRegister ( OCOTP_Type base)

Reload the shadow register. This function will help reload the shadow register without reseting the OCOTP module. Please make sure the OCOTP has been initialized before calling this API.

Parameters
baseOCOTP peripheral base addess.
Return values
kStatus_SuccessReload success.
kStatus_OCOTP_ReloadErrorReload failed.

◆ OCOTP_WriteFuseShadowRegister()

status_t OCOTP_WriteFuseShadowRegister ( OCOTP_Type base,
uint32_t  address,
uint32_t  data 
)

Write the fuse shadow register with the fuse addess and data. Please make sure the wrtie address is not locked while calling this API.

Parameters
baseOCOTP peripheral base address.
addressthe fuse address to be written.
datathe value will be writen to fuse address.
Return values
writestatus, kStatus_Success for success and kStatus_Fail for failed.

◆ OCOTP_WriteFuseShadowRegisterWithLock()

status_t OCOTP_WriteFuseShadowRegisterWithLock ( OCOTP_Type base,
uint32_t  address,
uint32_t  data,
bool  lock 
)

Write the fuse shadow register and lock it.

Please make sure the wrtie address is not locked while calling this API.

Some OCOTP controller supports ECC mode and redundancy mode (see reference mananual for more details). OCOTP controller will auto select ECC or redundancy mode to program the fuse word according to fuse map definition. In ECC mode, the 32 fuse bits in one word can only be written once. In redundancy mode, the word can be written more than once as long as they are different fuse bits. Set parameter lock as true to force use ECC mode.

Parameters
baseOCOTP peripheral base address.
addressThe fuse address to be written.
dataThe value will be writen to fuse address.
lockLock or unlock write fuse shadow register operation.
Return values
kStatus_SuccessProgram and reload success.
kStatus_OCOTP_LockedThe eFuse word is locked and cannot be programmed.
kStatus_OCOTP_ProgramFaileFuse word programming failed.
kStatus_OCOTP_ReloadErroreFuse word programming success, but error happens during reload the values.
kStatus_OCOTP_AccessErrorCannot access eFuse word.