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