1 |
|
---|
2 | /** \addtogroup hal */
|
---|
3 | /** @{*/
|
---|
4 | /* mbed Microcontroller Library
|
---|
5 | * Copyright (c) 2006-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_US_TICKER_API_H
|
---|
20 | #define MBED_US_TICKER_API_H
|
---|
21 |
|
---|
22 | #include <stdint.h>
|
---|
23 | #include "hal/ticker_api.h"
|
---|
24 |
|
---|
25 | #ifdef __cplusplus
|
---|
26 | extern "C" {
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * \defgroup hal_UsTicker Microseconds Ticker Functions
|
---|
31 | * @{
|
---|
32 | */
|
---|
33 |
|
---|
34 | /** Get ticker's data
|
---|
35 | *
|
---|
36 | * @return The low power ticker data
|
---|
37 | */
|
---|
38 | const ticker_data_t* get_us_ticker_data(void);
|
---|
39 |
|
---|
40 |
|
---|
41 | /** The wrapper for ticker_irq_handler, to pass us ticker's data
|
---|
42 | *
|
---|
43 | */
|
---|
44 | void us_ticker_irq_handler(void);
|
---|
45 |
|
---|
46 | /* HAL us ticker */
|
---|
47 |
|
---|
48 | /** Initialize the ticker
|
---|
49 | *
|
---|
50 | */
|
---|
51 | void us_ticker_init(void);
|
---|
52 |
|
---|
53 | /** Read the current counter
|
---|
54 | *
|
---|
55 | * @return The current timer's counter value in microseconds
|
---|
56 | */
|
---|
57 | uint32_t us_ticker_read(void);
|
---|
58 |
|
---|
59 | /** Set interrupt for specified timestamp
|
---|
60 | *
|
---|
61 | * @param timestamp The time in microseconds to be set
|
---|
62 | */
|
---|
63 | void us_ticker_set_interrupt(timestamp_t timestamp);
|
---|
64 |
|
---|
65 | /** Disable us ticker interrupt
|
---|
66 | *
|
---|
67 | */
|
---|
68 | void us_ticker_disable_interrupt(void);
|
---|
69 |
|
---|
70 | /** Clear us ticker interrupt
|
---|
71 | *
|
---|
72 | */
|
---|
73 | void us_ticker_clear_interrupt(void);
|
---|
74 |
|
---|
75 | /**@}*/
|
---|
76 |
|
---|
77 | #ifdef __cplusplus
|
---|
78 | }
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | #endif
|
---|
82 |
|
---|
83 | /** @}*/
|
---|