Adding a SPI driver for pn532
The driver seems to work well. I tested it on Linux with i.mx233-based board using hardware SPI. I tried to modify the build files as well, but it's probably a little messy. I'm not sure whether it will work on other *nix OSes, so it's probably better to limit the driver to Linux only using build system.
This commit is contained in:
parent
a0ebd8ba15
commit
d9fd9155ea
9 changed files with 1141 additions and 8 deletions
|
|
@ -22,16 +22,16 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
|
|||
AC_MSG_RESULT(default drivers)
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
case "${DRIVER_BUILD_LIST}" in
|
||||
default)
|
||||
DRIVER_BUILD_LIST="acr122_usb acr122s arygon pn53x_usb pn532_uart"
|
||||
DRIVER_BUILD_LIST="acr122_usb acr122s arygon pn53x_usb pn532_uart pn532_spi"
|
||||
;;
|
||||
all)
|
||||
DRIVER_BUILD_LIST="acr122_pcsc acr122_usb acr122s arygon pn53x_usb pn532_uart"
|
||||
DRIVER_BUILD_LIST="acr122_pcsc acr122_usb acr122s arygon pn53x_usb pn532_uart pn532_spi"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
DRIVERS_CFLAGS=""
|
||||
|
||||
driver_acr122_pcsc_enabled="no"
|
||||
|
|
@ -40,6 +40,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
|
|||
driver_pn53x_usb_enabled="no"
|
||||
driver_arygon_enabled="no"
|
||||
driver_pn532_uart_enabled="no"
|
||||
driver_pn532_spi_enabled="no"
|
||||
|
||||
for driver in ${DRIVER_BUILD_LIST}
|
||||
do
|
||||
|
|
@ -71,6 +72,10 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
|
|||
driver_pn532_uart_enabled="yes"
|
||||
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_UART_ENABLED"
|
||||
;;
|
||||
pn532_spi)
|
||||
driver_pn532_spi_enabled="yes"
|
||||
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_SPI_ENABLED"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknow driver: $driver])
|
||||
;;
|
||||
|
|
@ -83,6 +88,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
|
|||
AM_CONDITIONAL(DRIVER_PN53X_USB_ENABLED, [test x"$driver_pn53x_usb_enabled" = xyes])
|
||||
AM_CONDITIONAL(DRIVER_ARYGON_ENABLED, [test x"$driver_arygon_enabled" = xyes])
|
||||
AM_CONDITIONAL(DRIVER_PN532_UART_ENABLED, [test x"$driver_pn532_uart_enabled" = xyes])
|
||||
AM_CONDITIONAL(DRIVER_PN532_SPI_ENABLED, [test x"$driver_pn532_spi_enabled" = xyes])
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBNFC_DRIVERS_SUMMARY],[
|
||||
|
|
@ -94,4 +100,5 @@ echo " acr122s.......... $driver_acr122s_enabled"
|
|||
echo " arygon........... $driver_arygon_enabled"
|
||||
echo " pn53x_usb........ $driver_pn53x_usb_enabled"
|
||||
echo " pn532_uart....... $driver_pn532_uart_enabled"
|
||||
echo " pn532_spi....... $driver_pn532_spi_enabled"
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue