Opencv 3.1 project on GR-PEACH board
Fork of gr-peach-opencv-project by
platform/mbed_sleep.h@170:54ff26da7eb6, 2017-07-04 (annotated)
- Committer:
- thedo
- Date:
- Tue Jul 04 06:23:13 2017 +0000
- Revision:
- 170:54ff26da7eb6
- Parent:
- 167:1657b442184c
project opencv 3.1 on GR PEACH board, no use SD card.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thedo | 167:1657b442184c | 1 | |
thedo | 167:1657b442184c | 2 | /** \addtogroup platform */ |
thedo | 167:1657b442184c | 3 | /** @{*/ |
thedo | 167:1657b442184c | 4 | /* mbed Microcontroller Library |
thedo | 167:1657b442184c | 5 | * Copyright (c) 2006-2017 ARM Limited |
thedo | 167:1657b442184c | 6 | * |
thedo | 167:1657b442184c | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
thedo | 167:1657b442184c | 8 | * you may not use this file except in compliance with the License. |
thedo | 167:1657b442184c | 9 | * You may obtain a copy of the License at |
thedo | 167:1657b442184c | 10 | * |
thedo | 167:1657b442184c | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
thedo | 167:1657b442184c | 12 | * |
thedo | 167:1657b442184c | 13 | * Unless required by applicable law or agreed to in writing, software |
thedo | 167:1657b442184c | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
thedo | 167:1657b442184c | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
thedo | 167:1657b442184c | 16 | * See the License for the specific language governing permissions and |
thedo | 167:1657b442184c | 17 | * limitations under the License. |
thedo | 167:1657b442184c | 18 | */ |
thedo | 167:1657b442184c | 19 | #ifndef MBED_SLEEP_H |
thedo | 167:1657b442184c | 20 | #define MBED_SLEEP_H |
thedo | 167:1657b442184c | 21 | |
thedo | 167:1657b442184c | 22 | #include "sleep_api.h" |
thedo | 167:1657b442184c | 23 | |
thedo | 167:1657b442184c | 24 | #ifdef __cplusplus |
thedo | 167:1657b442184c | 25 | extern "C" { |
thedo | 167:1657b442184c | 26 | #endif |
thedo | 167:1657b442184c | 27 | |
thedo | 167:1657b442184c | 28 | /** Send the microcontroller to sleep |
thedo | 167:1657b442184c | 29 | * |
thedo | 167:1657b442184c | 30 | * @note This function can be a noop if not implemented by the platform. |
thedo | 167:1657b442184c | 31 | * @note This function will be a noop in debug mode (debug build profile when MBED_DEBUG is defined). |
thedo | 167:1657b442184c | 32 | * @note This function will be a noop while uVisor is in use. |
thedo | 167:1657b442184c | 33 | * |
thedo | 167:1657b442184c | 34 | * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the |
thedo | 167:1657b442184c | 35 | * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates |
thedo | 167:1657b442184c | 36 | * dynamic power used by the processor, memory systems and buses. The processor, peripheral and |
thedo | 167:1657b442184c | 37 | * memory state are maintained, and the peripherals continue to work and can generate interrupts. |
thedo | 167:1657b442184c | 38 | * |
thedo | 167:1657b442184c | 39 | * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. |
thedo | 167:1657b442184c | 40 | * |
thedo | 167:1657b442184c | 41 | * @note |
thedo | 167:1657b442184c | 42 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. |
thedo | 167:1657b442184c | 43 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be |
thedo | 167:1657b442184c | 44 | * able to access the LocalFileSystem |
thedo | 167:1657b442184c | 45 | */ |
thedo | 167:1657b442184c | 46 | __INLINE static void sleep(void) |
thedo | 167:1657b442184c | 47 | { |
thedo | 167:1657b442184c | 48 | #if !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) |
thedo | 167:1657b442184c | 49 | #ifndef MBED_DEBUG |
thedo | 167:1657b442184c | 50 | #if DEVICE_SLEEP |
thedo | 167:1657b442184c | 51 | hal_sleep(); |
thedo | 167:1657b442184c | 52 | #endif /* DEVICE_SLEEP */ |
thedo | 167:1657b442184c | 53 | #endif /* MBED_DEBUG */ |
thedo | 167:1657b442184c | 54 | #endif /* !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) */ |
thedo | 167:1657b442184c | 55 | } |
thedo | 167:1657b442184c | 56 | |
thedo | 167:1657b442184c | 57 | /** Send the microcontroller to deep sleep |
thedo | 167:1657b442184c | 58 | * |
thedo | 167:1657b442184c | 59 | * @note This function can be a noop if not implemented by the platform. |
thedo | 167:1657b442184c | 60 | * @note This function will be a noop in debug mode (debug build profile when MBED_DEBUG is defined) |
thedo | 167:1657b442184c | 61 | * @note This function will be a noop while uVisor is in use. |
thedo | 167:1657b442184c | 62 | * |
thedo | 167:1657b442184c | 63 | * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode |
thedo | 167:1657b442184c | 64 | * has the same sleep features as sleep plus it powers down peripherals and clocks. All state |
thedo | 167:1657b442184c | 65 | * is still maintained. |
thedo | 167:1657b442184c | 66 | * |
thedo | 167:1657b442184c | 67 | * The processor can only be woken up by an external interrupt on a pin or a watchdog timer. |
thedo | 167:1657b442184c | 68 | * |
thedo | 167:1657b442184c | 69 | * @note |
thedo | 167:1657b442184c | 70 | * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. |
thedo | 167:1657b442184c | 71 | * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be |
thedo | 167:1657b442184c | 72 | * able to access the LocalFileSystem |
thedo | 167:1657b442184c | 73 | */ |
thedo | 167:1657b442184c | 74 | __INLINE static void deepsleep(void) |
thedo | 167:1657b442184c | 75 | { |
thedo | 167:1657b442184c | 76 | #if !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) |
thedo | 167:1657b442184c | 77 | #ifndef MBED_DEBUG |
thedo | 167:1657b442184c | 78 | #if DEVICE_SLEEP |
thedo | 167:1657b442184c | 79 | hal_deepsleep(); |
thedo | 167:1657b442184c | 80 | #endif /* DEVICE_SLEEP */ |
thedo | 167:1657b442184c | 81 | #endif /* MBED_DEBUG */ |
thedo | 167:1657b442184c | 82 | #endif /* !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) */ |
thedo | 167:1657b442184c | 83 | } |
thedo | 167:1657b442184c | 84 | |
thedo | 167:1657b442184c | 85 | #ifdef __cplusplus |
thedo | 167:1657b442184c | 86 | } |
thedo | 167:1657b442184c | 87 | #endif |
thedo | 167:1657b442184c | 88 | |
thedo | 167:1657b442184c | 89 | #endif |
thedo | 167:1657b442184c | 90 | |
thedo | 167:1657b442184c | 91 | /** @}*/ |
thedo | 167:1657b442184c | 92 |