RTC auf true
hal/mbed_lp_ticker_wrapper.h@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | |
kevman | 0:38ceb79fef03 | 2 | /** \addtogroup hal */ |
kevman | 0:38ceb79fef03 | 3 | /** @{*/ |
kevman | 0:38ceb79fef03 | 4 | /* mbed Microcontroller Library |
kevman | 0:38ceb79fef03 | 5 | * Copyright (c) 2018 ARM Limited |
kevman | 0:38ceb79fef03 | 6 | * |
kevman | 0:38ceb79fef03 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kevman | 0:38ceb79fef03 | 8 | * you may not use this file except in compliance with the License. |
kevman | 0:38ceb79fef03 | 9 | * You may obtain a copy of the License at |
kevman | 0:38ceb79fef03 | 10 | * |
kevman | 0:38ceb79fef03 | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
kevman | 0:38ceb79fef03 | 12 | * |
kevman | 0:38ceb79fef03 | 13 | * Unless required by applicable law or agreed to in writing, software |
kevman | 0:38ceb79fef03 | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
kevman | 0:38ceb79fef03 | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kevman | 0:38ceb79fef03 | 16 | * See the License for the specific language governing permissions and |
kevman | 0:38ceb79fef03 | 17 | * limitations under the License. |
kevman | 0:38ceb79fef03 | 18 | */ |
kevman | 0:38ceb79fef03 | 19 | #ifndef MBED_LP_TICKER_WRAPPER_H |
kevman | 0:38ceb79fef03 | 20 | #define MBED_LP_TICKER_WRAPPER_H |
kevman | 0:38ceb79fef03 | 21 | |
kevman | 0:38ceb79fef03 | 22 | #include "device.h" |
kevman | 0:38ceb79fef03 | 23 | |
kevman | 0:38ceb79fef03 | 24 | #if DEVICE_LPTICKER |
kevman | 0:38ceb79fef03 | 25 | |
kevman | 0:38ceb79fef03 | 26 | #include "hal/ticker_api.h" |
kevman | 0:38ceb79fef03 | 27 | #include <stdbool.h> |
kevman | 0:38ceb79fef03 | 28 | |
kevman | 0:38ceb79fef03 | 29 | #ifdef __cplusplus |
kevman | 0:38ceb79fef03 | 30 | extern "C" { |
kevman | 0:38ceb79fef03 | 31 | #endif |
kevman | 0:38ceb79fef03 | 32 | |
kevman | 0:38ceb79fef03 | 33 | typedef void (*ticker_irq_handler_type)(const ticker_data_t *const); |
kevman | 0:38ceb79fef03 | 34 | |
kevman | 0:38ceb79fef03 | 35 | /** |
kevman | 0:38ceb79fef03 | 36 | * Interrupt handler for the wrapped lp ticker |
kevman | 0:38ceb79fef03 | 37 | * |
kevman | 0:38ceb79fef03 | 38 | * @param handler the function which would normally be called by the |
kevman | 0:38ceb79fef03 | 39 | * lp ticker handler when it is not wrapped |
kevman | 0:38ceb79fef03 | 40 | */ |
kevman | 0:38ceb79fef03 | 41 | void lp_ticker_wrapper_irq_handler(ticker_irq_handler_type handler); |
kevman | 0:38ceb79fef03 | 42 | |
kevman | 0:38ceb79fef03 | 43 | /** |
kevman | 0:38ceb79fef03 | 44 | * Get wrapped lp ticker data |
kevman | 0:38ceb79fef03 | 45 | * |
kevman | 0:38ceb79fef03 | 46 | * @param data hardware low power ticker object |
kevman | 0:38ceb79fef03 | 47 | * @return wrapped low power ticker object |
kevman | 0:38ceb79fef03 | 48 | */ |
kevman | 0:38ceb79fef03 | 49 | const ticker_data_t *get_lp_ticker_wrapper_data(const ticker_data_t *data); |
kevman | 0:38ceb79fef03 | 50 | |
kevman | 0:38ceb79fef03 | 51 | /** |
kevman | 0:38ceb79fef03 | 52 | * Suspend the wrapper layer code |
kevman | 0:38ceb79fef03 | 53 | * |
kevman | 0:38ceb79fef03 | 54 | * Pass through all interrupts to the low power ticker and stop using |
kevman | 0:38ceb79fef03 | 55 | * the microsecond ticker. |
kevman | 0:38ceb79fef03 | 56 | * |
kevman | 0:38ceb79fef03 | 57 | * @warning: Make sure to suspend the LP ticker first (call ticker_suspend()), |
kevman | 0:38ceb79fef03 | 58 | * otherwise the behavior is undefined. |
kevman | 0:38ceb79fef03 | 59 | */ |
kevman | 0:38ceb79fef03 | 60 | void lp_ticker_wrapper_suspend(void); |
kevman | 0:38ceb79fef03 | 61 | |
kevman | 0:38ceb79fef03 | 62 | /** |
kevman | 0:38ceb79fef03 | 63 | * Resume the wrapper layer code |
kevman | 0:38ceb79fef03 | 64 | * |
kevman | 0:38ceb79fef03 | 65 | * Resume operation of the wrapper layer. Interrupts will be filtered |
kevman | 0:38ceb79fef03 | 66 | * as normal and the microsecond timer will be used for interrupts scheduled |
kevman | 0:38ceb79fef03 | 67 | * too quickly back-to-back. |
kevman | 0:38ceb79fef03 | 68 | */ |
kevman | 0:38ceb79fef03 | 69 | void lp_ticker_wrapper_resume(void); |
kevman | 0:38ceb79fef03 | 70 | |
kevman | 0:38ceb79fef03 | 71 | /**@}*/ |
kevman | 0:38ceb79fef03 | 72 | |
kevman | 0:38ceb79fef03 | 73 | #ifdef __cplusplus |
kevman | 0:38ceb79fef03 | 74 | } |
kevman | 0:38ceb79fef03 | 75 | #endif |
kevman | 0:38ceb79fef03 | 76 | |
kevman | 0:38ceb79fef03 | 77 | #endif |
kevman | 0:38ceb79fef03 | 78 | |
kevman | 0:38ceb79fef03 | 79 | #endif |
kevman | 0:38ceb79fef03 | 80 | |
kevman | 0:38ceb79fef03 | 81 | /** @}*/ |