X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/422088690f8c39ae35384a549b571ba3fea22a4b..a7be12a4e68fcaaa92f81a394bc316a592ec6270:/drivers/sensors/pn532/pn532_bus.h diff --git a/drivers/sensors/pn532/pn532_bus.h b/drivers/sensors/pn532/pn532_bus.h index a322933..9a509b9 100644 --- a/drivers/sensors/pn532/pn532_bus.h +++ b/drivers/sensors/pn532/pn532_bus.h @@ -13,10 +13,10 @@ // #define PN532_BUS_UART #define PN532_BUS_I2C -#define PN532_RSTPD_PORT (2) -#define PN532_RSTPD_PIN (2) -#define PN532_SPI_CSPORT (0) -#define PN532_SPI_CSPIN (2) +#define PN532_RSTPD_PORT (3) +#define PN532_RSTPD_PIN (1) +#define PN532_I2C_IRQPORT (3) +#define PN532_I2C_IRQPIN (2) #define PN532_NORMAL_FRAME__DATA_MAX_LEN (254) #define PN532_NORMAL_FRAME__OVERHEAD (8) @@ -25,14 +25,15 @@ #define PN532_BUFFER_LEN (PN532_EXTENDED_FRAME__DATA_MAX_LEN + PN532_EXTENDED_FRAME__OVERHEAD) #define PN532_UART_BAUDRATE (115200) + #define PN532_I2C_ADDRESS (0x48) #define PN532_I2C_READBIT (0x01) +#define PN532_I2C_READYTIMEOUT (20) // Max number of attempts to read Ready bit (see UM 5-Nov-2007 Section 6.2.4) // Generic interface for the different serial buses available on the PN532 void pn532_bus_HWInit(void); pn532_error_t pn532_bus_SendCommand(const byte_t * pbtData, const size_t szData); pn532_error_t pn532_bus_ReadResponse(byte_t * pbtResponse, size_t * pszRxLen); -bool pn532_bus_TransceiveBytes(const byte_t * pbtTx, const size_t szTx, byte_t * pbtRx, size_t * pszRx); pn532_error_t pn532_bus_Wakeup(void); #endif