/* Read Status Register. 
The RDSR instruction is for reading Status Register Bits. */
enum status_code mx25l_read_status(uint8_t *value)
/* Read Status Register. 
The RDSR instruction is for reading Status Register Bits. */
enum status_code mx25l_read_status(uint8_t *value)
{
	enum status_code status;
	uint8_t tx_buf[1] = {MX25L_CMD_RDSR};
	_mx25l_chip_select();
	status = spi_write_buffer_wait(&_mx25l_spi, tx_buf, 1);
	if (status != STATUS_OK) {
		return STATUS_ERR_IO;
	}
	status = spi_read_buffer_wait(&_mx25l_spi, value, 1, 0);
	if (status != STATUS_OK) {
		return STATUS_ERR_IO;
	}
	_mx25l_chip_deselect();
	return STATUS_OK;
}