IoT Home Alarm System

Dependents:   IoTBurglar_and_Fire_AlarmSystem

Committer:
kbrahmbhatt6
Date:
Fri Apr 29 06:59:59 2016 +0000
Revision:
0:2f388b030837
1

Who changed what in which revision?

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