Home Alert System

Dependencies:   PWM_Tone_Library DHT

Committer:
ethaderu
Date:
Tue Mar 05 02:34:44 2019 +0000
Revision:
3:78f223d34f36
Publish 1

Who changed what in which revision?

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