stat = spi_sendRecv(DFO_READ_STATUS);
stat = spi_sendRecv(0x00);
+ /*
+ * Note: this function could be call one more time
+ * to check register status (es. check if memory has been
+ * teminate one operation), and so we don't disable CS to
+ * allow fast reading of register status.
+ */
return stat;
}
static uint8_t dataflash_cmd(dataflash_t page_addr, dataflashOffset_t byte_addr, DataFlashOpcode opcode)
{
+ uint8_t stat;
+
send_cmd(page_addr, byte_addr, opcode);
CS_TOGGLE();
*/
while(!(dataflash_stat() & BUSY_BIT));
- return (dataflash_stat());
+ stat = dataflash_stat();
+
+ /*
+ * Data flash has been terminate a sent command, and so
+ * disable CS.
+ */
+ CS_DISABLE();
+
+ return (stat);
}
spi_sendRecv(0x00); //Send 8 don't care bit.
data = spi_sendRecv(0x00); //Read byte.
+
CS_DISABLE();
return data;
static void dataflash_loadPage(dataflash_t page_addr)
{
dataflash_cmd(page_addr, 0x00, DFO_MOV_MEM_TO_BUFF1);
-
- CS_DISABLE();
}
/**
{
dataflash_cmd(previous_page, 0x00, DFO_WRITE_BUFF1_TO_MEM_E);
- CS_DISABLE();
page_modified = false;
kprintf("\n::=> Flush page:... <%ld>\n", previous_page);