IoT Home Alarm System
Dependents: IoTBurglar_and_Fire_AlarmSystem
us_ticker_api.h@0:2f388b030837, 2016-04-29 (annotated)
- Committer:
- kbrahmbhatt6
- Date:
- Fri Apr 29 06:59:59 2016 +0000
- Revision:
- 0:2f388b030837
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kbrahmbhatt6 | 0:2f388b030837 | 1 | /* mbed Microcontroller Library |
kbrahmbhatt6 | 0:2f388b030837 | 2 | * Copyright (c) 2006-2013 ARM Limited |
kbrahmbhatt6 | 0:2f388b030837 | 3 | * |
kbrahmbhatt6 | 0:2f388b030837 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kbrahmbhatt6 | 0:2f388b030837 | 5 | * you may not use this file except in compliance with the License. |
kbrahmbhatt6 | 0:2f388b030837 | 6 | * You may obtain a copy of the License at |
kbrahmbhatt6 | 0:2f388b030837 | 7 | * |
kbrahmbhatt6 | 0:2f388b030837 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kbrahmbhatt6 | 0:2f388b030837 | 9 | * |
kbrahmbhatt6 | 0:2f388b030837 | 10 | * Unless required by applicable law or agreed to in writing, software |
kbrahmbhatt6 | 0:2f388b030837 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kbrahmbhatt6 | 0:2f388b030837 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kbrahmbhatt6 | 0:2f388b030837 | 13 | * See the License for the specific language governing permissions and |
kbrahmbhatt6 | 0:2f388b030837 | 14 | * limitations under the License. |
kbrahmbhatt6 | 0:2f388b030837 | 15 | */ |
kbrahmbhatt6 | 0:2f388b030837 | 16 | #ifndef MBED_US_TICKER_API_H |
kbrahmbhatt6 | 0:2f388b030837 | 17 | #define MBED_US_TICKER_API_H |
kbrahmbhatt6 | 0:2f388b030837 | 18 | |
kbrahmbhatt6 | 0:2f388b030837 | 19 | #include <stdint.h> |
kbrahmbhatt6 | 0:2f388b030837 | 20 | |
kbrahmbhatt6 | 0:2f388b030837 | 21 | #ifdef __cplusplus |
kbrahmbhatt6 | 0:2f388b030837 | 22 | extern "C" { |
kbrahmbhatt6 | 0:2f388b030837 | 23 | #endif |
kbrahmbhatt6 | 0:2f388b030837 | 24 | |
kbrahmbhatt6 | 0:2f388b030837 | 25 | uint32_t us_ticker_read(void); |
kbrahmbhatt6 | 0:2f388b030837 | 26 | |
kbrahmbhatt6 | 0:2f388b030837 | 27 | typedef void (*ticker_event_handler)(uint32_t id); |
kbrahmbhatt6 | 0:2f388b030837 | 28 | void us_ticker_set_handler(ticker_event_handler handler); |
kbrahmbhatt6 | 0:2f388b030837 | 29 | |
kbrahmbhatt6 | 0:2f388b030837 | 30 | typedef struct ticker_event_s { |
kbrahmbhatt6 | 0:2f388b030837 | 31 | uint32_t timestamp; |
kbrahmbhatt6 | 0:2f388b030837 | 32 | uint32_t id; |
kbrahmbhatt6 | 0:2f388b030837 | 33 | struct ticker_event_s *next; |
kbrahmbhatt6 | 0:2f388b030837 | 34 | } ticker_event_t; |
kbrahmbhatt6 | 0:2f388b030837 | 35 | |
kbrahmbhatt6 | 0:2f388b030837 | 36 | void us_ticker_init(void); |
kbrahmbhatt6 | 0:2f388b030837 | 37 | void us_ticker_set_interrupt(unsigned int timestamp); |
kbrahmbhatt6 | 0:2f388b030837 | 38 | void us_ticker_disable_interrupt(void); |
kbrahmbhatt6 | 0:2f388b030837 | 39 | void us_ticker_clear_interrupt(void); |
kbrahmbhatt6 | 0:2f388b030837 | 40 | void us_ticker_irq_handler(void); |
kbrahmbhatt6 | 0:2f388b030837 | 41 | |
kbrahmbhatt6 | 0:2f388b030837 | 42 | void us_ticker_insert_event(ticker_event_t *obj, unsigned int timestamp, uint32_t id); |
kbrahmbhatt6 | 0:2f388b030837 | 43 | void us_ticker_remove_event(ticker_event_t *obj); |
kbrahmbhatt6 | 0:2f388b030837 | 44 | |
kbrahmbhatt6 | 0:2f388b030837 | 45 | #ifdef __cplusplus |
kbrahmbhatt6 | 0:2f388b030837 | 46 | } |
kbrahmbhatt6 | 0:2f388b030837 | 47 | #endif |
kbrahmbhatt6 | 0:2f388b030837 | 48 | |
kbrahmbhatt6 | 0:2f388b030837 | 49 | #endif |