• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------------
2  * Copyright (c) Huawei Technologies Co., Ltd. 2013-2018. All rights reserved.
3  * Description: Tick
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  * 1. Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
9  * of conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * 3. Neither the name of the copyright holder nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  * --------------------------------------------------------------------------- */
26 
27 #ifndef _LOS_TICK_PRI_H
28 #define _LOS_TICK_PRI_H
29 
30 #include "los_tick.h"
31 
32 #ifdef __cplusplus
33 #if __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36 #endif /* __cplusplus */
37 
38 #define SYSTEM_CLOCK_FREQ_24M    24
39 #define SYSTEM_CLOCK_FREQ_40M    40
40 
41 /**
42  * @ingroup los_tick
43  * Count of Ticks
44  */
45 extern UINT64 g_tickCount;
46 
47 /**
48  * @ingroup los_tick
49  * Ticks per second
50  */
51 extern UINT32 g_ticksPerSec;
52 
53 /**
54  * @ingroup los_tick
55  * Cycles per Tick
56  */
57 extern UINT32 g_cyclesPerTick;
58 
59 extern UINT32 g_sysClock;
60 /**
61  * @ingroup  los_tick
62  * @brief Handle the system tick timeout.
63  *
64  * @par Description:
65  * This API is called when the system tick timeout and triggers the interrupt.
66  *
67  * @attention
68  * <ul>
69  * <li>None.</li>
70  * </ul>
71  *
72  * @param none.
73  *
74  * @retval None.
75  * @par Dependency:
76  * <ul><li>los_tick_pri.h: the header file that contains the API declaration.</li></ul>
77  * @see None.
78  */
79 extern VOID OsTickHandler(VOID);
80 extern UINT32 OsTimerInit(VOID);
81 extern VOID OsTimerDisable(VOID);
82 extern VOID OsTimerStop(VOID);
83 extern VOID OsTimerStart(VOID);
84 extern LITE_OS_RAM_SECTION VOID OsPlatformTickHandler(VOID);
85 extern VOID OsPlatformGetCycle(UINT32 *cntHigh, UINT32 *cntLow);
86 extern UINT32* OsTimerGetFirstTick(VOID);
87 extern UINT32 OsTimerGetReloadValue(VOID);
88 #ifdef __cplusplus
89 #if __cplusplus
90 }
91 #endif /* __cplusplus */
92 #endif /* __cplusplus */
93 
94 #endif /* _LOS_TICK_PRI_H */
95