SPI Flash AT45DBXXXD

Fork of at45db161d by Suga koubou

Revision:
3:82157896d90d
Parent:
0:2e953bbaf3a5
Child:
4:943690efda8b
--- a/at45db161d.h	Thu Mar 05 09:02:38 2015 +0800
+++ b/at45db161d.h	Thu Mar 05 18:07:15 2015 +0800
@@ -31,18 +31,18 @@
  * @defgroup SPI_Pinout SPI pinout
  * @{
  **/
-/** Serial input (SI) **/
-#define DATAOUT     11
-/** Serial output (SO) **/
-#define DATAIN      12
-/** Serial clock (SCK) **/
-#define SPICLOCK    13
-/** Chip select (CS) **/
-#define SLAVESELECT 10
-/** Reset (Reset) **/
-#define RESET        8
-/** Write protect (WP) **/
-#define WP           7
+///** Serial input (SI) **/
+//#define DATAOUT     11
+///** Serial output (SO) **/
+//#define DATAIN      12
+///** Serial clock (SCK) **/
+//#define SPICLOCK    13
+///** Chip select (CS) **/
+//#define SLAVESELECT 10
+///** Reset (Reset) **/
+//#define RESET        8
+///** Write protect (WP) **/
+//#define WP           7
 /**
  * @} 
  **/
@@ -106,7 +106,7 @@
  * configured for "power of 2" binary page size (512 bytes) (bit=1) or 
  * standard DataFlash page size (528 bytes) (bit=0).
  **/
-#define PAGE_SIZE 0x01
+//#define PAGE_SIZE 0x01
 /**
  * Bits 5, 4, 3 and 2 indicates the device density. The decimal value
  * of these four binary bits does not equate to the device density; the
@@ -187,6 +187,11 @@
          **/
         void ContinuousArrayRead(uint16_t page, uint16_t offset, uint8_t low);
 
+
+        void read(int addr, char *buf, int len) ;
+
+        void write(int addr, char *buf, int len) ;
+
         /** 
          * Read the content of one of the SRAM data buffers (in low or high speed mode).
          * @param bufferNum Buffer to read (1 or 2)
@@ -299,6 +304,9 @@
 
         SPI _spi;
         DigitalOut _cs;
+
+        uint16_t _bytes, _pages;
+
 };
 
 /**