TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

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