The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Thu Nov 09 11:14:10 2017 +0000
Revision:
157:e7ca05fa8600
Parent:
156:ff21514d8981
Child:
169:a7c7b631e539
Release 155 of the mbed library.

Who changed what in which revision?

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