blob: 8ae3555441ffb41d89119f8cc6710cdf56724630 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright by ZTE Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: v0.1
9 * Author: shideyou
10 * Date: 2013-6-29
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _DRVS_LPM_H
20#define _DRVS_LPM_H
21
22
23/****************************************************************************
24* Include files
25****************************************************************************/
26//#include "drvs_general.h"
27#include "drvs_dpram.h"
28
29
30/****************************************************************************
31* Macros
32****************************************************************************/
33
34/****************************************************************************
35* Types
36****************************************************************************/
37 typedef enum
38{
39 LPM_RAT_TD,
40 LPM_RAT_LTE,
41 LPM_RAT_W,
42 LPM_T4_RAT_TD,
43 LPM_T4_RAT_W,
44 LPM_T2_RAT_LTE,
45
46 MAX_LPM_RAT
47} T_ZDrvLpm_RAT;
48
49typedef struct
50{
51 UINT16 wWFrmCnt; /*0~4095 Fn*/
52 UINT16 wWSlotCnt; /*0~14 slot*/
53 UINT16 wWSymbolCnt; /*0~9 symbol*/
54 UINT16 wWChipCnt; /*0~255 chip*/
55}T_WLpmTime;
56
57typedef struct
58{
59 UINT16 wTdFrmCnt; /*0~8191 Fn*/
60 UINT16 wTdChipCnt; /*0~6400 chip*/
61}T_TdLpmTime;
62
63typedef struct
64{
65 UINT16 wLteSuperFrmCnt;
66 UINT16 wLteFrmCnt;
67 UINT16 wLteSubFrmCnt;
68}T_LteLpmTime;
69
70
71typedef VOID (*T_ZDrvLpm_CallbackFunction)(VOID); //used for LTE
72
73/****************************************************************************
74* Constants
75****************************************************************************/
76
77/****************************************************************************
78* Global Variables
79****************************************************************************/
80
81/****************************************************************************
82* Function Prototypes
83****************************************************************************/
84/*******************************************************************************
85 * Function: zDrvLpm_RegCallbackForLTE
86 * Description: regist callback function for LTE_lpm interrupt
87 * Parameters:
88 * Input:
89 * callback: function be register
90 * Output:
91 * None
92 * Returns:
93 * DRV_ERROR:interrupt install failed
94 * Drv_SUCCESS:successful!
95 *
96 * Others:
97 ********************************************************************************/
98SINT32 zDrvLpm_RegCallbackForLTE(T_ZDrvLpm_CallbackFunction callback);
99
100/*******************************************************************************
101 * Function: zDrvLpm_RegCallbackForTD
102 * Description: regist callback function for TD_lpm interrupt
103 * Parameters:
104 * Input:
105 * callback: function be register
106 * Output:
107 * None
108 * Returns:
109 * DRV_ERROR:interrupt install failed
110 * Drv_SUCCESS:successful!
111 *
112 * Others:
113 ********************************************************************************/
114 SINT32 zDrvLpm_RegCallbackForTD(T_ZDrvLpm_CallbackFunction callback);
115
116 /*******************************************************************************
117 * Function: zDrvLpm_RegCallbackForW
118 * Description: regist callback function for W_lpm interrupt
119 * Parameters:
120 * Input:
121 * callback: function be register
122 * Output:
123 * None
124 * Returns:
125 * DRV_ERROR:interrupt install failed
126 * Drv_SUCCESS:successful!
127 *
128 * Others:
129 ********************************************************************************/
130 SINT32 zDrvLpm_RegCallbackForW(T_ZDrvLpm_CallbackFunction callback);
131/*******************************************************************************
132 * Function: zDrvLpm_IrqEnable
133 * Description: enable interrupt of lpm
134 * Parameters:
135 * Input:
136 * rat: TD/W/LTE
137 * Output:
138 * None
139 * Returns:
140 * None
141 *
142 * Others:
143 ********************************************************************************/
144VOID zDrvLpm_IrqEnable(T_ZDrvLpm_RAT rat);
145
146/*******************************************************************************
147 * Function: zDrvLpm_IrqDisable
148 * Description: disable interrupt of lpm
149 * Parameters:
150 * Input:
151 * rat: TD/W/LTE
152 * Output:
153 * None
154 * Returns:
155 * None
156 *
157 * Others:
158 ********************************************************************************/
159VOID zDrvLpm_IrqDisable(T_ZDrvLpm_RAT rat);
160
161/**************************************************************************
162* º¯ÊýÃû³Æ£º lpm_WDpramSfnIsValid
163* ¹¦ÄÜÃèÊö£º »ñÈ¡WDpramÄÚÖ¡ºÅÐÅÏ¢ÊÇ·ñÓÐЧ
164* ²ÎÊý˵Ã÷£º
165* ·µ »Ø Öµ £ºTRUE ÓÐЧ£» FALSE ÎÞЧ
166* ÆäËü˵Ã÷£º
167**************************************************************************/
168BOOL zDrvLpm_WDpramSfnIsValid(void);
169
170/**************************************************************************
171* º¯ÊýÃû³Æ£º Lpm_GetWCfnSfn
172* ¹¦ÄÜÃèÊö£º PS»ñÈ¡WÖ¡ºÅµ÷¶ÈÐÅÏ¢
173* ²ÎÊý˵Ã÷£º
174* ·µ »Ø Öµ £º
175* ÆäËü˵Ã÷£º
176**************************************************************************/
177VOID zDrvLpm_GetWCfnSfn(T_ZDrvDpram_CfnSfnForW* ptCfnSfn);
178/**************************************************************************
179* º¯ÊýÃû³Æ£º zDrvLpm_GetSfn_Lte
180* ¹¦ÄÜÃèÊö£º PS»ñÈ¡LTEÖ¡ºÅÐÅÏ¢
181* ²ÎÊý˵Ã÷£º
182* ·µ »Ø Öµ £º
183* ÆäËü˵Ã÷£º
184**************************************************************************/
185UINT32 zDrvLpm_GetSfn_Lte(VOID);
186
187/**************************************************************************
188* º¯ÊýÃû³Æ£º zDrvLpm_TdDpramSfnIsValid
189* ¹¦ÄÜÃèÊö£º »ñÈ¡TdDpramÄÚÖ¡ºÅÐÅÏ¢ÊÇ·ñÓÐЧ
190* ²ÎÊý˵Ã÷£º
191* ·µ »Ø Öµ £ºTRUE ÓÐЧ£» FALSE ÎÞЧ
192* ÆäËü˵Ã÷£º
193**************************************************************************/
194BOOL zDrvLpm_TdDpramSfnIsValid(void);
195
196/**************************************************************************
197* º¯ÊýÃû³Æ£º zDrvLpm_GetTdCfnSfn
198* ¹¦ÄÜÃèÊö£º PS»ñÈ¡TDÖ¡ºÅµ÷¶ÈÐÅÏ¢
199* ²ÎÊý˵Ã÷£º
200* ·µ »Ø Öµ £ºTD NT ×ÓÖ¡ºÅ\Cfn
201* ÆäËü˵Ã÷£º
202**************************************************************************/
203VOID zDrvLpm_GetTdCfnSfn(T_ZDrvDpram_CfnSfn* ptTdCfnSfn);
204
205#endif/*_FILENAME_H*/
206