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.
Dependents: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
targets/TARGET_Realtek/TARGET_AMEBA/timer_api.h@167:e84263d55307, 2017-06-21 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Jun 21 17:46:44 2017 +0100
- Revision:
- 167:e84263d55307
This updates the lib to the mbed lib v 145
Who changed what in which revision?
| User | Revision | Line number | New 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 | 167:e84263d55307 | 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 |
