Go to the documentation of this file.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
00037 # if defined (DRIVER_PN531_USB_ENABLED) || defined (DRIVER_PN533_USB_ENABLED)
00038 # include "drivers/pn53x_usb.h"
00039 # endif
00040
00041
00042 # if defined (DRIVER_PN531_USB_ENABLED)
00043 # include "drivers/pn531_usb.h"
00044 # endif
00045
00046
00047 # if defined (DRIVER_PN533_USB_ENABLED)
00048 # include "drivers/pn533_usb.h"
00049 # endif
00050
00051
00052 # if defined (DRIVER_ARYGON_ENABLED)
00053 # include "drivers/arygon.h"
00054 # endif
00055
00056
00057 # if defined (DRIVER_PN532_UART_ENABLED)
00058 # include "drivers/pn532_uart.h"
00059 # endif
00060
00061
00062 # define DRIVERS_MAX_DEVICES 16
00063 # define MAX_FRAME_LEN 264
00064
00065 static const struct driver_callbacks drivers_callbacks_list[] = {
00066
00067 # if defined (DRIVER_ACR122_ENABLED)
00068 {ACR122_DRIVER_NAME, &pn53x_callbacks_list, acr122_pick_device, acr122_list_devices, acr122_connect,
00069 acr122_transceive, acr122_disconnect},
00070 # endif
00071
00072 # if defined (DRIVER_PN531_USB_ENABLED)
00073 {PN531_USB_DRIVER_NAME, &pn53x_callbacks_list, pn531_usb_pick_device, pn531_usb_list_devices, pn531_usb_connect,
00074 pn53x_usb_transceive, pn53x_usb_disconnect},
00075 # endif
00076
00077 # if defined (DRIVER_PN533_USB_ENABLED)
00078 {PN533_USB_DRIVER_NAME, &pn53x_callbacks_list, pn533_usb_pick_device, pn533_usb_list_devices, pn533_usb_connect,
00079 pn53x_usb_transceive, pn53x_usb_disconnect},
00080 # endif
00081
00082 # if defined (DRIVER_ARYGON_ENABLED)
00083 {ARYGON_DRIVER_NAME, &pn53x_callbacks_list, arygon_pick_device, arygon_list_devices, arygon_connect,
00084 arygon_transceive, arygon_disconnect},
00085 # endif
00086
00087 # if defined (DRIVER_PN532_UART_ENABLED)
00088 {PN532_UART_DRIVER_NAME, &pn53x_callbacks_list, pn532_uart_pick_device, pn532_uart_list_devices, pn532_uart_connect,
00089 pn532_uart_transceive, pn532_uart_disconnect},
00090 # endif
00091
00092 };
00093
00094 # ifdef DEBUG
00095
00096
00097
00098
00099
00100 # define PRINT_HEX(pcTag, pbtData, szBytes) do { \
00101 size_t __szPos; \
00102 printf(" %s: ", pcTag); \
00103 for (__szPos=0; __szPos < (size_t)(szBytes); __szPos++) { \
00104 printf("%02x ",pbtData[__szPos]); \
00105 } \
00106 printf("\n"); \
00107 } while (0);
00108 # endif
00109
00110 #endif // __NFC_DRIVERS_H__