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