IOTIO

Dependencies:   Nucleo_BLE_API_IOTIO Nucleo_BLE_BlueNRG Nucleo_BLE_DemoApp Nucleo_Sensor_Shield mbed

Dependents:   Nucleo_BLE_Demo_IOTIO

Fork of Nucleo_BLE_Demo by Cortex Challenge Team

Committer:
16038618
Date:
Sat Oct 29 15:11:28 2016 +0000
Revision:
1:4bdfa7d7e8bf
IOTIO

Who changed what in which revision?

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