summaryrefslogtreecommitdiffstats
path: root/halimpl/pn54x/hal/phNxpNciHal.h
diff options
context:
space:
mode:
Diffstat (limited to 'halimpl/pn54x/hal/phNxpNciHal.h')
-rw-r--r--halimpl/pn54x/hal/phNxpNciHal.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/halimpl/pn54x/hal/phNxpNciHal.h b/halimpl/pn54x/hal/phNxpNciHal.h
index 7fd9af0..e03ad7b 100644
--- a/halimpl/pn54x/hal/phNxpNciHal.h
+++ b/halimpl/pn54x/hal/phNxpNciHal.h
@@ -25,10 +25,24 @@
#define NCI_POLL_DURATION 500
#define HAL_NFC_ENABLE_I2C_FRAGMENTATION_EVT 0x07
#undef P2P_PRIO_LOGIC_HAL_IMP
-
+#define NCI_VERSION_2_0 0x20
+#define NCI_VERSION_1_1 0x11
+#define NCI_VERSION_1_0 0x10
+#define NCI_VERSION_UNKNOWN 0x00
typedef void(phNxpNciHal_control_granted_callback_t)();
/* NCI Data */
+
+#define NCI_MT_CMD 0x20
+#define NCI_MT_RSP 0x40
+#define NCI_MT_NTF 0x60
+
+#define CORE_RESET_TRIGGER_TYPE_CORE_RESET_CMD_RECEIVED 0x02
+#define CORE_RESET_TRIGGER_TYPE_POWERED_ON 0x01
+#define NCI_MSG_CORE_RESET 0x00
+#define NCI_MSG_CORE_INIT 0x01
+#define NCI_MT_MASK 0xE0
+#define NCI_OID_MASK 0x3F
typedef struct nci_data {
uint16_t len;
uint8_t p_data[NCI_MAX_DATA_LEN];
@@ -39,7 +53,10 @@ typedef enum { HAL_STATUS_CLOSE = 0, HAL_STATUS_OPEN } phNxpNci_HalStatus;
/* Macros to enable and disable extensions */
#define HAL_ENABLE_EXT() (nxpncihal_ctrl.hal_ext_enabled = 1)
#define HAL_DISABLE_EXT() (nxpncihal_ctrl.hal_ext_enabled = 0)
-
+typedef struct phNxpNciInfo {
+ uint8_t nci_version;
+ bool_t wait_for_ntf;
+} phNxpNciInfo_t;
/* NCI Control structure */
typedef struct phNxpNciHal_Control {
phNxpNci_HalStatus halStatus; /* Indicate if hal is open or closed */
@@ -75,6 +92,7 @@ typedef struct phNxpNciHal_Control {
/* retry count used to force download */
uint16_t retry_cnt;
uint8_t read_retry_cnt;
+ phNxpNciInfo_t nci_info;
} phNxpNciHal_Control_t;
typedef struct phNxpNciClock {