1/*
2 * Copyright (C) 2010 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/*!
19
20* \file  phDal4Nfc.h
21* \brief Common DAL for the upper layer.
22*
23* Project: NFC-FRI-1.1
24*
25* $Date: Tue Nov 10 13:56:45 2009 $
26* $Author: ing07299 $
27* $Revision: 1.38 $
28* $Aliases: NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
29*
30*/
31
32#ifndef PHDAL4NFC_H
33#define PHDAL4NFC_H
34
35/**
36*  \name DAl4 NFC
37*
38* File: \ref phDal4Nfc.h
39*
40*/
41/*@{*/
42#define PH_DAL4NFC_FILEREVISION "$Revision: 1.38 $" /**< \ingroup grp_file_attributes */
43#define PH_DAL4NFC_FILEALIASES    "$Aliases: NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $"
44 /**< \ingroup grp_file_attributes */
45/*@}*/
46/*************************** Includes *******************************/
47/** \defgroup grp_nfc_dal DAL Component
48 *
49 *
50 *
51 */
52#include <hardware/nfc.h>
53/**< Basic type definitions */
54#include <phNfcTypes.h>
55/**< Generic Interface Layer Function Definitions */
56#include <phNfcInterface.h>
57/*********************** End of includes ****************************/
58
59/***************************** Macros *******************************/
60 /**< Used for messaging by DAL as well as Upper Layers */
61#define PH_DAL4NFC_MESSAGE_BASE  PH_LIBNFC_DEFERREDCALL_MSG
62
63/************************ End of macros *****************************/
64
65
66/********************* Structures and enums *************************/
67
68/**
69 * \ingroup grp_nfc_dal
70 *
71 * DAL context : This contains the information of the upper layer callback
72 * and hardware reference.
73 */
74typedef struct phDal4Nfc_SContext
75{
76	phNfcIF_sCallBack_t		cb_if;		/**<Callback info registered by upper layer*/
77	volatile uint8_t		hw_valid;	/**<Flag - shows Hardware present or not */
78	void					*pHwRef;	/**<Hardware Reference*/
79	nfc_pn544_device_t		*pDev;		/**<Android HAL reference*/
80}phDal4Nfc_SContext_t,*pphDal4Nfc_SContext_t;
81
82/**
83 * \ingroup grp_nfc_dal
84 *
85 * DAL enum for Messages : This contains the enums used for
86 * posting messages to the application.
87 */
88typedef enum phDal4Nfc_Messages_en
89{
90    /**<Read message type used to post Read DAL Message to dispatch routine.Dispatch routine
91	calls read callback registered by upper layer */
92    PHDAL4NFC_READ_MESSAGE = 0,
93    /**<Readwait message type used to post Read wait DAL Message to dispatch routine.Dispatch routine
94	calls read wait callback registered by upper layer */
95	PHDAL4NFC_READWAIT_MESSAGE,
96	/**<Write message type used to post write DAL Message to dispatch routine.Dispatch routine
97	calls write wait callback registered by upper layer */
98    PHDAL4NFC_WRITE_MESSAGE,
99	/**<Notify message type used to post Notify DAL Message to dispatch routine.Dispatch routine
100	calls notify callback registered by upper layer */
101    PHDAL4NFC_NOTIFY_MESSAGE
102}phDal4Nfc_Messages_en_t;
103
104/**
105 * \ingroup grp_nfc_dal
106 *
107 * \brief DAL Message structure definition.This structure contains
108 *
109 * This structure contains details like  message type,read ,read wait and write callbacks
110 * reference details as registered by upper layer.
111 */
112typedef struct phDal4Nfc_Message
113{
114    /**<Refenrece to context.Context can be DAL context  */
115	void                                *pContext;
116    /**<Reference to hardware reference strucutre */
117	void                                *pHwRef;
118	/**<DAL message of type \ref phDal4Nfc_Messages_en_t*/
119    phDal4Nfc_Messages_en_t             eMsgType;
120	/**<Transaction specific information of type \ref phNfc_sTransactionInfo_t*/
121    phNfc_sTransactionInfo_t            transactInfo;
122	/**<Reference to read callback,registered by upper layer.This is of type \ref pphNfcIF_Transact_Completion_CB_t*/
123    pphNfcIF_Transact_Completion_CB_t   readCbPtr;
124	/**<Reference to write callback ,registered by upper layer.This is of type \ref pphNfcIF_Transact_Completion_CB_t*/
125    pphNfcIF_Transact_Completion_CB_t   writeCbPtr;
126} phDal4Nfc_Message_t,*pphDal4Nfc_Message_t;
127
128typedef phLibNfc_sConfig_t phDal4Nfc_sConfig_t;
129typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
130
131/****************** End of structures and enums *********************/
132
133/******************** Function declarations *************************/
134
135/**
136 * \ingroup grp_nfc_dal
137 *
138 *\brief Allows to register upper layer with DAL layer.
139 * This API allows upper layer to register with DAL layer.As part of registration
140 *<br>1.Exports DAL interfaces and DAL layer context to upper layer.
141 *Exported DAL interfaces are :
142 *<br><br>.phDal4Nfc_Shutdown
143 *<br><br>.phDal4Nfc_Write
144 *<br><br>.phDal4Nfc_Read
145 *<br><br>.phDal4Nfc_ReadWait
146 *<br><br>.phDal4Nfc_ReadWaitCancel
147 *<br><br>phDal4Nfc_Unregister
148 *<br><br>.Registeres upper layer callbacks and upper layer context with DAL layer.
149 *For details refer to \ref phNfcIF_sReference_t.
150 *Registration details are valid unless upper layer calls \ref phDal4Nfc_Unregister()
151 or \ref phDal4Nfc_Shutdown called.
152
153 * \param[in,out] psRefer   holds  DAL exported interface references once registration
154 *							sucessful.This also contains transmit and receive buffer
155 *							references.
156 *
157 * \param[in]     if_cb		Contains upper layer callback reference details, which are used
158 *							by DAL layer during callback notification.
159 *							These callbacks gets registered with DAL layer.
160 *
161
162 * \param[out]	 psIFConf  Currently this parameter not used.This  parameter to be other than NULL.
163 *
164 *
165 * \retval NFCSTATUS_SUCCESS             Operation is successful.
166 * \retval NFCSTATUS_INVALID_PARAMETER   At least one parameter of the function is invalid.
167 *
168 *\msc
169 *ClientApp,UpperLayer,phDal4Nfc;
170 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
171 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
172 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Register()",URL="\ref phDal4Nfc_Register"];
173 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
174 *\endmsc
175 */
176
177 extern
178 NFCSTATUS
179 phDal4Nfc_Register(
180                 phNfcIF_sReference_t   *psRefer,
181                 phNfcIF_sCallBack_t    if_cb,
182                 void *psIFConf
183                 );
184
185
186/**
187 * \ingroup grp_nfc_dal
188 *
189 * \brief  Allows upper layer to unregister with DAL layer.
190 * This interface allows to unregister upper layer callback interfaces with DAL layer.
191 * \note: Once this this API is called DAL layer stops notifying upper layer callbacks in case
192 * any events reported within DAL.
193 *
194 * \param[in]  pContext        DAL context is provided by the upper layer.
195 *                             The DAL context earlier was given to the
196 *                             upper layer through the \ref
197 *                             \e phDal4Nfc_Register() function.
198 * \param[in]  pHwRef		   for future use .Currently this parameter is not used.
199 *                             This needs to be other than NULL.
200 *
201 * \retval NFCSTATUS_SUCCESS             Unregistration successful.
202 * \retval NFCSTATUS_INVALID_PARAMETER   At least one parameter of the function is invalid.
203 *
204 *\msc
205 *ClientApp,UpperLayer,phDal4Nfc;
206 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
207 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
208 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Register()",URL="\ref phDal4Nfc_Register"];
209 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
210 *--- [label="Upper layer can issue Unregistration later"];
211 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Unregister()",URL="\ref phDal4Nfc_Unregister"];
212 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
213 *\endmsc
214 */
215
216
217 extern
218 NFCSTATUS
219 phDal4Nfc_Unregister(
220                   void   *pContext,
221                   void   *pHwRef
222                   );
223
224
225/**
226
227 * \ingroup grp_nfc_dal
228 *
229 *\brief This interface allows to initialize DAL layer.
230 * This API implements initialization of DAL layer. This includes :
231 *
232 * <br><br>. Initialize parameters for HW Interface.
233 *<br><br>. Initializing read and writer threads.
234 *<br><br>. Initializing read and write task specific events and event specific configurations.
235 *<br><br>. Initializing DAL layer specific details.
236 *
237 * \param[in]  pContext        DAL context provided by the upper layer.
238 *                             The DAL context will be exported to the
239 *							   upper layer via upper layer registration interface.
240 * \param[in]  pHwRef          information of the hardware
241 *
242 * \retval NFCSTATUS_SUCCESS            DAL initialization successful.
243 * \retval NFCSTATUS_INVALID_DEVICE     The device is not enumerated or the
244 *                                      Hardware Reference points to a device
245 *										which does not exist. Alternatively,
246 *                                      also already open devices produce this
247 *                                      error.
248 * \retval NFCSTATUS_INVALID_PARAMETER  At least one parameter of the function
249 *                                      is invalid.
250 *
251 *\msc
252 *ClientApp,UpperLayer,phDal4Nfc;
253 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
254 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
255 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Register()",URL="\ref phDal4Nfc_Register"];
256 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
257 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Init()",URL="\ref	phDal4Nfc_Init"];
258 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
259 *--- [label="DAL intialised ,read for read /write operations"];
260 *\endmsc
261 */
262
263 extern
264 NFCSTATUS
265 phDal4Nfc_Init(
266             void  *pContext,
267             void  *pHwRef
268             );
269
270
271/**
272 * \ingroup grp_nfc_dal
273 *
274 * \brief This API implements Deintialisation of DAL layer.
275 *
276 *This API implements Deintialisation of DAL layer. It includes :
277 *<br><br>.Releases all the resources.( context,memory resources,read/write buffers).
278 *<br><br>.closes COMxx port which is used during DAL session.
279 *<br><br>.Terminates Reader and writer tasks.
280 *
281 * \param[in]  pContext        DAL context is provided by the upper layer.
282 *                             The DAL context earlier was given to the
283 *                             upper layer through the
284 *                             \ref \e phDal4Nfc_Register() function
285 * \param[in]  pHwRef           hardware reference context.
286 *
287 * \retval NFCSTATUS_SUCCESS            DAL shutdown successful
288 * \retval NFCSTATUS_FAILED             DAL shutdown failed(example.unable to
289 *                                      suspend thread, close HW Interface etc.)
290 * \retval NFCSTATUS_INVALID_PARAMETER  At least one parameter of the function
291 *                                      is invalid.
292 *
293 *\msc
294 *ClientApp,UpperLayer,phDal4Nfc;
295 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
296 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
297 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Register()",URL="\ref phDal4Nfc_Register"];
298 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
299 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Init()",URL="\ref	phDal4Nfc_Init"];
300 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
301 *--- [label="Perform read write operation"];
302 *--- [label="DAL can be shutdown during upper layer deinit sequence"];
303 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Shutdown()",URL="\ref phDal4Nfc_Shutdown"];
304 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
305 *\endmsc
306 */
307
308 extern
309 NFCSTATUS
310 phDal4Nfc_Shutdown(
311                 void *pContext,
312                 void *pHwRef
313                 );
314
315/**
316 * \ingroup grp_nfc_dal
317 *
318 * \brief Allows to write data block to HW Interface.
319 *
320 * This asynchronous function writes the given block of data to the driver.
321 * This interface enables writer thread in case their is no write requests pending and returns
322 * sucessfully.Once writer thread completes write operation, it notifies upper layer using callback
323 * mechanism .
324 * \note writer thread notifies upper layer callback notified using  windows messaging  mechanism
325 * under deferred call context.
326 *
327 *
328 * \param[in]  pContext        DAL context is provided by the upper layer.
329 *                             The DAL
330 *                             context earlier was given to the upper layer
331 *                             through the \ref \e phDal4Nfc_Register() function
332 * \param[in]  pHwRef          information of the hardware.
333 * \param[in]  pBuffer         The information given by the upper layer to
334 *                             send it to the lower layer
335 * \param[in]  length          The length of pLlc_Buf, that needs to be sent
336 *                             to the lower layer is given by the upper layer
337 *
338 * \retval NFCSTATUS_PENDING                If the command is yet to be process.
339 * \retval NFCSTATUS_BUSY                   BUSY with previous write operation
340 * \retval NFCSTATUS_INVALID_DEVICE         The device has not been opened or has
341 *                                          been disconnected meanwhile
342 * \retval NFCSTATUS_INVALID_PARAMETER      At least one parameter of the function
343 *                                          is invalid.
344 *
345 *\msc
346 *ClientApp,UpperLayer,phDal4Nfc;
347*--- [label="Configure,intialise DAL layer and Register with DAL "];
348 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_Write()",URL="\ref  phDal4Nfc_Write()"];
349 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
350 *--- [label="DAL posts write message to main thread under deferred call context"];
351 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
352 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref  phDal4Nfc_DeferredCb()"];
353 *phDal4Nfc=>UpperLayer	[label="send_complete",URL="\ref phDal4Nfc_DeferredCb()"];
354 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
355 *\endmsc
356 */
357 extern
358 NFCSTATUS
359 phDal4Nfc_Write(
360             void *pContext,
361             void *pHwRef,
362             uint8_t *pBuffer,
363             uint16_t length
364             );
365
366
367/**
368 * \ingroup grp_nfc_dal
369 *
370 * \brief Allows to Read data block from HW Interface.
371 *
372 * This asynchronous function reads the data from the driver in which length
373 * and the required buffer are sent by upper layer. This interface enables
374 * reader thread in case there is no read requests pending and returns sucessfully.
375 * Once read operation is complete, it notifies  to upper layer through callback
376 * registered in the \b \e phDal4Nfc_Register() function.
377 *
378 *
379 * \param[in]  pContext        DAL context is provided by the upper layer.
380 *                             The DAL context earlier was given to the
381 *                             upper layer through the
382 *                             \b \e phDal4Nfc_Register() function
383 * \param[in]  pHwRef          Information of the hardware
384 * \param[in]  pBuffer         The information given by the upper layer to
385 *                             receive data from the lower layer
386 * \param[in]  length          The length of pBuffer given by the upper layer
387 *
388 * \retval NFCSTATUS_PENDING                If the command is yet to be processed.
389 * \retval NFCSTATUS_INVALID_PARAMETER      At least one parameter of the function
390 *                                          is invalid.
391 * \retval NFCSTATUS_INVALID_DEVICE         The device has not been opened or has
392 *                                          been disconnected meanwhile
393 *
394 *\msc
395 *ClientApp,UpperLayer,phDal4Nfc;
396 *--- [label="Configure,intialise DAL layer and Register with DAL "];
397 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_Write()",URL="\ref phDal4Nfc_Write()"];
398 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
399 *--- [label="DAL posts write message to main thread under deferred call context"];
400 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
401 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref  phDal4Nfc_DeferredCb()"];
402 *phDal4Nfc=>UpperLayer	[label="send_complete",URL="\ref phDal4Nfc_DeferredCb()"];
403 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
404 *--- [label="upper layer can issue read request"];
405 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_Read()",URL="\ref phDal4Nfc_Read()"];
406 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
407 *--- [label="DAL posts read message to main thread under deferred call context"];
408 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
409 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref  phDal4Nfc_DeferredCb()"];
410 *phDal4Nfc=>UpperLayer	[label="receive_complete",URL="\ref  phDal4Nfc_DeferredCb()"];
411 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
412
413 *\endmsc
414 */
415
416 extern
417 NFCSTATUS
418 phDal4Nfc_Read(
419            void *pContext,
420            void *pHwRef,
421            uint8_t *pBuffer,
422            uint16_t length
423            );
424
425/**
426 * \ingroup grp_nfc_dal
427 *
428 * \brief Allows to wait before reading data block from HW Interface.
429 *
430 * This asynchronous function waits before reading the data from the
431 * driver in which length  and the required buffer are sent by upper layer.
432 * This interface  enables reader thread  to wait for predefined time period
433 * (predefined time period is configurable by the DAL implementer) to complete
434 * read request.Once read operation is complete, it notifies to upper layer
435 * through callback registered in the \b \e phDal4Nfc_Register()
436 * function. Read request is expected to get complete within this time.
437 *
438 * \param[in]  pContext        DAL context is provided by the upper layer.
439 *                             The DAL context earlier was given to the
440 *							   upper layer through the
441 *                             \b \e phDal4Nfc_Register() function
442 * \param[in]  pHwRef          Information of the hardware
443 * \param[in]  pBuffer         The information given by the upper layer to
444 *                             receive data from the lower layer
445 * \param[in]  length          The length of pBuffer given by the upper layer
446 *
447 * \retval NFCSTATUS_SUCCESS                DAL receive successful
448 * \retval NFCSTATUS_BUSY                   BUSY with previous receive operation
449 * \retval NFCSTATUS_INVALID_PARAMETER      At least one parameter of the
450 *                                          function is invalid.
451 * \retval NFCSTATUS_INVALID_DEVICE         The device has not been opened or has
452 *                                          been disconnected meanwhile
453 *
454 *
455 *\msc
456 *ClientApp,UpperLayer,phDal4Nfc;
457 *--- [label="Configure,intialise DAL layer and Register with DAL "];
458 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_Write()",URL="\ref  phDal4Nfc_Write()"];
459 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
460 *--- [label="DAL posts write message to main thread under deferred call context"];
461 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
462 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref  phDal4Nfc_DeferredCb()"];
463 *phDal4Nfc=>UpperLayer	[label="send_complete",URL="\ref phDal4Nfc_DeferredCb()"];
464 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
465 *--- [label="upper layer can issue read wait request "];
466 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_ReadWait()",URL="\ref phDal4Nfc_ReadWait()"];
467 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
468 *--- [label="DAL posts read wait message to main thread under deferred call context"];
469 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
470 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref  phDal4Nfc_DeferredCb()"];
471 *phDal4Nfc=>UpperLayer	[label="receive_complete",URL="\ref  phDal4Nfc_DeferredCb()"];
472 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
473 *
474 *\endmsc
475 */
476
477
478 extern
479 NFCSTATUS
480 phDal4Nfc_ReadWait(
481                void *pContext,
482                void *pHwRef,
483                uint8_t *pBuffer,
484                uint16_t length
485                );
486
487
488/**
489 * \ingroup grp_nfc_dal
490 *
491 *\brief  Aborts read wait opertaion.
492 *
493 * This asynchronous function issues cancellation of the outstanding
494 * \b \e phDal4Nfc_ReadWait request.If upper layer wants to cancel the
495 * ongoing read wait operation this function is used. e.g. to abort the
496 * transactions.
497 *
498 * \param[in]  pContext        DAL context is provided by the upper layer.
499 *                             The DAL context earlier was given to the
500 *                             upper layer through the
501 *                             \b \e phDal4Nfc_Register() function
502 * \param[in]  pHwRef          Information of the hardware
503 *
504 * \retval NFCSTATUS_SUCCESS                    DAL receive successful
505 * \retval NFCSTATUS_INVALID_PARAMETER          At least one parameter of the
506 *                                              function is invalid.
507 * \retval NFCSTATUS_INVALID_DEVICE             The device has not been opened
508 *                                              or has been disconnected meanwhile
509 * \retval NFCSTATUS_BOARD_COMMUNICATION_ERROR  A board communication error occurred
510                                                (e.g. configuration went wrong).
511 *
512 *
513 *\msc
514 *ClientApp,UpperLayer,phDal4Nfc;
515 *--- [label="Configure,intialise DAL layer and Register with DAL "];
516 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_Write()",URL="\ref  phDal4Nfc_Write()"];
517 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
518 *--- [label="DAL posts write message to main thread under deferred call context"];
519 *phDal4Nfc=>phDal4Nfc [label="phDal4Nfc_DeferredCall()",URL="\ref	phDal4Nfc_DeferredCall()"];
520 *ClientApp=>phDal4Nfc	[label="phDal4Nfc_DeferredCb()",URL="\ref Call phDal4Nfc_DeferredCb()"];
521 *phDal4Nfc=>UpperLayer	[label="send_complete",URL="\ref phDal4Nfc_DeferredCb()"];
522 *ClientApp<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
523 *--- [label="upper layer can issue read wait request "];
524 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_ReadWait()",URL="\ref phDal4Nfc_ReadWait()"];
525 *UpperLayer<<phDal4Nfc	[label="NFCSTATUS_PENDING"];
526 *--- [label="Issue Read wait cancel request here"];
527 *UpperLayer=>phDal4Nfc	[label="phDal4Nfc_ReadWaitCancel()",URL="\ref phDal4Nfc_ReadWaitCancel()"];
528 **UpperLayer<<phDal4Nfc	[label="NFCSTATUS_SUCCESS"];
529 *\endmsc
530 */
531 extern
532 NFCSTATUS
533 phDal4Nfc_ReadWaitCancel(
534                        void *pContext,
535                        void *pHwRef
536                        );
537
538/**
539 * \ingroup grp_nfc_dal
540 *
541 * \brief DAL config function
542 * This synchronous function configures the given HW Interface and
543 * sends the HANDLE to the caller.
544 *
545 * \param[in]       config     DAL configuration details as provided
546 *                             by the upper layer.
547 * \param[in,out]   phwref     pointer to which valid Handle to DAL
548 *                             interface is assigned.
549 *
550 * \retval NFCSTATUS_SUCCESS                    Configuration happened successfully.
551 * \retval NFCSTATUS_INVALID_PARAMETER          At least one parameter of the function
552 *                                              is invalid.
553 * \retval NFCSTATUS_FAILED                     Configuration failed(example.unable to
554 *                                              open HW Interface).
555 * \retval NFCSTATUS_INVALID_DEVICE             The device has not been opened or
556 *                                              has been disconnected meanwhile
557 * \retval NFCSTATUS_BOARD_COMMUNICATION_ERROR  A board communication error occurred
558                                                (e.g. configuration went wrong).
559 *\msc
560 *ClientApp,UpperLayer,phDal4Nfc;
561 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
562 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
563 *\endmsc
564 */
565 extern
566 NFCSTATUS
567 phDal4Nfc_Config (
568                pphDal4Nfc_sConfig_t config,
569                void **phwref
570                );
571
572 /**
573 * \ingroup grp_nfc_dal
574 *
575 * \brief Release configuration for the given HW Interface.
576 *
577 * \copydoc page_reg Release all the variables of the DAL component, that has been
578 *      initialised in \b phDal4Nfc_Config function (Synchronous function).
579 *
580 * \param[in] pHwRef            Link information of the hardware
581 *
582 * \retval NFCSTATUS_SUCCESS            DAL Configuration Released successfully.
583 * \retval NFCSTATUS_FAILED             Configuration release failed(example: Unable to close Com port).
584 *
585 *\msc
586 *ClientApp,UpperLayer,phDal4Nfc;
587 *ClientApp=>phDal4Nfc [label="phDal4Nfc_Config()",URL="\ref phDal4Nfc_Config"];
588 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
589 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Register()",URL="\ref phDal4Nfc_Register"];
590 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
591 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Init()",URL="\ref	phDal4Nfc_Init"];
592 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
593 *--- [label="Perform read write operation"];
594 *--- [label="DAL resources can be released during upper layer deinit sequence"];
595 *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Shutdown()",URL="\ref	phDal4Nfc_Shutdown"];
596 *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
597 *ClientApp=>phDal4Nfc [label="phDal4Nfc_ConfigRelease()",URL="\ref phDal4Nfc_ConfigRelease"];
598 *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];
599 *\endmsc
600 */
601extern
602NFCSTATUS
603phDal4Nfc_ConfigRelease(
604    void        *pHwRef);
605
606extern
607NFCSTATUS
608phDal4Nfc_Reset(long level);
609
610extern
611NFCSTATUS
612phDal4Nfc_Download();
613
614/******************** Function declarations *************************/
615
616#endif /* PHDALNFC_H */
617
618/****************************************** END OF FILE ***************************************************/
619
620