mbed library for NZ32-SC151

Committer:
modtronix-com
Date:
Fri Aug 19 15:46:42 2016 +1000
Revision:
17:639ed60ce759
Parent:
1:71204b8406f2
Added tag v1.1 for changeset 076cbe3e55be

Who changed what in which revision?

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