/* Erase whole chip memory with build-in erase program.  */
void AT45DB161_EraseChip()
/* Erase whole chip memory with build-in erase program.  */
void AT45DB161_EraseChip()
{
    if(AT45DB161_WaitReady() == 0)return;
    AT45DB161_CS = 0;
    xSPIDataWrite(AT45DB161_SPI_PORT, AT45DB161_CMD_CPER, 4);
    AT45DB161_CS = 1;
}