1 | /* mbed Microcontroller Library
|
---|
2 | * Copyright (c) 2015 ARM Limited
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 | #include "us_ticker_api.h"
|
---|
17 |
|
---|
18 | static ticker_event_queue_t events;
|
---|
19 |
|
---|
20 | static const ticker_interface_t us_interface = {
|
---|
21 | .init = us_ticker_init,
|
---|
22 | .read = us_ticker_read,
|
---|
23 | .disable_interrupt = us_ticker_disable_interrupt,
|
---|
24 | .clear_interrupt = us_ticker_clear_interrupt,
|
---|
25 | .set_interrupt = us_ticker_set_interrupt,
|
---|
26 | };
|
---|
27 |
|
---|
28 | static const ticker_data_t us_data = {
|
---|
29 | .interface = &us_interface,
|
---|
30 | .queue = &events,
|
---|
31 | };
|
---|
32 |
|
---|
33 | const ticker_data_t* get_us_ticker_data(void)
|
---|
34 | {
|
---|
35 | return &us_data;
|
---|
36 | }
|
---|
37 |
|
---|
38 | void us_ticker_irq_handler(void)
|
---|
39 | {
|
---|
40 | ticker_irq_handler(&us_data);
|
---|
41 | }
|
---|