SpiFlash25
Fork of SpiFlash25 by
Revision 4:751745dd637f, committed 2015-06-08
- Comitter:
- Mike Fiore
- Date:
- Mon Jun 08 15:52:34 2015 -0500
- Parent:
- 3:b173ba8ad165
- Commit message:
- add sleep changes from git repo
Changed in this revision
SpiFlash25.cpp | Show annotated file Show diff for this revision Revisions of this file |
SpiFlash25.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SpiFlash25.cpp Mon Dec 15 16:35:47 2014 -0600 +++ b/SpiFlash25.cpp Mon Jun 08 15:52:34 2015 -0500 @@ -27,6 +27,9 @@ _cs(cs), _page_size(page_size) { + + wakeup(); + _cs.write(1); _spi.format(8, 3); _spi.frequency(75000000); @@ -172,3 +175,15 @@ wait_us(10); } } + +void SpiFlash25::deep_power_down() { + _cs.write(0); + _spi.write(DEEP_POWER_DOWN); + _cs.write(1); +} + +void SpiFlash25::wakeup() { + _cs.write(0); + _spi.write(DEEP_POWER_DOWN_RELEASE); + _cs.write(1); +}
--- a/SpiFlash25.h Mon Dec 15 16:35:47 2014 -0600 +++ b/SpiFlash25.h Mon Jun 08 15:52:34 2015 -0500 @@ -48,6 +48,9 @@ void clear_sector(int addr); void clear_mem(); + void deep_power_down(); + void wakeup(); + private: enum { WRITE_ENABLE = 0x06,