]> begriffs open source - cmsis/blob - CMSIS/RTOS2/Include/os_tick.h
RTOS2: Updated __NO_RETURN definition in cmsis_os2.h (#240)
[cmsis] / CMSIS / RTOS2 / Include / os_tick.h
1 /**************************************************************************//**
2  * @file     os_tick.h
3  * @brief    CMSIS OS Tick header file
4  * @version  V1.0.0
5  * @date     05. June 2017
6  ******************************************************************************/
7 /*
8  * Copyright (c) 2017-2017 ARM Limited. All rights reserved.
9  *
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the License); you may
13  * not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24
25 #ifndef OS_TICK_H
26 #define OS_TICK_H
27
28 #include <stdint.h>
29
30 /// IRQ Handler.
31 #ifndef IRQHANDLER_T
32 #define IRQHANDLER_T
33 typedef void (*IRQHandler_t) (void);
34 #endif
35
36 /// Setup OS Tick.
37 /// \param[in]     freq         tick frequency in Hz
38 /// \param[in]     handler      tick IRQ handler
39 /// \return 0 on success, -1 on error.
40 int32_t  OS_Tick_Setup (uint32_t freq, IRQHandler_t handler);
41
42 /// Enable OS Tick.
43 /// \return 0 on success, -1 on error.
44 int32_t  OS_Tick_Enable (void);
45
46 /// Disable OS Tick.
47 /// \return 0 on success, -1 on error.
48 int32_t  OS_Tick_Disable (void);
49
50 /// Acknowledge OS Tick IRQ.
51 /// \return 0 on success, -1 on error.
52 int32_t  OS_Tick_AcknowledgeIRQ (void);
53
54 /// Get OS Tick IRQ number.
55 /// \return OS Tick IRQ number.
56 int32_t  OS_Tick_GetIRQn (void);
57
58 /// Get OS Tick clock.
59 /// \return OS Tick clock in Hz.
60 uint32_t OS_Tick_GetClock (void);
61
62 /// Get OS Tick interval.
63 /// \return OS Tick interval.
64 uint32_t OS_Tick_GetInterval (void);
65
66 /// Get OS Tick count value.
67 /// \return OS Tick count value.
68 uint32_t OS_Tick_GetCount (void);
69
70 /// Get OS Tick overflow status.
71 /// \return OS Tick overflow status (1 - overflow, 0 - no overflow).
72 uint32_t OS_Tick_GetOverflow (void);
73
74 #endif  /* OS_TICK_H */