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