From 4cbd62c2ca1600dcd2001d1c5a736abc043a0333 Mon Sep 17 00:00:00 2001 From: Rakesh Goyal Date: Fri, 27 Jan 2012 18:13:29 +0530 Subject: [PATCH] add i2c_device_address member to nfc_pn544_device_t Add I2C slave address. Multiple I2C addresses are possible for PN544 module. Configure address according to board design. Change-Id: I847e8f3db631f5039cf15143a9982f4b9b209f27 --- include/hardware/nfc.h | 5 +++++ modules/nfc/nfc_hw_example.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/hardware/nfc.h b/include/hardware/nfc.h index ca3683b..74b3cfb 100644 --- a/include/hardware/nfc.h +++ b/include/hardware/nfc.h @@ -76,6 +76,11 @@ typedef struct { * Set to 0 to disable the workaround, 1 to enable it. */ uint8_t enable_i2c_workaround; + /* I2C slave address. Multiple I2C addresses are + * possible for PN544 module. Configure address according to + * board design. + */ + uint8_t i2c_device_address; } nfc_pn544_device_t; static inline int nfc_pn544_open(const struct hw_module_t* module, diff --git a/modules/nfc/nfc_hw_example.c b/modules/nfc/nfc_hw_example.c index 9769282..54c9c56 100644 --- a/modules/nfc/nfc_hw_example.c +++ b/modules/nfc/nfc_hw_example.c @@ -44,6 +44,7 @@ static int nfc_open(const hw_module_t* module, const char* name, dev->linktype = PN544_LINK_TYPE_INVALID; dev->device_node = NULL; dev->enable_i2c_workaround = 0; + dev->i2c_device_address = 0; *device = (hw_device_t*) dev; return 0; -- 2.11.0