target/linux/at91/image/dfboot/src/at45.c
/*-----------------------------------------------------------------------------
 * Function Name       : AT91F_DataFlashWaitReady
 * Object              : wait for dataflash ready (bit7 of the status register == 1)
 * Input Parameters    : DataFlash Service and timeout
 * Return value        : DataFlash status "ready or not"
 *-----------------------------------------------------------------------------
 */
Function Name       : AT91F_DataFlashWaitReady
Object              : wait for dataflash ready (bit7 of the status register == 1)
Input Parameters    : DataFlash Service and timeout
Return value        : DataFlash status "ready or not"
Function Name : AT91F_DataFlashWaitReady Object : wait for dataflash ready ( bit7 of the status register == 1 ) Input Parameters : DataFlash Service and timeout Return value : DataFlash status " ready or not "
static AT91S_DataFlashStatus AT91F_DataFlashWaitReady(
	AT91PS_DataflashDesc pDataFlashDesc,
	unsigned int timeout)
{
	pDataFlashDesc->DataFlash_state = IDLE;
        do {
                AT91F_DataFlashGetStatus(pDataFlashDesc);
                timeout--;
        }
        while(((pDataFlashDesc->DataFlash_state & 0x80) != 0x80) && (timeout > 0));
        if((pDataFlashDesc->DataFlash_state & 0x80) != 0x80)
                return AT91C_DATAFLASH_ERROR;
        return AT91C_DATAFLASH_OK;
}
static AT91S_DataFlashStatus AT91F_DataFlashWaitReady ( AT91PS_DataflashDesc pDataFlashDesc , unsigned int timeout ) { pDataFlashDesc -> DataFlash_state = IDLE ; do { AT91F_DataFlashGetStatus ( pDataFlashDesc ) ; timeout -- ; } while ( ( ( pDataFlashDesc -> DataFlash_state & 0x80 ) != 0x80 ) && ( timeout > 0 ) ) ; if ( ( pDataFlashDesc -> DataFlash_state & 0x80 ) != 0x80 ) return AT91C_DATAFLASH_ERROR ; return AT91C_DATAFLASH_OK ; }
Function Name       : AT91F_DataFlashWaitReady
 Object              : wait for dataflash ready (bit7 of the status register == 1)
 Input Parameters    : DataFlash Service and timeout
 Return value        : DataFlash status "ready or not"
Function Name : AT91F_DataFlashWaitReady Object : wait for dataflash ready ( bit7 of the status register == 1 ) Input Parameters : DataFlash Service and timeout Return value : DataFlash status " ready or not "