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.
simple-mbed-cloud-client/mbed-cloud-client/sal-stack-nanostack-eventloop/source/timer_sys.h@0:8f0bb79ddd48, 2021-05-04 (annotated)
- Committer:
- leothedragon
- Date:
- Tue May 04 08:55:12 2021 +0000
- Revision:
- 0:8f0bb79ddd48
nmn
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
leothedragon | 0:8f0bb79ddd48 | 1 | /* |
leothedragon | 0:8f0bb79ddd48 | 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. |
leothedragon | 0:8f0bb79ddd48 | 3 | * SPDX-License-Identifier: Apache-2.0 |
leothedragon | 0:8f0bb79ddd48 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
leothedragon | 0:8f0bb79ddd48 | 5 | * not use this file except in compliance with the License. |
leothedragon | 0:8f0bb79ddd48 | 6 | * You may obtain a copy of the License at |
leothedragon | 0:8f0bb79ddd48 | 7 | * |
leothedragon | 0:8f0bb79ddd48 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
leothedragon | 0:8f0bb79ddd48 | 9 | * |
leothedragon | 0:8f0bb79ddd48 | 10 | * Unless required by applicable law or agreed to in writing, software |
leothedragon | 0:8f0bb79ddd48 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
leothedragon | 0:8f0bb79ddd48 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
leothedragon | 0:8f0bb79ddd48 | 13 | * See the License for the specific language governing permissions and |
leothedragon | 0:8f0bb79ddd48 | 14 | * limitations under the License. |
leothedragon | 0:8f0bb79ddd48 | 15 | */ |
leothedragon | 0:8f0bb79ddd48 | 16 | #ifndef _PL_NANO_TIMER_SYS_H_ |
leothedragon | 0:8f0bb79ddd48 | 17 | #define _PL_NANO_TIMER_SYS_H_ |
leothedragon | 0:8f0bb79ddd48 | 18 | |
leothedragon | 0:8f0bb79ddd48 | 19 | #ifdef __cplusplus |
leothedragon | 0:8f0bb79ddd48 | 20 | extern "C" { |
leothedragon | 0:8f0bb79ddd48 | 21 | #endif |
leothedragon | 0:8f0bb79ddd48 | 22 | |
leothedragon | 0:8f0bb79ddd48 | 23 | #include "eventOS_event.h" |
leothedragon | 0:8f0bb79ddd48 | 24 | |
leothedragon | 0:8f0bb79ddd48 | 25 | /* We borrow base event storage, including its list link, and add a time field */ |
leothedragon | 0:8f0bb79ddd48 | 26 | typedef struct sys_timer_struct_s { |
leothedragon | 0:8f0bb79ddd48 | 27 | arm_event_storage_t event; |
leothedragon | 0:8f0bb79ddd48 | 28 | uint32_t launch_time; // tick value |
leothedragon | 0:8f0bb79ddd48 | 29 | uint32_t period; |
leothedragon | 0:8f0bb79ddd48 | 30 | } sys_timer_struct_s; |
leothedragon | 0:8f0bb79ddd48 | 31 | |
leothedragon | 0:8f0bb79ddd48 | 32 | |
leothedragon | 0:8f0bb79ddd48 | 33 | /** |
leothedragon | 0:8f0bb79ddd48 | 34 | * Initialize system timer |
leothedragon | 0:8f0bb79ddd48 | 35 | * */ |
leothedragon | 0:8f0bb79ddd48 | 36 | extern void timer_sys_init(void); |
leothedragon | 0:8f0bb79ddd48 | 37 | |
leothedragon | 0:8f0bb79ddd48 | 38 | extern uint32_t timer_get_runtime_ticks(void); |
leothedragon | 0:8f0bb79ddd48 | 39 | int8_t timer_sys_wakeup(void); |
leothedragon | 0:8f0bb79ddd48 | 40 | void timer_sys_disable(void); |
leothedragon | 0:8f0bb79ddd48 | 41 | void timer_sys_event_free(struct arm_event_storage *event); |
leothedragon | 0:8f0bb79ddd48 | 42 | |
leothedragon | 0:8f0bb79ddd48 | 43 | // This require lock to be held |
leothedragon | 0:8f0bb79ddd48 | 44 | void timer_sys_event_cancel_critical(struct arm_event_storage *event); |
leothedragon | 0:8f0bb79ddd48 | 45 | |
leothedragon | 0:8f0bb79ddd48 | 46 | /** |
leothedragon | 0:8f0bb79ddd48 | 47 | * System Timer update and synch after sleep |
leothedragon | 0:8f0bb79ddd48 | 48 | * |
leothedragon | 0:8f0bb79ddd48 | 49 | * \param ticks Time in 10 ms resolution |
leothedragon | 0:8f0bb79ddd48 | 50 | * |
leothedragon | 0:8f0bb79ddd48 | 51 | * \return none |
leothedragon | 0:8f0bb79ddd48 | 52 | * |
leothedragon | 0:8f0bb79ddd48 | 53 | * */ |
leothedragon | 0:8f0bb79ddd48 | 54 | void system_timer_tick_update(uint32_t ticks); |
leothedragon | 0:8f0bb79ddd48 | 55 | |
leothedragon | 0:8f0bb79ddd48 | 56 | #ifdef __cplusplus |
leothedragon | 0:8f0bb79ddd48 | 57 | } |
leothedragon | 0:8f0bb79ddd48 | 58 | #endif |
leothedragon | 0:8f0bb79ddd48 | 59 | |
leothedragon | 0:8f0bb79ddd48 | 60 | #endif /*_PL_NANO_TIMER_SYS_H_*/ |