Deep power-down mode example program.
LPC810のDeep power-downモードのテストプログラム。
LEDが消灯している時間はDeep power-downモードで作っています。
Warning
Deep power-downモードではリセットピンによるリセットは効きません。
フラッシュ書き込みにはISPモード(nISP=L)でパワーオンリセットして下さい。
main.cpp
- Committer:
- va009039
- Date:
- 2014-08-27
- Revision:
- 1:de1ba63f90b8
- Parent:
- 0:843a94215f82
File content as of revision 1:de1ba63f90b8:
#include "mbed.h" #include "DeepPowerDown.h" // LPC810 pinout #define dp1 P0_5 // nRESET #define dp2 P0_4 // WAKEUP #define dp3 // SWCLK #define dp4 // SWDIO #define dp5 P0_1 // nISP #define dp6 // VIN #define dp7 // GND #define dp8 P0_0 DigitalOut led1(dp8); int main() { led1 = 1; wait_ms(10); led1 = 0; int ms = 150; int cnt = DeepPowerDown::getData0(); if (++cnt >= 4) { cnt = 0; ms = 1500; // 1.5sec } DeepPowerDown::setData0(cnt); DeepPowerDown::wakeupTimer_ms(ms); DeepPowerDown::wakeupPin(false); DeepPowerDown::entry(); /* NOTREACHED */ }