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/lp_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) 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_LPTICKER_API_H |
16038618 | 1:4bdfa7d7e8bf | 17 | #define MBED_LPTICKER_API_H |
16038618 | 1:4bdfa7d7e8bf | 18 | |
16038618 | 1:4bdfa7d7e8bf | 19 | #include "device.h" |
16038618 | 1:4bdfa7d7e8bf | 20 | |
16038618 | 1:4bdfa7d7e8bf | 21 | #if DEVICE_LOWPOWERTIMER |
16038618 | 1:4bdfa7d7e8bf | 22 | |
16038618 | 1:4bdfa7d7e8bf | 23 | #include "ticker_api.h" |
16038618 | 1:4bdfa7d7e8bf | 24 | |
16038618 | 1:4bdfa7d7e8bf | 25 | #ifdef __cplusplus |
16038618 | 1:4bdfa7d7e8bf | 26 | extern "C" { |
16038618 | 1:4bdfa7d7e8bf | 27 | #endif |
16038618 | 1:4bdfa7d7e8bf | 28 | |
16038618 | 1:4bdfa7d7e8bf | 29 | /** |
16038618 | 1:4bdfa7d7e8bf | 30 | * \defgroup LpTicker Low Power Ticker Functions |
16038618 | 1:4bdfa7d7e8bf | 31 | * @{ |
16038618 | 1:4bdfa7d7e8bf | 32 | */ |
16038618 | 1:4bdfa7d7e8bf | 33 | |
16038618 | 1:4bdfa7d7e8bf | 34 | /** Get low power ticker's data |
16038618 | 1:4bdfa7d7e8bf | 35 | * |
16038618 | 1:4bdfa7d7e8bf | 36 | * @return The low power ticker data |
16038618 | 1:4bdfa7d7e8bf | 37 | */ |
16038618 | 1:4bdfa7d7e8bf | 38 | const ticker_data_t* get_lp_ticker_data(void); |
16038618 | 1:4bdfa7d7e8bf | 39 | |
16038618 | 1:4bdfa7d7e8bf | 40 | /** The wrapper for ticker_irq_handler, to pass lp ticker's data |
16038618 | 1:4bdfa7d7e8bf | 41 | * |
16038618 | 1:4bdfa7d7e8bf | 42 | */ |
16038618 | 1:4bdfa7d7e8bf | 43 | void lp_ticker_irq_handler(void); |
16038618 | 1:4bdfa7d7e8bf | 44 | |
16038618 | 1:4bdfa7d7e8bf | 45 | /* HAL lp ticker */ |
16038618 | 1:4bdfa7d7e8bf | 46 | |
16038618 | 1:4bdfa7d7e8bf | 47 | /** Initialize the low power ticker |
16038618 | 1:4bdfa7d7e8bf | 48 | * |
16038618 | 1:4bdfa7d7e8bf | 49 | */ |
16038618 | 1:4bdfa7d7e8bf | 50 | void lp_ticker_init(void); |
16038618 | 1:4bdfa7d7e8bf | 51 | |
16038618 | 1:4bdfa7d7e8bf | 52 | /** Read the current counter |
16038618 | 1:4bdfa7d7e8bf | 53 | * |
16038618 | 1:4bdfa7d7e8bf | 54 | * @return The current timer's counter value in microseconds |
16038618 | 1:4bdfa7d7e8bf | 55 | */ |
16038618 | 1:4bdfa7d7e8bf | 56 | uint32_t lp_ticker_read(void); |
16038618 | 1:4bdfa7d7e8bf | 57 | |
16038618 | 1:4bdfa7d7e8bf | 58 | /** Set interrupt for specified timestamp |
16038618 | 1:4bdfa7d7e8bf | 59 | * |
16038618 | 1:4bdfa7d7e8bf | 60 | * @param timestamp The time in microseconds to be set |
16038618 | 1:4bdfa7d7e8bf | 61 | */ |
16038618 | 1:4bdfa7d7e8bf | 62 | void lp_ticker_set_interrupt(timestamp_t timestamp); |
16038618 | 1:4bdfa7d7e8bf | 63 | |
16038618 | 1:4bdfa7d7e8bf | 64 | /** Disable low power ticker interrupt |
16038618 | 1:4bdfa7d7e8bf | 65 | * |
16038618 | 1:4bdfa7d7e8bf | 66 | */ |
16038618 | 1:4bdfa7d7e8bf | 67 | void lp_ticker_disable_interrupt(void); |
16038618 | 1:4bdfa7d7e8bf | 68 | |
16038618 | 1:4bdfa7d7e8bf | 69 | /** Clear the low power ticker interrupt |
16038618 | 1:4bdfa7d7e8bf | 70 | * |
16038618 | 1:4bdfa7d7e8bf | 71 | */ |
16038618 | 1:4bdfa7d7e8bf | 72 | void lp_ticker_clear_interrupt(void); |
16038618 | 1:4bdfa7d7e8bf | 73 | |
16038618 | 1:4bdfa7d7e8bf | 74 | /**@}*/ |
16038618 | 1:4bdfa7d7e8bf | 75 | |
16038618 | 1:4bdfa7d7e8bf | 76 | #ifdef __cplusplus |
16038618 | 1:4bdfa7d7e8bf | 77 | } |
16038618 | 1:4bdfa7d7e8bf | 78 | #endif |
16038618 | 1:4bdfa7d7e8bf | 79 | |
16038618 | 1:4bdfa7d7e8bf | 80 | #endif |
16038618 | 1:4bdfa7d7e8bf | 81 | |
16038618 | 1:4bdfa7d7e8bf | 82 | #endif |