static void IsWriteInProgress(void) { volatile unsigned char temp = 0; do { temp = FlashStatusRead(); }while(temp & WRITE_IN_PROGRESS); }
/* ** This function will check whether flash is busy with any operation like ** read, write, sector erase. */ static void IsFlashBusy(void) { unsigned char temp = 0; do { temp = FlashStatusRead(); } while(temp & IS_FLASH_BUSY); }
/* ** This function will check whether write enable command is successfully ** latched on to flash or not. */ static void IsWriteEnabled(void) { unsigned char temp = 0; do { /* Read the status from flash */ temp = FlashStatusRead(); } while(!(temp & WRITE_EN_LATCHED)); }
static unsigned int IsWriteEnabled(void) { volatile unsigned char temp = 0; unsigned int retVal = FALSE; /* Reading the Status Register of SPI Flash. */ temp = FlashStatusRead(); if (temp & WRITE_ENABLE_LATCH) { retVal = TRUE; } return retVal; }