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.
FinalVersionECISsystem/mbed/hal/sleep_api.h@1:45dc700211a7, 2019-12-12 (annotated)
- Committer:
- priyank12p
- Date:
- Thu Dec 12 01:27:12 2019 +0000
- Revision:
- 1:45dc700211a7
- Parent:
- 0:b0c4c25d37ab
Minor changes
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| priyank12p | 0:b0c4c25d37ab | 1 | |
| priyank12p | 0:b0c4c25d37ab | 2 | /** \addtogroup hal */ | 
| priyank12p | 0:b0c4c25d37ab | 3 | /** @{*/ | 
| priyank12p | 0:b0c4c25d37ab | 4 | /* mbed Microcontroller Library | 
| priyank12p | 0:b0c4c25d37ab | 5 | * Copyright (c) 2006-2013 ARM Limited | 
| priyank12p | 0:b0c4c25d37ab | 6 | * | 
| priyank12p | 0:b0c4c25d37ab | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
| priyank12p | 0:b0c4c25d37ab | 8 | * you may not use this file except in compliance with the License. | 
| priyank12p | 0:b0c4c25d37ab | 9 | * You may obtain a copy of the License at | 
| priyank12p | 0:b0c4c25d37ab | 10 | * | 
| priyank12p | 0:b0c4c25d37ab | 11 | * http://www.apache.org/licenses/LICENSE-2.0 | 
| priyank12p | 0:b0c4c25d37ab | 12 | * | 
| priyank12p | 0:b0c4c25d37ab | 13 | * Unless required by applicable law or agreed to in writing, software | 
| priyank12p | 0:b0c4c25d37ab | 14 | * distributed under the License is distributed on an "AS IS" BASIS, | 
| priyank12p | 0:b0c4c25d37ab | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
| priyank12p | 0:b0c4c25d37ab | 16 | * See the License for the specific language governing permissions and | 
| priyank12p | 0:b0c4c25d37ab | 17 | * limitations under the License. | 
| priyank12p | 0:b0c4c25d37ab | 18 | */ | 
| priyank12p | 0:b0c4c25d37ab | 19 | #ifndef MBED_SLEEP_API_H | 
| priyank12p | 0:b0c4c25d37ab | 20 | #define MBED_SLEEP_API_H | 
| priyank12p | 0:b0c4c25d37ab | 21 | |
| priyank12p | 0:b0c4c25d37ab | 22 | #include "device.h" | 
| priyank12p | 0:b0c4c25d37ab | 23 | |
| priyank12p | 0:b0c4c25d37ab | 24 | #if DEVICE_SLEEP | 
| priyank12p | 0:b0c4c25d37ab | 25 | |
| priyank12p | 0:b0c4c25d37ab | 26 | #ifdef __cplusplus | 
| priyank12p | 0:b0c4c25d37ab | 27 | extern "C" { | 
| priyank12p | 0:b0c4c25d37ab | 28 | #endif | 
| priyank12p | 0:b0c4c25d37ab | 29 | |
| priyank12p | 0:b0c4c25d37ab | 30 | /** Send the microcontroller to sleep | 
| priyank12p | 0:b0c4c25d37ab | 31 | * | 
| priyank12p | 0:b0c4c25d37ab | 32 | * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the | 
| priyank12p | 0:b0c4c25d37ab | 33 | * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates | 
| priyank12p | 0:b0c4c25d37ab | 34 | * dynamic power used by the processor, memory systems and buses. The processor, peripheral and | 
| priyank12p | 0:b0c4c25d37ab | 35 | * memory state are maintained, and the peripherals continue to work and can generate interrupts. | 
| priyank12p | 0:b0c4c25d37ab | 36 | * | 
| priyank12p | 0:b0c4c25d37ab | 37 | * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. | 
| priyank12p | 0:b0c4c25d37ab | 38 | * | 
| priyank12p | 0:b0c4c25d37ab | 39 | * @note | 
| priyank12p | 0:b0c4c25d37ab | 40 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. | 
| priyank12p | 0:b0c4c25d37ab | 41 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be | 
| priyank12p | 0:b0c4c25d37ab | 42 | * able to access the LocalFileSystem | 
| priyank12p | 0:b0c4c25d37ab | 43 | */ | 
| priyank12p | 0:b0c4c25d37ab | 44 | void sleep(void); | 
| priyank12p | 0:b0c4c25d37ab | 45 | |
| priyank12p | 0:b0c4c25d37ab | 46 | /** Send the microcontroller to deep sleep | 
| priyank12p | 0:b0c4c25d37ab | 47 | * | 
| priyank12p | 0:b0c4c25d37ab | 48 | * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode | 
| priyank12p | 0:b0c4c25d37ab | 49 | * has the same sleep features as sleep plus it powers down peripherals and clocks. All state | 
| priyank12p | 0:b0c4c25d37ab | 50 | * is still maintained. | 
| priyank12p | 0:b0c4c25d37ab | 51 | * | 
| priyank12p | 0:b0c4c25d37ab | 52 | * The processor can only be woken up by an external interrupt on a pin or a watchdog timer. | 
| priyank12p | 0:b0c4c25d37ab | 53 | * | 
| priyank12p | 0:b0c4c25d37ab | 54 | * @note | 
| priyank12p | 0:b0c4c25d37ab | 55 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. | 
| priyank12p | 0:b0c4c25d37ab | 56 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be | 
| priyank12p | 0:b0c4c25d37ab | 57 | * able to access the LocalFileSystem | 
| priyank12p | 0:b0c4c25d37ab | 58 | */ | 
| priyank12p | 0:b0c4c25d37ab | 59 | void deepsleep(void); | 
| priyank12p | 0:b0c4c25d37ab | 60 | |
| priyank12p | 0:b0c4c25d37ab | 61 | #ifdef __cplusplus | 
| priyank12p | 0:b0c4c25d37ab | 62 | } | 
| priyank12p | 0:b0c4c25d37ab | 63 | #endif | 
| priyank12p | 0:b0c4c25d37ab | 64 | |
| priyank12p | 0:b0c4c25d37ab | 65 | #endif | 
| priyank12p | 0:b0c4c25d37ab | 66 | |
| priyank12p | 0:b0c4c25d37ab | 67 | #endif | 
| priyank12p | 0:b0c4c25d37ab | 68 | |
| priyank12p | 0:b0c4c25d37ab | 69 | /** @}*/ |