TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

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