NHS31xx SW API
nfc_nss.h
1 /*
2  * Copyright 2014-2016,2019-2020 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
12 #ifndef __NFC_NSS_H_
13 #define __NFC_NSS_H_
14 
106 typedef struct NSS_NFC_S {
107  __IO uint32_t CFG;
108  __I uint32_t SR;
109  __I uint32_t CMDIN;
110  __O uint32_t DATAOUT;
111  __IO uint32_t TARGET;
112  __I uint32_t LAST_ACCESS;
113  __IO uint32_t IMSC;
114  __I uint32_t RIS;
115  __I uint32_t MIS;
116  __O uint32_t IC;
117  __IO uint32_t RESERVED0[54]; /* next field at offset 0x100 */
118  __IO uint32_t BUF[128];
120 } NSS_NFC_T;
121 
125 typedef enum NFC_INT {
126  NFC_INT_RFPOWER = (1 << 0),
127  NFC_INT_RFSELECT = (1 << 1),
128  NFC_INT_MEMREAD = (1 << 2),
129  NFC_INT_MEMWRITE = (1 << 3),
130  NFC_INT_CMDWRITE = (1 << 4),
131  NFC_INT_CMDREAD = (1 << 5),
132  NFC_INT_TARGETWRITE = (1 << 6),
133  NFC_INT_TARGETREAD = (1 << 7),
134  NFC_INT_NFCOFF = (1 << 8),
136  NFC_INT_ALL = 0x1FF
137 } NFC_INT_T;
138 
141 typedef enum NFC_STATUS {
142  NFC_STATUS_POR = (1 << 0),
143  NFC_STATUS_1V2 = (1 << 1),
144  NFC_STATUS_1V5 = (1 << 2),
145  NFC_STATUS_PLL = (1 << 3),
146  NFC_STATUS_SEL = (1 << 4),
150  NFC_STATUS_AUTH = (1 << 5),
152  NFC_STATUS_BYPASS = (1 << 6)
153 } NFC_STATUS_T;
154 
155 #define NFC_SHARED_MEM_BYTE_SIZE (int)(sizeof(NSS_NFC->BUF))
156 #define NFC_SHARED_MEM_WORD_SIZE (NFC_SHARED_MEM_BYTE_SIZE / 4)
157 #define NFC_SHARED_MEM_START (int)(NSS_NFC->BUF)
158 #define NFC_SHARED_MEM_END (NFC_SHARED_MEM_START + NFC_SHARED_MEM_BYTE_SIZE -1)
169 void Chip_NFC_Init(NSS_NFC_T *pNFC);
170 
176 void Chip_NFC_DeInit(NSS_NFC_T *pNFC);
177 
184 
191 
198 
212 
219 
225 void Chip_NFC_SetTargetAddress(NSS_NFC_T *pNFC, uint32_t offset);
226 
232 uint32_t Chip_NFC_GetTargetAddress(NSS_NFC_T *pNFC);
233 
244 bool Chip_NFC_GetLastAccessInfo(NSS_NFC_T *pNFC, uint32_t *pStartOffset, uint32_t *pEndOffset);
245 
264 bool Chip_NFC_WordWrite(NSS_NFC_T *pNFC, uint32_t * pDest, const uint32_t * pSrc, int n);
265 
284 bool Chip_NFC_ByteRead(NSS_NFC_T *pNFC, uint8_t * pDest, const uint8_t * pSrc, int n);
285 
286 #endif
bool Chip_NFC_ByteRead(NSS_NFC_T *pNFC, uint8_t *pDest, const uint8_t *pSrc, int n)
Definition: nfc_nss.h:130
Definition: nfc_nss.h:132
__O uint32_t IC
Definition: nfc_nss.h:116
Definition: nfc_nss.h:133
__I uint32_t MIS
Definition: nfc_nss.h:115
NFC_INT_T Chip_NFC_Int_GetRawStatus(NSS_NFC_T *pNFC)
Definition: nfc_nss.h:145
Definition: nfc_nss.h:126
Definition: nfc_nss.h:136
void Chip_NFC_DeInit(NSS_NFC_T *pNFC)
Definition: nfc_nss.h:144
NFC_STATUS_T
Definition: nfc_nss.h:141
void Chip_NFC_Int_ClearRawStatus(NSS_NFC_T *pNFC, NFC_INT_T flags)
bool Chip_NFC_WordWrite(NSS_NFC_T *pNFC, uint32_t *pDest, const uint32_t *pSrc, int n)
Definition: nfc_nss.h:127
Definition: nfc_nss.h:135
NFC_INT_T
Definition: nfc_nss.h:125
__I uint32_t SR
Definition: nfc_nss.h:108
Definition: nfc_nss.h:146
#define __IO
Definition: core_cm0plus.h:167
Definition: nfc_nss.h:128
Definition: nfc_nss.h:150
#define __I
Definition: core_cm0plus.h:164
__IO uint32_t CFG
Definition: nfc_nss.h:107
Definition: nfc_nss.h:142
__O uint32_t DATAOUT
Definition: nfc_nss.h:110
Definition: nfc_nss.h:152
void Chip_NFC_SetTargetAddress(NSS_NFC_T *pNFC, uint32_t offset)
Definition: nfc_nss.h:134
Definition: nfc_nss.h:131
Definition: nfc_nss.h:143
void Chip_NFC_Int_SetEnabledMask(NSS_NFC_T *pNFC, NFC_INT_T mask)
bool Chip_NFC_GetLastAccessInfo(NSS_NFC_T *pNFC, uint32_t *pStartOffset, uint32_t *pEndOffset)
__IO uint32_t TARGET
Definition: nfc_nss.h:111
#define __O
Definition: core_cm0plus.h:166
NFC_STATUS_T Chip_NFC_GetStatus(NSS_NFC_T *pNFC)
__IO uint32_t IMSC
Definition: nfc_nss.h:113
__I uint32_t CMDIN
Definition: nfc_nss.h:109
Definition: nfc_nss.h:129
__I uint32_t RIS
Definition: nfc_nss.h:114
uint32_t Chip_NFC_GetTargetAddress(NSS_NFC_T *pNFC)
NFC_INT_T Chip_NFC_Int_GetEnabledMask(NSS_NFC_T *pNFC)
Definition: nfc_nss.h:106
__I uint32_t LAST_ACCESS
Definition: nfc_nss.h:112