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