/* Read AT25DF321 manufacturer and device ID, check the density.  */
static bool spi_at25df_mem_check(void)
/* Read AT25DF321 manufacturer and device ID, check the density.  */
static bool spi_at25df_mem_check(void)
{
	spi_select_device(SPI_EXAMPLE, &SPI_DEVICE_EXAMPLE);
	spi_write_packet(SPI_EXAMPLE, data, 1);
	spi_read_packet(SPI_EXAMPLE, data, DATA_BUFFER_SIZE);
	spi_deselect_device(SPI_EXAMPLE, &SPI_DEVICE_EXAMPLE);
	if ((data[1] & AT25DF_MSK_DENSITY) < AT25DF_DENSITY) {
		return false;
	} else {
		return true;
	}
}