Official Sheffield ARMBand micro:bit program

Committer:
MrBedfordVan
Date:
Mon Oct 17 12:41:20 2016 +0000
Revision:
0:b9164b348919
Official Sheffield ARMBand Micro:bit program

Who changed what in which revision?

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