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