1 /**
2 ******************************************************************************
3 * @file rtl8721d_delay.h
4 * @author
5 * @version V1.0.0
6 * @date 2016-05-17
7 * @brief This file provides firmware functions to manage the following
8 * functionalities of the systimer & delay:
9 * - SYSTIMER_GetPassTime
10 * - SYSTIMER_TickGet
11 * - DelayUs
12 * - DelayMs
13 * - DelayNop
14 ******************************************************************************
15 * @attention
16 *
17 * This module is a confidential and proprietary property of RealTek and
18 * possession or use of this module requires written permission of RealTek.
19 *
20 * Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved.
21 ******************************************************************************
22 */
23
24 #ifndef _8721D_DELAY_H_
25 #define _8721D_DELAY_H_
26
27 /** @addtogroup AmebaD_Platform
28 * @{
29 */
30
31 /** @defgroup DELAY
32 * @brief DELAY driver modules
33 * @{
34 */
35
36 /** @addtogroup DELAY
37 * @verbatim
38 *****************************************************************************************
39 * Delay
40 *****************************************************************************************
41 * - DelayUs
42 * - DelayMs
43 * - DelayNop
44 *
45 *****************************************************************************************
46 * Sys Timer
47 *****************************************************************************************
48 * - TIMM00 is used as systimer, so TIMM00 can not be used for other purpose
49 * - init when boot in rom code
50 * - resolution is 31us
51 * - you can get timer tick use SYSTIMER_TickGet, every tick is 31us
52 * - you can get passing time use SYSTIMER_GetPassTime in ms
53 *
54 *****************************************************************************************
55 * @endverbatim
56 */
57
58 /** @defgroup DELAY_Exported_Functions DELAY Exported Functions
59 * @{
60 */
61 _LONG_CALL_ void SYSTIMER_Init(void);
62 _LONG_CALL_ u32 SYSTIMER_TickGet(void);
63 _LONG_CALL_ u32 SYSTIMER_GetPassTime(u32 start);
64 _LONG_CALL_ void DelayUs(u32 us);
65 _LONG_CALL_ void DelayMs(u32 ms);
66 _LONG_CALL_ void DelayNop(u32 count);
67 #define HalDelayUs DelayUs
68 /**
69 * @}
70 */
71
72 /**
73 * @}
74 */
75
76 /**
77 * @}
78 */
79
80 extern u32 RBSS_UDELAY_DIV;
81
RTIM_TestTimer_GetCount(void)82 static inline u32 RTIM_TestTimer_GetCount(void)
83 {
84 return RTIM_GetCount(TIMM05);
85 }
86
87 #endif//_8721D_DELAY_H_
88 /******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/
89