ISSI IS25LQ032B 3V-Quad Serial Flash Memory with Multi-I/O SPI

Dependents:   testSPI_IS25LQ032B SPI_Flash_erase

SPI Flash Memory ISSI IS25LQ032B library.

Although the device has lots of features, only a small portion of commands were implemented. (sorry)

For the data sheet please refer to http://www.issi.com/WW/pdf/25LQ080B-016B-032B.pdf

Revision:
0:3f3dd929e3e5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SPI_IS25LQ032B.h	Thu Dec 25 00:46:17 2014 +0000
@@ -0,0 +1,67 @@
+#ifndef _SPI_IS25LQ032B_H_
+#define _SPI_IS25LQ032B_H_
+
+#include "mbed.h"
+
+/** SPI_IS25LQ032B ISSI 3V-QUAD SERIAL FLASH MEMORY MULTI-I/O SPI
+ * Data Sheet: http://www.issi.com/WW/pdf/25LQ080B-016B-032B.pdf
+ */
+
+class SPI_IS25LQ032B 
+{
+public:
+/**
+ * ISSI 3V-QUAD SERIAL FLASH MEMORY MULTI-I/O SPI constructor
+ *
+ * @param mosi SPI_MOSI pin
+ * @param miso SPI_MISO pin
+ * @param sclk SPI_CLK pin
+ * @param cs   SPI_CS  pin
+ */
+ SPI_IS25LQ032B(PinName mosi, PinName miso, PinName sclk, PinName cs) ;
+ 
+/// Destructor
+ ~SPI_IS25LQ032B() ;
+ 
+/// write enable 
+  void writeEnable(void) ;
+  
+/// write disable 
+  void writeDisable(void) ;
+ 
+/// read status register
+  uint8_t readStatus(void) ;
+
+/** write status register
+ *
+ * @param uint8_t newStatus new register value
+ */
+  void writeStatus(uint8_t newStatus) ;
+
+/// read function register
+  uint8_t readFunc(void) ;
+
+/// write fucntion register
+  void writeFunc(uint8_t newValue) ;
+
+/** program page
+ *
+ * @param int addr start address
+ * @param uint8_t *data data buffer address
+ * @param int numData number of data to be written (max 256)
+ */
+  void programPage(int addr, uint8_t *data, int numData) ;
+
+/// chip erase
+  void chipErase(void) ;
+
+  uint8_t read8(int addr) ;
+  void write8(int addr, uint8_t data) ;
+  
+ SPI m_spi;
+ DigitalOut m_cs ;
+ int _mode ;
+ 
+private:
+} ;
+#endif // _SPI_IS25LQ032B_H_
\ No newline at end of file