Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
hal/mbed_us_ticker_api.c@2:4364577b5ad8, 2020-11-09 (annotated)
- Committer:
- elijahsj
- Date:
- Mon Nov 09 00:33:19 2020 -0500
- Revision:
- 2:4364577b5ad8
- Parent:
- 1:8a094db1347f
copied mbed library
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| elijahsj | 1:8a094db1347f | 1 | /* mbed Microcontroller Library |
| elijahsj | 1:8a094db1347f | 2 | * Copyright (c) 2015 ARM Limited |
| elijahsj | 1:8a094db1347f | 3 | * |
| elijahsj | 1:8a094db1347f | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| elijahsj | 1:8a094db1347f | 5 | * you may not use this file except in compliance with the License. |
| elijahsj | 1:8a094db1347f | 6 | * You may obtain a copy of the License at |
| elijahsj | 1:8a094db1347f | 7 | * |
| elijahsj | 1:8a094db1347f | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| elijahsj | 1:8a094db1347f | 9 | * |
| elijahsj | 1:8a094db1347f | 10 | * Unless required by applicable law or agreed to in writing, software |
| elijahsj | 1:8a094db1347f | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| elijahsj | 1:8a094db1347f | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| elijahsj | 1:8a094db1347f | 13 | * See the License for the specific language governing permissions and |
| elijahsj | 1:8a094db1347f | 14 | * limitations under the License. |
| elijahsj | 1:8a094db1347f | 15 | */ |
| elijahsj | 1:8a094db1347f | 16 | #include "hal/us_ticker_api.h" |
| elijahsj | 1:8a094db1347f | 17 | |
| elijahsj | 1:8a094db1347f | 18 | static ticker_event_queue_t events = { 0 }; |
| elijahsj | 1:8a094db1347f | 19 | |
| elijahsj | 1:8a094db1347f | 20 | static const ticker_interface_t us_interface = { |
| elijahsj | 1:8a094db1347f | 21 | .init = us_ticker_init, |
| elijahsj | 1:8a094db1347f | 22 | .read = us_ticker_read, |
| elijahsj | 1:8a094db1347f | 23 | .disable_interrupt = us_ticker_disable_interrupt, |
| elijahsj | 1:8a094db1347f | 24 | .clear_interrupt = us_ticker_clear_interrupt, |
| elijahsj | 1:8a094db1347f | 25 | .set_interrupt = us_ticker_set_interrupt, |
| elijahsj | 1:8a094db1347f | 26 | .fire_interrupt = us_ticker_fire_interrupt, |
| elijahsj | 1:8a094db1347f | 27 | }; |
| elijahsj | 1:8a094db1347f | 28 | |
| elijahsj | 1:8a094db1347f | 29 | static const ticker_data_t us_data = { |
| elijahsj | 1:8a094db1347f | 30 | .interface = &us_interface, |
| elijahsj | 1:8a094db1347f | 31 | .queue = &events |
| elijahsj | 1:8a094db1347f | 32 | }; |
| elijahsj | 1:8a094db1347f | 33 | |
| elijahsj | 1:8a094db1347f | 34 | const ticker_data_t* get_us_ticker_data(void) |
| elijahsj | 1:8a094db1347f | 35 | { |
| elijahsj | 1:8a094db1347f | 36 | return &us_data; |
| elijahsj | 1:8a094db1347f | 37 | } |
| elijahsj | 1:8a094db1347f | 38 | |
| elijahsj | 1:8a094db1347f | 39 | void us_ticker_irq_handler(void) |
| elijahsj | 1:8a094db1347f | 40 | { |
| elijahsj | 1:8a094db1347f | 41 | ticker_irq_handler(&us_data); |
| elijahsj | 1:8a094db1347f | 42 | } |