[270] | 1 | /* mbed Microcontroller Library
|
---|
| 2 | * Copyright (c) 2015 ARM Limited
|
---|
| 3 | *
|
---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 5 | * you may not use this file except in compliance with the License.
|
---|
| 6 | * You may obtain a copy of the License at
|
---|
| 7 | *
|
---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 9 | *
|
---|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 13 | * See the License for the specific language governing permissions and
|
---|
| 14 | * limitations under the License.
|
---|
| 15 | */
|
---|
| 16 | #ifndef MBED_LPTICKER_API_H
|
---|
| 17 | #define MBED_LPTICKER_API_H
|
---|
| 18 |
|
---|
| 19 | #include "device.h"
|
---|
| 20 |
|
---|
| 21 | #if DEVICE_LOWPOWERTIMER
|
---|
| 22 |
|
---|
| 23 | #include "ticker_api.h"
|
---|
| 24 |
|
---|
| 25 | #ifdef __cplusplus
|
---|
| 26 | extern "C" {
|
---|
| 27 | #endif
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * \defgroup LpTicker Low Power Ticker Functions
|
---|
| 31 | * @{
|
---|
| 32 | */
|
---|
| 33 |
|
---|
| 34 | /** Get low power ticker's data
|
---|
| 35 | *
|
---|
| 36 | * @return The low power ticker data
|
---|
| 37 | */
|
---|
| 38 | const ticker_data_t* get_lp_ticker_data(void);
|
---|
| 39 |
|
---|
| 40 | /** The wrapper for ticker_irq_handler, to pass lp ticker's data
|
---|
| 41 | *
|
---|
| 42 | */
|
---|
| 43 | void lp_ticker_irq_handler(void);
|
---|
| 44 |
|
---|
| 45 | /* HAL lp ticker */
|
---|
| 46 |
|
---|
| 47 | /** Initialize the low power ticker
|
---|
| 48 | *
|
---|
| 49 | */
|
---|
| 50 | void lp_ticker_init(void);
|
---|
| 51 |
|
---|
| 52 | /** Read the current counter
|
---|
| 53 | *
|
---|
| 54 | * @return The current timer's counter value in microseconds
|
---|
| 55 | */
|
---|
| 56 | uint32_t lp_ticker_read(void);
|
---|
| 57 |
|
---|
| 58 | /** Set interrupt for specified timestamp
|
---|
| 59 | *
|
---|
| 60 | * @param timestamp The time in microseconds to be set
|
---|
| 61 | */
|
---|
| 62 | void lp_ticker_set_interrupt(timestamp_t timestamp);
|
---|
| 63 |
|
---|
| 64 | /** Disable low power ticker interrupt
|
---|
| 65 | *
|
---|
| 66 | */
|
---|
| 67 | void lp_ticker_disable_interrupt(void);
|
---|
| 68 |
|
---|
| 69 | /** Clear the low power ticker interrupt
|
---|
| 70 | *
|
---|
| 71 | */
|
---|
| 72 | void lp_ticker_clear_interrupt(void);
|
---|
| 73 |
|
---|
| 74 | /**@}*/
|
---|
| 75 |
|
---|
| 76 | #ifdef __cplusplus
|
---|
| 77 | }
|
---|
| 78 | #endif
|
---|
| 79 |
|
---|
| 80 | #endif
|
---|
| 81 |
|
---|
| 82 | #endif
|
---|