Flash handler for M25P* chips with no Device ID.

Dependencies:   RTOS_SPI_Clean

Fork of flash25spi by Klaus Steinhammer

Files at this revision

API Documentation at this revision

Comitter:
Tomo2k
Date:
Sat Apr 26 11:52:28 2014 +0000
Parent:
5:3fe5c97a223b
Child:
7:fae78b14f38f
Commit message:
SPI format (8,3) - better clock LED. Fixed ARM-GCC warnings

Changed in this revision

flash25spi.cpp Show annotated file Show diff for this revision Revisions of this file
flash25spi.h Show annotated file Show diff for this revision Revisions of this file
--- a/flash25spi.cpp	Fri Apr 25 12:49:48 2014 +0000
+++ b/flash25spi.cpp	Sat Apr 26 11:52:28 2014 +0000
@@ -73,7 +73,7 @@
     , _enable(enable)
     , _size(0)
 {
-    _spi->format(8,0);
+    _spi->format(8,3);
 
     _enable = 1;
     wait_us(1000);
@@ -195,7 +195,7 @@
     return true;
 }
 
-void FlashM25PSpi::eraseSector(unsigned int addr)
+void FlashM25PSpi::eraseSector(uint32_t addr)
 {
     addr &= ~(_sectorSize-1);
 
@@ -236,7 +236,7 @@
 void FlashM25PSpi::waitForWrite()
 {
     while (true) {
-        if (0==readStatus()&1)
+        if (0 == (readStatus()&1))
             break;
         wait_us(10);
     }
--- a/flash25spi.h	Fri Apr 25 12:49:48 2014 +0000
+++ b/flash25spi.h	Sat Apr 26 11:52:28 2014 +0000
@@ -44,7 +44,7 @@
         Create the flash interface class.
         It will autodetect the Signature of your device. If your device is not recognized, add the devices parameters to the device data structure.
         @param spi the SPI port where the flash is connected. Must be set to speed matching your device.
-        Will automatically set it to format(8,0).
+        Will automatically set it to format(8,3).
         @param enable the pin name for the port where /CS is connected
     */
     FlashM25PSpi(SPI *spi, PinName enable);