1 /*
2  * Copyright (C) 2010-2014 NXP Semiconductors
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 /*
18  * OSAL header files related to Timer functions.
19  */
20 
21 #ifndef PHOSALNFC_TIMER_H
22 #define PHOSALNFC_TIMER_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*
29 ************************* Include Files ****************************************
30 */
31 
32 
33 /*
34  * Timer callback interface which will be called once registered timer
35  * time out expires.
36  *        TimerId  - Timer Id for which callback is called.
37  *        pContext - Parameter to be passed to the callback function
38  */
39 typedef void (*pphOsalNfc_TimerCallbck_t)(uint32_t TimerId, void *pContext);
40 
41 /*
42  * The Timer could not be created due to a
43  * system error */
44 #define PH_OSALNFC_TIMER_CREATE_ERROR                   (0X00E0)
45 
46 /*
47  * The Timer could not be started due to a
48  * system error or invalid handle */
49 #define PH_OSALNFC_TIMER_START_ERROR                    (0X00E1)
50 
51 /*
52  * The Timer could not be stopped due to a
53  * system error or invalid handle */
54 #define PH_OSALNFC_TIMER_STOP_ERROR                     (0X00E2)
55 
56 /*
57  * The Timer could not be deleted due to a
58  * system error or invalid handle */
59 #define PH_OSALNFC_TIMER_DELETE_ERROR                   (0X00E3)
60 
61 /*
62  * Invalid timer ID type.This ID used indicate timer creation is failed */
63 #define PH_OSALNFC_TIMER_ID_INVALID                     (0xFFFF)
64 
65 /*
66  * OSAL timer message .This message type will be posted to
67  * calling application thread.*/
68 #define PH_OSALNFC_TIMER_MSG                            (0x315)
69 
70 /*
71 ***************************Globals,Structure and Enumeration ******************
72 */
73 
74 uint32_t phOsalNfc_Timer_Create(void);
75 NFCSTATUS phOsalNfc_Timer_Start(uint32_t dwTimerId, uint32_t dwRegTimeCnt, pphOsalNfc_TimerCallbck_t pApplication_callback, void *pContext);
76 NFCSTATUS phOsalNfc_Timer_Stop(uint32_t dwTimerId);
77 NFCSTATUS phOsalNfc_Timer_Delete(uint32_t dwTimerId);
78 void phOsalNfc_Timer_Cleanup(void);
79 uint32_t phUtilNfc_CheckForAvailableTimer(void);
80 NFCSTATUS phOsalNfc_CheckTimerPresence(void *pObjectHandle);
81 
82 
83 #ifdef __cplusplus
84 }
85 #endif /*  C++ Compilation guard */
86 #endif /* PHOSALNFC_TIMER_H */
87