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