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