Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: flash-fs-example Dragonfly_Filesystem_Example Dragonfly_Low_Power_Example STM32F407VET6_SPIFlash ... more
Diff: SpiFlash25.cpp
- Revision:
- 4:751745dd637f
- Parent:
- 3:b173ba8ad165
- Child:
- 5:31c110c2536c
--- 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); +}