The official mbed C/C SDK provides the software platform and libraries to build your applications.

Fork of mbed by mbed official

Committer:
ldyz
Date:
Fri Jul 05 13:16:13 2013 +0000
Revision:
64:75c1708b266b
Parent:
62:7e6c9f46b3bd
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 44:24d45a770a51 1 /* mbed Microcontroller Library
emilmont 54:71b101360fb9 2 * Copyright (c) 2006-2013 ARM Limited
emilmont 44:24d45a770a51 3 *
emilmont 59:0883845fe643 4 * Licensed under the Apache License, Version 2.0 (the "License");
emilmont 59:0883845fe643 5 * you may not use this file except in compliance with the License.
emilmont 59:0883845fe643 6 * You may obtain a copy of the License at
emilmont 59:0883845fe643 7 *
emilmont 59:0883845fe643 8 * http://www.apache.org/licenses/LICENSE-2.0
emilmont 44:24d45a770a51 9 *
emilmont 59:0883845fe643 10 * Unless required by applicable law or agreed to in writing, software
emilmont 59:0883845fe643 11 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 59:0883845fe643 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 59:0883845fe643 13 * See the License for the specific language governing permissions and
emilmont 59:0883845fe643 14 * limitations under the License.
emilmont 44:24d45a770a51 15 */
emilmont 40:976df7c37ad5 16 #ifndef MBED_US_TICKER_API_H
emilmont 40:976df7c37ad5 17 #define MBED_US_TICKER_API_H
emilmont 40:976df7c37ad5 18
emilmont 40:976df7c37ad5 19 #include <stdint.h>
emilmont 40:976df7c37ad5 20
emilmont 40:976df7c37ad5 21 #ifdef __cplusplus
emilmont 40:976df7c37ad5 22 extern "C" {
emilmont 44:24d45a770a51 23 #endif
emilmont 40:976df7c37ad5 24
emilmont 40:976df7c37ad5 25 uint32_t us_ticker_read(void);
emilmont 40:976df7c37ad5 26
emilmont 44:24d45a770a51 27 typedef void (*ticker_event_handler)(uint32_t id);
emilmont 44:24d45a770a51 28 void us_ticker_set_handler(ticker_event_handler handler);
emilmont 44:24d45a770a51 29
emilmont 44:24d45a770a51 30 typedef struct ticker_event_s {
emilmont 44:24d45a770a51 31 uint32_t timestamp;
emilmont 44:24d45a770a51 32 uint32_t id;
emilmont 44:24d45a770a51 33 struct ticker_event_s *next;
emilmont 44:24d45a770a51 34 } ticker_event_t;
emilmont 44:24d45a770a51 35
emilmont 62:7e6c9f46b3bd 36 void us_ticker_init(void);
emilmont 62:7e6c9f46b3bd 37 void us_ticker_set_interrupt(unsigned int timestamp);
emilmont 62:7e6c9f46b3bd 38 void us_ticker_disable_interrupt(void);
emilmont 62:7e6c9f46b3bd 39 void us_ticker_clear_interrupt(void);
emilmont 62:7e6c9f46b3bd 40 void us_ticker_irq_handler(void);
emilmont 62:7e6c9f46b3bd 41
emilmont 44:24d45a770a51 42 void us_ticker_insert_event(ticker_event_t *obj, unsigned int timestamp, uint32_t id);
emilmont 44:24d45a770a51 43 void us_ticker_remove_event(ticker_event_t *obj);
emilmont 44:24d45a770a51 44
emilmont 40:976df7c37ad5 45 #ifdef __cplusplus
emilmont 40:976df7c37ad5 46 }
emilmont 44:24d45a770a51 47 #endif
emilmont 40:976df7c37ad5 48
emilmont 40:976df7c37ad5 49 #endif