forked
Embed:
(wiki syntax)
Show/hide line numbers
sleep_api.h
00001 00002 /** \addtogroup hal */ 00003 /** @{*/ 00004 /* mbed Microcontroller Library 00005 * Copyright (c) 2006-2013 ARM Limited 00006 * 00007 * Licensed under the Apache License, Version 2.0 (the "License"); 00008 * you may not use this file except in compliance with the License. 00009 * You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 */ 00019 #ifndef MBED_SLEEP_API_H 00020 #define MBED_SLEEP_API_H 00021 00022 #include "device.h" 00023 00024 #if DEVICE_SLEEP 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00030 /** Send the microcontroller to sleep 00031 * 00032 * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the 00033 * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates 00034 * dynamic power used by the processor, memory systems and buses. The processor, peripheral and 00035 * memory state are maintained, and the peripherals continue to work and can generate interrupts. 00036 * 00037 * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. 00038 * 00039 * @note 00040 * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. 00041 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be 00042 * able to access the LocalFileSystem 00043 */ 00044 void hal_sleep(void); 00045 00046 /** Send the microcontroller to deep sleep 00047 * 00048 * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode 00049 * has the same sleep features as sleep plus it powers down peripherals and clocks. All state 00050 * is still maintained. 00051 * 00052 * The processor can only be woken up by an external interrupt on a pin or a watchdog timer. 00053 * 00054 * @note 00055 * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. 00056 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be 00057 * able to access the LocalFileSystem 00058 */ 00059 void hal_deepsleep(void); 00060 00061 #ifdef __cplusplus 00062 } 00063 #endif 00064 00065 #endif 00066 00067 #endif 00068 00069 /** @}*/
Generated on Tue Jul 12 2022 16:02:33 by 1.7.2