meh

Fork of mbed by mbed official

Committer:
ricardobtez
Date:
Tue Apr 05 23:51:21 2016 +0000
Revision:
118:16969dd821af
Parent:
65:5798e58a58b1
dgdgr

Who changed what in which revision?

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