customized mbed library sources for nrf51822

Dependents:   Grove_Node Potentiometer BLE_Beacon I2C_Scanner

Committer:
yihui
Date:
Tue Nov 04 07:38:53 2014 +0000
Revision:
0:700cadd8b708
customized mbed-src library for nrf51822

Who changed what in which revision?

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