mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/timer_api.h@188:bcfe06ba3d64
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 167:e84263d55307 1 /* mbed Microcontroller Library
AnnaBridge 167:e84263d55307 2 * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
AnnaBridge 167:e84263d55307 3 *
AnnaBridge 167:e84263d55307 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 167:e84263d55307 5 * you may not use this file except in compliance with the License.
AnnaBridge 167:e84263d55307 6 * You may obtain a copy of the License at
AnnaBridge 167:e84263d55307 7 *
AnnaBridge 167:e84263d55307 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 167:e84263d55307 9 *
AnnaBridge 167:e84263d55307 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 167:e84263d55307 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 167:e84263d55307 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 167:e84263d55307 13 * See the License for the specific language governing permissions and
AnnaBridge 167:e84263d55307 14 * limitations under the License.
AnnaBridge 167:e84263d55307 15 */
AnnaBridge 167:e84263d55307 16
AnnaBridge 167:e84263d55307 17 #ifndef MBED_EXT_TIMER_API_EXT_H
AnnaBridge 167:e84263d55307 18 #define MBED_EXT_TIMER_API_EXT_H
AnnaBridge 167:e84263d55307 19
AnnaBridge 167:e84263d55307 20 #include "device.h"
AnnaBridge 167:e84263d55307 21
AnnaBridge 167:e84263d55307 22 typedef void (*gtimer_irq_handler)(uint32_t id);
AnnaBridge 167:e84263d55307 23
AnnaBridge 167:e84263d55307 24 typedef struct gtimer_s gtimer_t;
AnnaBridge 167:e84263d55307 25 enum {
AnnaBridge 167:e84263d55307 26 TIMER0 = 2, // GTimer 2, share with PWM_3
AnnaBridge 167:e84263d55307 27 TIMER1 = 3, // GTimer 3, share with PWM_0
AnnaBridge 167:e84263d55307 28 TIMER2 = 4, // GTimer 4, share with PWM_1
AnnaBridge 167:e84263d55307 29 TIMER3 = 5, // GTimer 5, share with PWM_2
AnnaBridge 167:e84263d55307 30 TIMER4 = 0, // GTimer 0, share with software-RTC functions
AnnaBridge 167:e84263d55307 31
AnnaBridge 188:bcfe06ba3d64 32 GTIMER_MAX = 5
AnnaBridge 167:e84263d55307 33 };
AnnaBridge 167:e84263d55307 34
AnnaBridge 167:e84263d55307 35 void gtimer_init (gtimer_t *obj, uint32_t tid);
AnnaBridge 167:e84263d55307 36 void gtimer_deinit (gtimer_t *obj);
AnnaBridge 167:e84263d55307 37 uint32_t gtimer_read_tick (gtimer_t *obj);
AnnaBridge 167:e84263d55307 38 uint64_t gtimer_read_us (gtimer_t *obj);
AnnaBridge 167:e84263d55307 39 void gtimer_reload (gtimer_t *obj, uint32_t duration_us);
AnnaBridge 167:e84263d55307 40 void gtimer_start (gtimer_t *obj);
AnnaBridge 167:e84263d55307 41 void gtimer_start_one_shout (gtimer_t *obj, uint32_t duration_us, void* handler, uint32_t hid);
AnnaBridge 167:e84263d55307 42 void gtimer_start_periodical (gtimer_t *obj, uint32_t duration_us, void* handler, uint32_t hid);
AnnaBridge 167:e84263d55307 43 void gtimer_stop (gtimer_t *obj);
AnnaBridge 167:e84263d55307 44
AnnaBridge 167:e84263d55307 45 #endif
AnnaBridge 167:e84263d55307 46