The code from https://github.com/vpcola/Nucleo

Committer:
sinrab
Date:
Wed Oct 08 11:00:24 2014 +0000
Revision:
0:5464d5e415e5
The code from https://github.com/vpcola/Nucleo

Who changed what in which revision?

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