Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
hal/lp_ticker_api.h@1:8a094db1347f, 2020-11-09 (annotated)
- Committer:
- elijahsj
- Date:
- Mon Nov 09 00:02:47 2020 -0500
- Revision:
- 1:8a094db1347f
test
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| elijahsj | 1:8a094db1347f | 1 | |
| elijahsj | 1:8a094db1347f | 2 | /** \addtogroup hal */ |
| elijahsj | 1:8a094db1347f | 3 | /** @{*/ |
| elijahsj | 1:8a094db1347f | 4 | /* mbed Microcontroller Library |
| elijahsj | 1:8a094db1347f | 5 | * Copyright (c) 2015 ARM Limited |
| elijahsj | 1:8a094db1347f | 6 | * |
| elijahsj | 1:8a094db1347f | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| elijahsj | 1:8a094db1347f | 8 | * you may not use this file except in compliance with the License. |
| elijahsj | 1:8a094db1347f | 9 | * You may obtain a copy of the License at |
| elijahsj | 1:8a094db1347f | 10 | * |
| elijahsj | 1:8a094db1347f | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| elijahsj | 1:8a094db1347f | 12 | * |
| elijahsj | 1:8a094db1347f | 13 | * Unless required by applicable law or agreed to in writing, software |
| elijahsj | 1:8a094db1347f | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| elijahsj | 1:8a094db1347f | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| elijahsj | 1:8a094db1347f | 16 | * See the License for the specific language governing permissions and |
| elijahsj | 1:8a094db1347f | 17 | * limitations under the License. |
| elijahsj | 1:8a094db1347f | 18 | */ |
| elijahsj | 1:8a094db1347f | 19 | #ifndef MBED_LPTICKER_API_H |
| elijahsj | 1:8a094db1347f | 20 | #define MBED_LPTICKER_API_H |
| elijahsj | 1:8a094db1347f | 21 | |
| elijahsj | 1:8a094db1347f | 22 | #include "device.h" |
| elijahsj | 1:8a094db1347f | 23 | |
| elijahsj | 1:8a094db1347f | 24 | #if DEVICE_LOWPOWERTIMER |
| elijahsj | 1:8a094db1347f | 25 | |
| elijahsj | 1:8a094db1347f | 26 | #include "hal/ticker_api.h" |
| elijahsj | 1:8a094db1347f | 27 | |
| elijahsj | 1:8a094db1347f | 28 | #ifdef __cplusplus |
| elijahsj | 1:8a094db1347f | 29 | extern "C" { |
| elijahsj | 1:8a094db1347f | 30 | #endif |
| elijahsj | 1:8a094db1347f | 31 | |
| elijahsj | 1:8a094db1347f | 32 | /** |
| elijahsj | 1:8a094db1347f | 33 | * \defgroup hal_LpTicker Low Power Ticker Functions |
| elijahsj | 1:8a094db1347f | 34 | * @{ |
| elijahsj | 1:8a094db1347f | 35 | */ |
| elijahsj | 1:8a094db1347f | 36 | |
| elijahsj | 1:8a094db1347f | 37 | /** Get low power ticker's data |
| elijahsj | 1:8a094db1347f | 38 | * |
| elijahsj | 1:8a094db1347f | 39 | * @return The low power ticker data |
| elijahsj | 1:8a094db1347f | 40 | */ |
| elijahsj | 1:8a094db1347f | 41 | const ticker_data_t* get_lp_ticker_data(void); |
| elijahsj | 1:8a094db1347f | 42 | |
| elijahsj | 1:8a094db1347f | 43 | /** The wrapper for ticker_irq_handler, to pass lp ticker's data |
| elijahsj | 1:8a094db1347f | 44 | * |
| elijahsj | 1:8a094db1347f | 45 | */ |
| elijahsj | 1:8a094db1347f | 46 | void lp_ticker_irq_handler(void); |
| elijahsj | 1:8a094db1347f | 47 | |
| elijahsj | 1:8a094db1347f | 48 | /* HAL lp ticker */ |
| elijahsj | 1:8a094db1347f | 49 | |
| elijahsj | 1:8a094db1347f | 50 | /** Initialize the low power ticker |
| elijahsj | 1:8a094db1347f | 51 | * |
| elijahsj | 1:8a094db1347f | 52 | */ |
| elijahsj | 1:8a094db1347f | 53 | void lp_ticker_init(void); |
| elijahsj | 1:8a094db1347f | 54 | |
| elijahsj | 1:8a094db1347f | 55 | /** Read the current counter |
| elijahsj | 1:8a094db1347f | 56 | * |
| elijahsj | 1:8a094db1347f | 57 | * @return The current timer's counter value in microseconds |
| elijahsj | 1:8a094db1347f | 58 | */ |
| elijahsj | 1:8a094db1347f | 59 | uint32_t lp_ticker_read(void); |
| elijahsj | 1:8a094db1347f | 60 | |
| elijahsj | 1:8a094db1347f | 61 | /** Set interrupt for specified timestamp |
| elijahsj | 1:8a094db1347f | 62 | * |
| elijahsj | 1:8a094db1347f | 63 | * @param timestamp The time in microseconds to be set |
| elijahsj | 1:8a094db1347f | 64 | */ |
| elijahsj | 1:8a094db1347f | 65 | void lp_ticker_set_interrupt(timestamp_t timestamp); |
| elijahsj | 1:8a094db1347f | 66 | |
| elijahsj | 1:8a094db1347f | 67 | /** Disable low power ticker interrupt |
| elijahsj | 1:8a094db1347f | 68 | * |
| elijahsj | 1:8a094db1347f | 69 | */ |
| elijahsj | 1:8a094db1347f | 70 | void lp_ticker_disable_interrupt(void); |
| elijahsj | 1:8a094db1347f | 71 | |
| elijahsj | 1:8a094db1347f | 72 | /** Clear the low power ticker interrupt |
| elijahsj | 1:8a094db1347f | 73 | * |
| elijahsj | 1:8a094db1347f | 74 | */ |
| elijahsj | 1:8a094db1347f | 75 | void lp_ticker_clear_interrupt(void); |
| elijahsj | 1:8a094db1347f | 76 | |
| elijahsj | 1:8a094db1347f | 77 | /** Set pending interrupt that should be fired right away. |
| elijahsj | 1:8a094db1347f | 78 | * |
| elijahsj | 1:8a094db1347f | 79 | * The ticker should be initialized prior calling this function. |
| elijahsj | 1:8a094db1347f | 80 | */ |
| elijahsj | 1:8a094db1347f | 81 | void lp_ticker_fire_interrupt(void); |
| elijahsj | 1:8a094db1347f | 82 | |
| elijahsj | 1:8a094db1347f | 83 | /**@}*/ |
| elijahsj | 1:8a094db1347f | 84 | |
| elijahsj | 1:8a094db1347f | 85 | #ifdef __cplusplus |
| elijahsj | 1:8a094db1347f | 86 | } |
| elijahsj | 1:8a094db1347f | 87 | #endif |
| elijahsj | 1:8a094db1347f | 88 | |
| elijahsj | 1:8a094db1347f | 89 | #endif |
| elijahsj | 1:8a094db1347f | 90 | |
| elijahsj | 1:8a094db1347f | 91 | #endif |
| elijahsj | 1:8a094db1347f | 92 | |
| elijahsj | 1:8a094db1347f | 93 | /** @}*/ |