1

Committer:
valeyev
Date:
Tue Mar 13 07:17:50 2018 +0000
Revision:
0:e056ac8fecf8
looking for...

Who changed what in which revision?

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