mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-11 09:06:17 +00:00
Add I2C protocol support for PN532.
This commit is contained in:
committed by
Philippe Teuwen
parent
6038aca7d1
commit
1b11450312
13
libnfc/nfc.c
13
libnfc/nfc.c
@@ -113,6 +113,10 @@
|
||||
# include "drivers/pn532_spi.h"
|
||||
#endif /* DRIVER_PN532_SPI_ENABLED */
|
||||
|
||||
#if defined (DRIVER_PN532_I2C_ENABLED)
|
||||
# include "drivers/pn532_i2c.h"
|
||||
#endif /* DRIVER_PN532_I2C_ENABLED */
|
||||
|
||||
|
||||
#define LOG_CATEGORY "libnfc.general"
|
||||
#define LOG_GROUP NFC_LOG_GROUP_GENERAL
|
||||
@@ -145,11 +149,15 @@ nfc_drivers_init(void)
|
||||
#if defined (DRIVER_PN532_SPI_ENABLED)
|
||||
nfc_register_driver(&pn532_spi_driver);
|
||||
#endif /* DRIVER_PN532_SPI_ENABLED */
|
||||
#if defined (DRIVER_PN532_I2C_ENABLED)
|
||||
nfc_register_driver(&pn532_i2c_driver);
|
||||
#endif /* DRIVER_PN532_I2C_ENABLED */
|
||||
#if defined (DRIVER_ARYGON_ENABLED)
|
||||
nfc_register_driver(&arygon_driver);
|
||||
#endif /* DRIVER_ARYGON_ENABLED */
|
||||
}
|
||||
|
||||
|
||||
/** @ingroup lib
|
||||
* @brief Register an NFC device driver with libnfc.
|
||||
* This function registers a driver with libnfc, the caller is responsible of managing the lifetime of the
|
||||
@@ -189,6 +197,11 @@ nfc_init(nfc_context **context)
|
||||
}
|
||||
if (!nfc_drivers)
|
||||
nfc_drivers_init();
|
||||
|
||||
//#if defined (I2C_DRIVERS_ENABLED)
|
||||
// if (!i2c_drivers)
|
||||
// i2c_drivers_init();
|
||||
//#endif
|
||||
}
|
||||
|
||||
/** @ingroup lib
|
||||
|
||||
Reference in New Issue
Block a user