mbed library for NZ32-SC151

Committer:
modtronix
Date:
Fri Jul 24 21:01:44 2015 +1000
Revision:
1:71204b8406f2
Current mbed v103 (594)

Who changed what in which revision?

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