Elijah Stanger-Jones / mbed-dev-f303
Committer:
elijahsj
Date:
Mon Nov 09 00:02:47 2020 -0500
Revision:
1:8a094db1347f
test

Who changed what in which revision?

UserRevisionLine numberNew 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/lp_ticker_api.h"
elijahsj 1:8a094db1347f 17
elijahsj 1:8a094db1347f 18 #if DEVICE_LOWPOWERTIMER
elijahsj 1:8a094db1347f 19
elijahsj 1:8a094db1347f 20 static ticker_event_queue_t events = { 0 };
elijahsj 1:8a094db1347f 21
elijahsj 1:8a094db1347f 22 static const ticker_interface_t lp_interface = {
elijahsj 1:8a094db1347f 23 .init = lp_ticker_init,
elijahsj 1:8a094db1347f 24 .read = lp_ticker_read,
elijahsj 1:8a094db1347f 25 .disable_interrupt = lp_ticker_disable_interrupt,
elijahsj 1:8a094db1347f 26 .clear_interrupt = lp_ticker_clear_interrupt,
elijahsj 1:8a094db1347f 27 .set_interrupt = lp_ticker_set_interrupt,
elijahsj 1:8a094db1347f 28 .fire_interrupt = lp_ticker_fire_interrupt,
elijahsj 1:8a094db1347f 29 };
elijahsj 1:8a094db1347f 30
elijahsj 1:8a094db1347f 31 static const ticker_data_t lp_data = {
elijahsj 1:8a094db1347f 32 .interface = &lp_interface,
elijahsj 1:8a094db1347f 33 .queue = &events,
elijahsj 1:8a094db1347f 34 };
elijahsj 1:8a094db1347f 35
elijahsj 1:8a094db1347f 36 const ticker_data_t* get_lp_ticker_data(void)
elijahsj 1:8a094db1347f 37 {
elijahsj 1:8a094db1347f 38 return &lp_data;
elijahsj 1:8a094db1347f 39 }
elijahsj 1:8a094db1347f 40
elijahsj 1:8a094db1347f 41 void lp_ticker_irq_handler(void)
elijahsj 1:8a094db1347f 42 {
elijahsj 1:8a094db1347f 43 ticker_irq_handler(&lp_data);
elijahsj 1:8a094db1347f 44 }
elijahsj 1:8a094db1347f 45
elijahsj 1:8a094db1347f 46 #endif