Micron MT29F NAND driver
|
MT_uint8 NAND_Get_Feature | ( | flash_width | feature_address, |
flash_width * | subfeature | ||
) |
The GET FEATURES (EEh) command reads the subfeature parameters (P1–P4) from the specified feature address. This command is accepted by the target only when all die (LUNs) on the target are idle.
[in] | flash_width | feature_address: address of the feature (use ADDDR_FEATURE_XXXX define) |
[out] | flash_width,: | value of the selected feature |
NAND_SUCCESS | |
NAND_TIMEOUT |
Definition at line 448 of file nand_MT29F_lld.c.
References __wait_for_ready(), CMD_GET_FEATURE, parameter_page_t::command, device_info, driver_status, DRIVER_STATUS_INITIALIZED, DRIVER_STATUS_NOT_INITIALIZED, NAND_SUCCESS, NAND_UNSUPPORTED, OPTIONAL_CMD_GET_FEATURES_AND_SET_FEATURES, PLATFORM_Close(), PLATFORM_Open(), PLATFORM_ReadData(), PLATFORM_SendAddr(), PLATFORM_SendCmd(), PLATFORM_Wait(), and TIME_WB.
{ flash_width ret; /* verify if driver is initialized */ if(DRIVER_STATUS_INITIALIZED != driver_status) return DRIVER_STATUS_NOT_INITIALIZED; /* check if this feature/command is supported */ if ((device_info.command & OPTIONAL_CMD_GET_FEATURES_AND_SET_FEATURES) == 0) return NAND_UNSUPPORTED; /* init board transfer */ PLATFORM_Open(); /* send command and/or address */ PLATFORM_SendCmd(CMD_GET_FEATURE); PLATFORM_SendAddr(feature_address); /* wait (see datasheet for details) */ PLATFORM_Wait(TIME_WB); ret = __wait_for_ready(); /* return if timeout */ if (NAND_SUCCESS != ret) return ret; /* send sub-feature parameter */ *subfeature = PLATFORM_ReadData(); /* p0 */ /* * skip p1, p2 and p3 because they are reserved and their value are 00h */ /* close board transfer */ PLATFORM_Close(); return ret; }