guiguitant théo / greenhouse1

Dependencies:   mbed

Committer:
guiguitt
Date:
Thu Mar 28 09:26:33 2019 +0000
Revision:
0:3fc4a1072bca
programme LoRaWan

Who changed what in which revision?

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