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.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
us_ticker_api.h@118:224e68e3e00a, 2016-04-04 (annotated)
- Committer:
- elijahorr
- Date:
- Mon Apr 04 08:26:28 2016 +0000
- Revision:
- 118:224e68e3e00a
- Parent:
- 98:8ab26030e058
-fixed pin names; -added pin names
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bogdanm | 65:5798e58a58b1 | 1 | /* mbed Microcontroller Library |
| Kojto | 98:8ab26030e058 | 2 | * Copyright (c) 2006-2015 ARM Limited |
| bogdanm | 65:5798e58a58b1 | 3 | * |
| bogdanm | 65:5798e58a58b1 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| bogdanm | 65:5798e58a58b1 | 5 | * you may not use this file except in compliance with the License. |
| bogdanm | 65:5798e58a58b1 | 6 | * You may obtain a copy of the License at |
| bogdanm | 65:5798e58a58b1 | 7 | * |
| bogdanm | 65:5798e58a58b1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| bogdanm | 65:5798e58a58b1 | 9 | * |
| bogdanm | 65:5798e58a58b1 | 10 | * Unless required by applicable law or agreed to in writing, software |
| bogdanm | 65:5798e58a58b1 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| bogdanm | 65:5798e58a58b1 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| bogdanm | 65:5798e58a58b1 | 13 | * See the License for the specific language governing permissions and |
| bogdanm | 65:5798e58a58b1 | 14 | * limitations under the License. |
| bogdanm | 65:5798e58a58b1 | 15 | */ |
| bogdanm | 65:5798e58a58b1 | 16 | #ifndef MBED_US_TICKER_API_H |
| bogdanm | 65:5798e58a58b1 | 17 | #define MBED_US_TICKER_API_H |
| bogdanm | 65:5798e58a58b1 | 18 | |
| bogdanm | 65:5798e58a58b1 | 19 | #include <stdint.h> |
| Kojto | 98:8ab26030e058 | 20 | #include "ticker_api.h" |
| bogdanm | 65:5798e58a58b1 | 21 | |
| bogdanm | 65:5798e58a58b1 | 22 | #ifdef __cplusplus |
| bogdanm | 65:5798e58a58b1 | 23 | extern "C" { |
| bogdanm | 65:5798e58a58b1 | 24 | #endif |
| bogdanm | 65:5798e58a58b1 | 25 | |
| Kojto | 98:8ab26030e058 | 26 | /** |
| Kojto | 98:8ab26030e058 | 27 | * \defgroup UsTicker Microseconds Ticker Functions |
| Kojto | 98:8ab26030e058 | 28 | * @{ |
| Kojto | 98:8ab26030e058 | 29 | */ |
| Kojto | 98:8ab26030e058 | 30 | |
| Kojto | 98:8ab26030e058 | 31 | /** Get ticker's data |
| Kojto | 98:8ab26030e058 | 32 | * |
| Kojto | 98:8ab26030e058 | 33 | * @return The low power ticker data |
| Kojto | 98:8ab26030e058 | 34 | */ |
| Kojto | 98:8ab26030e058 | 35 | const ticker_data_t* get_us_ticker_data(void); |
| Kojto | 98:8ab26030e058 | 36 | |
| bogdanm | 89:552587b429a1 | 37 | |
| Kojto | 98:8ab26030e058 | 38 | /** The wrapper for ticker_irq_handler, to pass us ticker's data |
| Kojto | 98:8ab26030e058 | 39 | * |
| Kojto | 98:8ab26030e058 | 40 | */ |
| Kojto | 98:8ab26030e058 | 41 | void us_ticker_irq_handler(void); |
| Kojto | 98:8ab26030e058 | 42 | |
| Kojto | 98:8ab26030e058 | 43 | /* HAL us ticker */ |
| Kojto | 98:8ab26030e058 | 44 | |
| Kojto | 98:8ab26030e058 | 45 | /** Initialize the ticker |
| Kojto | 98:8ab26030e058 | 46 | * |
| Kojto | 98:8ab26030e058 | 47 | */ |
| Kojto | 98:8ab26030e058 | 48 | void us_ticker_init(void); |
| Kojto | 98:8ab26030e058 | 49 | |
| Kojto | 98:8ab26030e058 | 50 | /** Read the current counter |
| Kojto | 98:8ab26030e058 | 51 | * |
| Kojto | 98:8ab26030e058 | 52 | * @return The current timer's counter value in microseconds |
| Kojto | 98:8ab26030e058 | 53 | */ |
| bogdanm | 65:5798e58a58b1 | 54 | uint32_t us_ticker_read(void); |
| bogdanm | 65:5798e58a58b1 | 55 | |
| Kojto | 98:8ab26030e058 | 56 | /** Set interrupt for specified timestamp |
| Kojto | 98:8ab26030e058 | 57 | * |
| Kojto | 98:8ab26030e058 | 58 | * @param timestamp The time in microseconds to be set |
| Kojto | 98:8ab26030e058 | 59 | */ |
| Kojto | 98:8ab26030e058 | 60 | void us_ticker_set_interrupt(timestamp_t timestamp); |
| bogdanm | 65:5798e58a58b1 | 61 | |
| Kojto | 98:8ab26030e058 | 62 | /** Disable us ticker interrupt |
| Kojto | 98:8ab26030e058 | 63 | * |
| Kojto | 98:8ab26030e058 | 64 | */ |
| bogdanm | 65:5798e58a58b1 | 65 | void us_ticker_disable_interrupt(void); |
| Kojto | 98:8ab26030e058 | 66 | |
| Kojto | 98:8ab26030e058 | 67 | /** Clear us ticker interrupt |
| Kojto | 98:8ab26030e058 | 68 | * |
| Kojto | 98:8ab26030e058 | 69 | */ |
| bogdanm | 65:5798e58a58b1 | 70 | void us_ticker_clear_interrupt(void); |
| bogdanm | 65:5798e58a58b1 | 71 | |
| Kojto | 98:8ab26030e058 | 72 | /**@}*/ |
| bogdanm | 65:5798e58a58b1 | 73 | |
| bogdanm | 65:5798e58a58b1 | 74 | #ifdef __cplusplus |
| bogdanm | 65:5798e58a58b1 | 75 | } |
| bogdanm | 65:5798e58a58b1 | 76 | #endif |
| bogdanm | 65:5798e58a58b1 | 77 | |
| bogdanm | 65:5798e58a58b1 | 78 | #endif |
