Micron MT29F NAND driver
|
MT_uint8 NAND_OTP_Mode_Exit | ( | void | ) |
This function is used to exit the OTP mode. Only after the issue of this command user can use the standard functions to read/program/erase the NAND.
[in] | none |
Definition at line 1518 of file nand_MT29F_lld.c.
References ADDR_FEATURE_ARRAY_OPMODE, driver_status, DRIVER_STATUS_INITIALIZED, DRIVER_STATUS_NOT_INITIALIZED, FEATURE_ARRAY_NORMAL, FEATURE_ARRAY_OTP_OPERATION, FEATURE_ARRAY_OTP_PROTECTION, NAND_GENERIC_FAIL, NAND_Get_Feature(), NAND_Set_Feature(), and NAND_SUCCESS.
{ MT_uint8 ret; flash_width subfeature; /* check if driver is in a valid state */ if(DRIVER_STATUS_INITIALIZED != driver_status) return DRIVER_STATUS_NOT_INITIALIZED; /* check if device is NOT in normal status */ ret = NAND_Get_Feature(ADDR_FEATURE_ARRAY_OPMODE, &subfeature); if((FEATURE_ARRAY_OTP_OPERATION != subfeature) && (FEATURE_ARRAY_OTP_PROTECTION != subfeature)) return NAND_GENERIC_FAIL; /* exit OTP status */ ret = NAND_Set_Feature(ADDR_FEATURE_ARRAY_OPMODE, FEATURE_ARRAY_NORMAL); /* return with error if a fail occurs */ if(NAND_SUCCESS != ret) return ret; /* check if device is in normal status */ ret = NAND_Get_Feature(ADDR_FEATURE_ARRAY_OPMODE, &subfeature); /* return with error if a fail occurs */ if(NAND_SUCCESS != ret) return ret; if(FEATURE_ARRAY_NORMAL != subfeature) return NAND_GENERIC_FAIL; return NAND_SUCCESS; }