mbed-dev-f303

Committer:
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4
Date:
Tue Jun 14 09:21:18 2022 +0000
Revision:
0:bdf663c61a82
lib

Who changed what in which revision?

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