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