mbed library sources

Fork of mbed-src by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lp_ticker_api.h Source File

lp_ticker_api.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2015 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef MBED_LPTICKER_API_H
00017 #define MBED_LPTICKER_API_H
00018 
00019 #include "device.h"
00020 
00021 #if DEVICE_LOWPOWERTIMER
00022 
00023 #include "ticker_api.h"
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 /**
00030  * \defgroup LpTicker Low Power Ticker Functions
00031  * @{
00032  */
00033 
00034 /** Get low power ticker's data
00035  *
00036  * @return The low power ticker data
00037  */
00038 const ticker_data_t* get_lp_ticker_data(void);
00039 
00040 /** The wrapper for ticker_irq_handler, to pass lp ticker's data
00041  *
00042  */
00043 void lp_ticker_irq_handler(void);
00044 
00045 /* HAL lp ticker */
00046 
00047 /** Initialize the low power ticker
00048  *
00049  */
00050 void lp_ticker_init(void);
00051 
00052 /** Read the current counter
00053  *
00054  * @return The current timer's counter value in microseconds
00055  */
00056 uint32_t lp_ticker_read(void);
00057 
00058 /** Set interrupt for specified timestamp
00059  *
00060  * @param timestamp The time in microseconds to be set
00061  */
00062 void lp_ticker_set_interrupt(timestamp_t timestamp);
00063 
00064 /** Disable low power ticker interrupt
00065  *
00066  */
00067 void lp_ticker_disable_interrupt(void);
00068 
00069 /** Clear the low power ticker interrupt
00070  *
00071  */
00072 void lp_ticker_clear_interrupt(void);
00073 
00074 /**@}*/
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079 
00080 #endif
00081 
00082 #endif