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: BLE_LoopbackUART_low_pwr_w_RTC1 BLE_Uart_Server
Revision 1:cc54cd1df555, committed 2016-06-11
- Comitter:
- kenjiArai
- Date:
- Sat Jun 11 00:52:47 2016 +0000
- Parent:
- 0:f50677171f2d
- Commit message:
- added power off for peripheral functions
Changed in this revision
| nRF51_WakeUp.cpp | Show annotated file Show diff for this revision Revisions of this file |
| nRF51_WakeUp.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/nRF51_WakeUp.cpp Sat Apr 02 06:19:14 2016 +0000
+++ b/nRF51_WakeUp.cpp Sat Jun 11 00:52:47 2016 +0000
@@ -6,7 +6,7 @@
* http://www.page.sannet.ne.jp/kenjia/index.html
* http://mbed.org/users/kenjiArai/
* Created: March 24th, 2016
- * Revised: April 2nd, 2016
+ * Revised: June 11th, 2016
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -64,18 +64,56 @@
NRF_RTC1->TASKS_START = 1;
nrf_delay_us(MAX_RTC_TASKS_DELAY);
//----- Goto Deep Sleep mode --------------------------
- NRF_RADIO->POWER = 0;
- NRF_UART0->POWER = 0;
- NRF_RADIO->POWER = 0;
- NRF_SPI0->POWER = 0;
- NRF_SPI1->POWER = 0;
- NRF_TWI0->POWER = 0;
- NRF_TWI1->POWER = 0;
- NRF_POWER->RAMON =
- POWER_RAMON_ONRAM0_RAM0On << POWER_RAMON_ONRAM0_Pos
- | POWER_RAMON_ONRAM1_RAM1On << POWER_RAMON_ONRAM1_Pos
- | POWER_RAMON_OFFRAM0_RAM0Off << POWER_RAMON_OFFRAM0_Pos
- | POWER_RAMON_OFFRAM1_RAM1Off << POWER_RAMON_OFFRAM1_Pos;
+ // RADIO
+ NRF_RADIO->POWER = 0;
+ nrf_delay_us(5);
+ // UART
+ NRF_UART0->POWER = 0;
+ nrf_delay_us(5);
+ // I2C
+ NRF_TWI1->POWER = 0;
+ nrf_delay_us(5);
+ // SPI
+ NRF_SPI0->POWER = 0;
+ nrf_delay_us(5);
+ NRF_SPI1->POWER = 0;
+ nrf_delay_us(5);
+ NRF_SPIS1->POWER = 0;
+ nrf_delay_us(5);
+ // PWM(Timer0,1,2)
+ NRF_TIMER0->POWER = 0;
+ nrf_delay_us(5);
+ NRF_TIMER1->POWER = 0;
+ nrf_delay_us(5);
+ NRF_TIMER2->POWER = 0;
+ nrf_delay_us(5);
+ // PPI (use CH[0])
+ NRF_PPI->TASKS_CHG[1].DIS = 1;
+ NRF_PPI->TASKS_CHG[2].DIS = 1;
+ NRF_PPI->TASKS_CHG[3].DIS = 1;
+ for (uint8_t n = 1; n <16 ; n++){
+ NRF_PPI->CH[n].TEP = 0;
+ NRF_PPI->CH[n].EEP = 0;
+ }
+ // ADC
+ NRF_ADC->POWER = 0;
+ nrf_delay_us(5);
+ // Temperature senosr
+ NRF_TEMP->TASKS_STOP = 1;
+ nrf_delay_us(5);
+ // Others
+ NRF_RNG->POWER = 0;
+ NRF_ECB->POWER = 0;
+ NRF_AAR->POWER = 0;
+ NRF_CCM->POWER = 0;
+ NRF_WDT->POWER = 0;
+ NRF_QDEC->POWER = 0;
+ NRF_LPCOMP->POWER = 0;
+ // Cock & Power
+ NRF_CLOCK->TASKS_HFCLKSTOP = 1;
+ NRF_POWER->DCDCEN = 0;
+ //sd_power_system_off();
+ //NRF_POWER->SYSTEMOFF = POWER_SYSTEMOFF_SYSTEMOFF_Enter;
while(true){
deepsleep();
}
--- a/nRF51_WakeUp.h Sat Apr 02 06:19:14 2016 +0000 +++ b/nRF51_WakeUp.h Sat Jun 11 00:52:47 2016 +0000 @@ -9,7 +9,7 @@ * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Created: March 24th, 2016 - * Revised: April 2nd, 2016 + * Revised: June 11th, 2016 * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE