mbed libraries for KL25Z
sleep_api.h@8:c14af7958ef5, 2012-11-09 (annotated)
- Committer:
- emilmont
- Date:
- Fri Nov 09 11:33:53 2012 +0000
- Revision:
- 8:c14af7958ef5
- Child:
- 9:663789d7729f
SPI driver; ADC driver; DAC driver; microlib support; general bugfixing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 8:c14af7958ef5 | 1 | /* mbed Microcontroller Library - sleep_api |
emilmont | 8:c14af7958ef5 | 2 | * Copyright (c) 2009-2011 ARM Limited. All rights reserved. |
emilmont | 8:c14af7958ef5 | 3 | */ |
emilmont | 8:c14af7958ef5 | 4 | #ifndef MBED_SLEEP_API_H |
emilmont | 8:c14af7958ef5 | 5 | #define MBED_SLEEP_API_H |
emilmont | 8:c14af7958ef5 | 6 | |
emilmont | 8:c14af7958ef5 | 7 | #include "device.h" |
emilmont | 8:c14af7958ef5 | 8 | |
emilmont | 8:c14af7958ef5 | 9 | #if DEVICE_SLEEP |
emilmont | 8:c14af7958ef5 | 10 | |
emilmont | 8:c14af7958ef5 | 11 | #ifdef __cplusplus |
emilmont | 8:c14af7958ef5 | 12 | extern "C" { |
emilmont | 8:c14af7958ef5 | 13 | #endif |
emilmont | 8:c14af7958ef5 | 14 | |
emilmont | 8:c14af7958ef5 | 15 | /** Send the microcontroller to sleep |
emilmont | 8:c14af7958ef5 | 16 | * |
emilmont | 8:c14af7958ef5 | 17 | * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the |
emilmont | 8:c14af7958ef5 | 18 | * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates |
emilmont | 8:c14af7958ef5 | 19 | * dynamic power used by the processor, memory systems and buses. The processor, peripheral and |
emilmont | 8:c14af7958ef5 | 20 | * memory state are maintained, and the peripherals continue to work and can generate interrupts. |
emilmont | 8:c14af7958ef5 | 21 | * |
emilmont | 8:c14af7958ef5 | 22 | * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. |
emilmont | 8:c14af7958ef5 | 23 | * |
emilmont | 8:c14af7958ef5 | 24 | * @note |
emilmont | 8:c14af7958ef5 | 25 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. |
emilmont | 8:c14af7958ef5 | 26 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be |
emilmont | 8:c14af7958ef5 | 27 | * able to access the LocalFileSystem |
emilmont | 8:c14af7958ef5 | 28 | */ |
emilmont | 8:c14af7958ef5 | 29 | void sleep(void); |
emilmont | 8:c14af7958ef5 | 30 | |
emilmont | 8:c14af7958ef5 | 31 | /** Send the microcontroller to deep sleep |
emilmont | 8:c14af7958ef5 | 32 | * |
emilmont | 8:c14af7958ef5 | 33 | * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode |
emilmont | 8:c14af7958ef5 | 34 | * has the same sleep features as sleep plus it powers down peripherals and clocks. All state |
emilmont | 8:c14af7958ef5 | 35 | * is still maintained. |
emilmont | 8:c14af7958ef5 | 36 | * |
emilmont | 8:c14af7958ef5 | 37 | * The processor can only be woken up by an external interrupt on a pin or a watchdog timer. |
emilmont | 8:c14af7958ef5 | 38 | * |
emilmont | 8:c14af7958ef5 | 39 | * @note |
emilmont | 8:c14af7958ef5 | 40 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. |
emilmont | 8:c14af7958ef5 | 41 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be |
emilmont | 8:c14af7958ef5 | 42 | * able to access the LocalFileSystem |
emilmont | 8:c14af7958ef5 | 43 | */ |
emilmont | 8:c14af7958ef5 | 44 | void deepsleep(void); |
emilmont | 8:c14af7958ef5 | 45 | |
emilmont | 8:c14af7958ef5 | 46 | #ifdef __cplusplus |
emilmont | 8:c14af7958ef5 | 47 | } |
emilmont | 8:c14af7958ef5 | 48 | #endif |
emilmont | 8:c14af7958ef5 | 49 | |
emilmont | 8:c14af7958ef5 | 50 | #endif |
emilmont | 8:c14af7958ef5 | 51 | |
emilmont | 8:c14af7958ef5 | 52 | #endif |