• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012-2020 NXP
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef PHOSALUWB_TIMER_H
18 #define PHOSALUWB_TIMER_H
19 
20 /*
21 ************************* Include Files ****************************************
22 */
23 
24 /*
25  * Timer callback interface which will be called once registered timer
26  * time out expires.
27  *        TimerId  - Timer Id for which callback is called.
28  *        pContext - Parameter to be passed to the callback function
29  */
30 typedef void (*pphOsalUwb_TimerCallbck_t)(uint32_t TimerId, void* pContext);
31 
32 /*
33  * The Timer could not be created due to a
34  * system error */
35 #define PH_OSALUWB_TIMER_CREATE_ERROR (0X00E0)
36 
37 /*
38  * The Timer could not be started due to a
39  * system error or invalid handle */
40 #define PH_OSALUWB_TIMER_START_ERROR (0X00E1)
41 
42 /*
43  * The Timer could not be stopped due to a
44  * system error or invalid handle */
45 #define PH_OSALUWB_TIMER_STOP_ERROR (0X00E2)
46 
47 /*
48  * The Timer could not be deleted due to a
49  * system error or invalid handle */
50 #define PH_OSALUWB_TIMER_DELETE_ERROR (0X00E3)
51 
52 /*
53  * Invalid timer ID type.This ID used indicate timer creation is failed */
54 #define PH_OSALUWB_TIMER_ID_INVALID (0xFFFF)
55 
56 /*
57  * OSAL timer message .This message type will be posted to
58  * calling application thread.*/
59 #define PH_OSALUWB_TIMER_MSG (0x315)
60 
61 /*
62 ***************************Globals,Structure and Enumeration ******************
63 */
64 
65 uint32_t phOsalUwb_Timer_Create(void);
66 tHAL_UWB_STATUS phOsalUwb_Timer_Start(uint32_t dwTimerId, uint32_t dwRegTimeCnt,
67                                 pphOsalUwb_TimerCallbck_t pApplication_callback,
68                                 void* pContext);
69 tHAL_UWB_STATUS phOsalUwb_Timer_Stop(uint32_t dwTimerId);
70 tHAL_UWB_STATUS phOsalUwb_Timer_Delete(uint32_t dwTimerId);
71 void phOsalUwb_Timer_Cleanup(void);
72 uint32_t phUtilUwb_CheckForAvailableTimer(void);
73 tHAL_UWB_STATUS phOsalUwb_CheckTimerPresence(void* pObjectHandle);
74 
75 #endif /* PHOSALUWB_TIMER_H */
76