00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef __NFC_DRIVERS_H__
00026 # define __NFC_DRIVERS_H__
00027
00028 # include <nfc/nfc-types.h>
00029
00030 # include "chips/pn53x.h"
00031
00032 # if defined (DRIVER_ACR122_ENABLED)
00033 # include "drivers/acr122.h"
00034 # endif
00035
00036 # if defined (DRIVER_PN531_USB_ENABLED) || defined (DRIVER_PN533_USB_ENABLED)
00037 # include "drivers/pn53x_usb.h"
00038 # endif
00039
00040 # if defined (DRIVER_PN531_USB_ENABLED)
00041 # include "drivers/pn531_usb.h"
00042 # endif
00043
00044 # if defined (DRIVER_PN533_USB_ENABLED)
00045 # include "drivers/pn533_usb.h"
00046 # endif
00047
00048 # if defined (DRIVER_ARYGON_ENABLED)
00049 # include "drivers/arygon.h"
00050 # endif
00051
00052 # if defined (DRIVER_PN532_UART_ENABLED)
00053 # include "drivers/pn532_uart.h"
00054 # endif
00055
00056 # define DRIVERS_MAX_DEVICES 16
00057 # define MAX_FRAME_LEN 264
00058
00059 static const struct driver_callbacks drivers_callbacks_list[] = {
00060
00061 # if defined (DRIVER_PN531_USB_ENABLED)
00062 {PN531_USB_DRIVER_NAME, &pn53x_callbacks_list, pn531_usb_pick_device, pn531_usb_list_devices, pn531_usb_connect,
00063 NULL, pn53x_usb_transceive, pn53x_usb_disconnect},
00064 # endif
00065 # if defined (DRIVER_PN533_USB_ENABLED)
00066 {PN533_USB_DRIVER_NAME, &pn53x_callbacks_list, pn533_usb_pick_device, pn533_usb_list_devices, pn533_usb_connect,
00067 pn533_usb_init, pn53x_usb_transceive, pn53x_usb_disconnect},
00068 # endif
00069 # if defined (DRIVER_ACR122_ENABLED)
00070 {ACR122_DRIVER_NAME, &pn53x_callbacks_list, acr122_pick_device, acr122_list_devices, acr122_connect,
00071 NULL, acr122_transceive, acr122_disconnect},
00072 # endif
00073 # if defined (DRIVER_ARYGON_ENABLED)
00074 {ARYGON_DRIVER_NAME, &pn53x_callbacks_list, arygon_pick_device, arygon_list_devices, arygon_connect,
00075 NULL, arygon_transceive, arygon_disconnect},
00076 # endif
00077 # if defined (DRIVER_PN532_UART_ENABLED)
00078 {PN532_UART_DRIVER_NAME, &pn53x_callbacks_list, pn532_uart_pick_device, pn532_uart_list_devices, pn532_uart_connect,
00079 NULL, pn532_uart_transceive, pn532_uart_disconnect},
00080 # endif
00081 };
00082
00083 # ifdef DEBUG
00084
00085
00086
00087
00088
00089 # define PRINT_HEX(pcTag, pbtData, szBytes) do { \
00090 size_t __szPos; \
00091 printf(" %s: ", pcTag); \
00092 for (__szPos=0; __szPos < (size_t)(szBytes); __szPos++) { \
00093 printf("%02x ",pbtData[__szPos]); \
00094 } \
00095 printf("\n"); \
00096 } while (0);
00097 # endif
00098
00099 #endif // __NFC_DRIVERS_H__