1 /**************************************************************************//**
3 * @brief CMSIS OS Tick header file
6 ******************************************************************************/
8 * Copyright (c) 2017-2021 ARM Limited. All rights reserved.
10 * SPDX-License-Identifier: Apache-2.0
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
16 * www.apache.org/licenses/LICENSE-2.0
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.
38 typedef void (*IRQHandler_t) (void);
41 /// Setup OS Tick timer to generate periodic RTOS Kernel Ticks
42 /// \param[in] freq tick frequency in Hz
43 /// \param[in] handler tick IRQ handler
44 /// \return 0 on success, -1 on error.
45 int32_t OS_Tick_Setup (uint32_t freq, IRQHandler_t handler);
47 /// Enable OS Tick timer interrupt
48 void OS_Tick_Enable (void);
50 /// Disable OS Tick timer interrupt
51 void OS_Tick_Disable (void);
53 /// Acknowledge execution of OS Tick timer interrupt
54 void OS_Tick_AcknowledgeIRQ (void);
56 /// Get OS Tick timer IRQ number
57 /// \return OS Tick IRQ number
58 int32_t OS_Tick_GetIRQn (void);
60 /// Get OS Tick timer clock frequency
61 /// \return OS Tick timer clock frequency in Hz
62 uint32_t OS_Tick_GetClock (void);
64 /// Get OS Tick timer interval reload value
65 /// \return OS Tick timer interval reload value
66 uint32_t OS_Tick_GetInterval (void);
68 /// Get OS Tick timer counter value
69 /// \return OS Tick timer counter value
70 uint32_t OS_Tick_GetCount (void);
72 /// Get OS Tick timer overflow status
73 /// \return OS Tick overflow status (1 - overflow, 0 - no overflow).
74 uint32_t OS_Tick_GetOverflow (void);
80 #endif /* OS_TICK_H */