2 * Copyright (C) 2010 NXP Semiconductors
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * \file phLlcNfc_Timer.h
19 * \brief To create, start, stop and destroy timer.
21 * Project: NFC-FRI-1.1
23 * $Date: Thu Jun 10 17:26:41 2010 $
26 * $Aliases: NFC_FRI1.1_WK1023_R35_1 $
30 #ifndef PHLLCNFC_TIMER_H
31 #define PHLLCNFC_TIMER_H
34 * \name LLC NFC state machine handling
36 * File: \ref phLlcNfc_StateMachine.h
40 #define PH_LLCNFC_TIMER_FILEREVISION "$Revision: 1.14 $" /**< \ingroup grp_hal_nfc_llc_helper */
41 #define PH_LLCNFC_TIMER_FILEALIASES "$Aliases: NFC_FRI1.1_WK1023_R35_1 $" /**< \ingroup grp_hal_nfc_llc_helper */
43 /*************************** Includes *******************************/
45 /*********************** End of includes ****************************/
47 /***************************** Macros *******************************/
48 #define PH_LLCNFC_CONNECTIONTIMER (0x00) /**< Timer for connection time out */
49 #define PH_LLCNFC_GUARDTIMER (0x01) /**< Timer for guard time out */
50 #define PH_LLCNFC_ACKTIMER (0x02) /**< Timer for ack time out */
51 #define PH_LLCNFC_MAX_RETRY_COUNT (0x03) /**< Retries */
52 /** Resolution value for the timer */
53 #define PH_LLCNFC_RESOLUTION TIMER_RESOLUTION
54 /**< 0x05 Timer for connection time out value */
55 #define PH_LLCNFC_CONNECTION_TO_VALUE LINK_CONNECTION_TIMEOUT
56 /**< 0x05 Timer for guard time out value */
57 #define PH_LLCNFC_GUARD_TO_VALUE LINK_GUARD_TIMEOUT
61 #define PH_LLCNFC_ACK_TO_VALUE LINK_ACK_TIMEOUT
63 #endif /* #ifdef PIGGY_BACK */
65 #ifdef LLC_RESET_DELAY
66 #define LLC_URSET_DELAY_TIME_OUT LLC_RESET_DELAY
68 #define LLC_URSET_DELAY_TIME_OUT 50
73 /************************ End of macros *****************************/
75 /********************** Callback functions **************************/
77 /******************* End of Callback functions **********************/
79 /********************* Structures and enums *************************/
81 /****************** End of structures and enums *********************/
83 /******************** Function declarations *************************/
85 * \ingroup grp_hal_nfc_llc_helper
87 * \brief LLC timer functions \b Timer Init function
89 * \copydoc page_reg This is to store LLCs main context structure
91 * \param[in, out] psLlcCtxt Llc main structure information
93 * \retval NFCSTATUS_SUCCESS Operation successful.
94 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid.
99 phLlcNfc_Context_t *psLlcCtxt
103 * \ingroup grp_hal_nfc_llc_helper
105 * \brief LLC timer functions \b Timer UnInit function
107 * \copydoc page_reg This is to uninitialise all timer related information
109 * \param[in, out] psLlcCtxt Llc main structure information
111 * \retval NFCSTATUS_SUCCESS Operation successful.
112 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid.
116 phLlcNfc_TimerUnInit (
117 phLlcNfc_Context_t *psLlcCtxt
121 * \ingroup grp_hal_nfc_llc_helper
123 * \brief LLC timer functions \b Create timer function
125 * \copydoc page_reg creates all the timers in the LLC context
130 phLlcNfc_CreateTimers (void);
133 * \ingroup grp_hal_nfc_llc_helper
135 * \brief LLC timer functions \b Start timer function
137 * \copydoc page_reg starts the timer type given by the user
139 * \param[in] TimerType Timer type to start
140 * \param[in] ns_value Value of N(S) for which the timer is started
142 * \retval NFCSTATUS_SUCCESS Operation successful.
143 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid.
144 * \retval Others Errors related to OsalNfc.
148 phLlcNfc_StartTimers (
154 * \ingroup grp_hal_nfc_llc_helper
156 * \brief LLC timer functions \b Stop timer function
158 * \copydoc page_reg stop the timer type given by the user
160 * \param[in] TimerType Timer type to start
161 * \param[in] no_of_gaurd_to_del Guard time-out count shall be decreased as and when
167 phLlcNfc_StopTimers (
169 uint8_t no_of_guard_to_del
173 * \ingroup grp_hal_nfc_llc_helper
175 * \brief LLC timer functions \b Stop timer function
177 * \copydoc page_reg stop the timer type given by the user
184 phLlcNfc_StopAllTimers (void);
188 * \ingroup grp_hal_nfc_llc_helper
190 * \brief LLC timer functions \b Delete timer function
192 * \copydoc page_reg deletes all the timers in the LLC context
194 * \retval NFCSTATUS_SUCCESS Operation successful.
195 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid.
196 * \retval Others Errors related to OsalNfc.
200 phLlcNfc_DeleteTimer (void);
202 #ifdef LLC_URSET_NO_DELAY
204 /* NO definition required */
206 #else /* #ifdef LLC_URSET_NO_DELAY */
209 phLlcNfc_URSET_Delay_Notify (
215 #endif /* #ifdef LLC_URSET_NO_DELAY */
217 /****************** End of Function declarations ********************/
218 #endif /* PHLLCNFC_TIMER_H */