48#ifndef PTX_NSC_INTERFACE_H_
49#define PTX_NSC_INTERFACE_H_
77#define PTX_NSC_MIN_IO_BUFFER_SIZE 280
82#define PTX_NSC_RFCONFIG_NAME_CAPACITY 64
87#define PTX_NSC_IC_SERIAL_NUMBER_LENGTH 10
211#if defined (PTX_FEATURES_HCI_INCLUDED)
212 ptxNSC_SWP_Activation_Param_t Swp_Act_Params;
213 ptxNSC_SWP_DeactCmd_t Swp_Deactivate_VCC;
214 ptxNSC_SWP_Interface_t SwpIntfActive;
215 ptxNSC_SWP_Interface_t SwpIntfTemp;
ptxNSC_States_t ptxNSC_GetState(ptxNSC_t *nscCtx)
Get NSC State.
ptxStatus_t ptxNSC_GetIORQNtf(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
NSC Get IO RQ Notification.
ptxStatus_t ptxNSC_Init(ptxNSC_t *nscCtx, ptxNSC_InitParam_t *initParam)
Initialization function for NSC component.
ptxStatus_t ptxNSC_DeInit(ptxNSC_t *nscCtx)
Shutdown function for NSC component.
ptxStatus_t ptxNSC_GetMiscRFConfig(ptxNSC_t *nscCtx, uint8_t *configBuffer, size_t *configBufferLen)
NSC Get last loaded Misc. RF-Configuration.
ptxStatus_t ptxNSC_SetState(ptxNSC_t *nscCtx, ptxNSC_States_t state)
Set NSC State.
ptxStatus_t ptxNSC_Pause(ptxNSC_t *nscCtx, ptxNSC_Pause_Options pauseMode)
Suspend or resume thread for the interface device.
ptxStatus_t ptxNSC_HALSetSpeed(ptxNSC_t *nscCtx, uint32_t bdSpeed)
Set speed for interface with the chip.
ptxStatus_t ptxNSC_HALSetFlowCtrlState(ptxNSC_t *nscCtx, uint8_t enableTRx)
Enable/disable flow control mode for the interface device.
ptxStatus_t ptxNSC_FwDownload(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint8_t *pData, size_t length, uint8_t forceDwnld)
NSC FW Download.
ptxStatus_t ptxNSC_NscDataMsg(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint8_t *payload, size_t length, uint8_t isChained)
Function used to send NSC Data Msg to the chip.
ptxStatus_t ptxNSC_WakeupCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
NSC_WAKEUP_CMD.
ptxStatus_t ptxNSC_ReadSystemCfg(ptxNSC_t *nscCtx, struct ptxNSC_System *sysCfgParams)
Reads the current NSC System-Configuration parameters.
#define PTX_NSC_TYPES_LISBATTRIBRES_LEN
Definition ptxNSC_InterfaceTypes.h:165
ptxStatus_t ptxNSC_SetGPIOMode(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl, uint8_t gpioNr, ptxNSC_GPIO_Mode_t gpioMode, uint8_t gpioFlags)
Configures a selected GPIO-pin to work as output, output or special function.
enum ptxNSC_GPIO_Mode ptxNSC_GPIO_Mode_t
NSC Read CMD parameter structure.
ptxStatus_t ptxNSC_SetGPIOOutput(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl, uint8_t gpioNr, uint8_t gpioValue)
Sets the selected GPIO-pin high or low.
ptxStatus_t ptxNSC_WRA(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint16_t address, uint8_t valueToWrite)
NSC WRA.
enum ptxNscRdTriggModes ptxNscRdTriggModes_t
NSC Modes in Reader Mode (How has triggered the Reader Operation ? Either Application (e....
ptxStatus_t ptxNSC_WriteCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_WriteCmd_Par_t nscWritePar)
Function used to build and send NSC_WRITE_CMD.
ptxStatus_t ptxNSC_GetRevisionInfo(struct ptxNSC *nscCtx, ptxNSC_RevisionType_t revisionType, uint32_t *revisionInfo)
Get various revisions of system (C-Stack, DFY-Code/-Toochain, Chip-ID, Local changes etc.
ptxStatus_t ptxNSC_PresCheck_IsoDep_EmptyBlock(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl)
ISO-DEP Presence Check (Empty Block).
ptxNSC_SoftReset
Types of Soft-Reset.
Definition ptxNSC_InterfaceTypes.h:404
ptxStatus_t ptxNSC_NfcForumGetDiscParams(struct ptxNSC *nscCtx, struct ptxNSC_Discover_Param *discoverParams)
Get discovery loop parameters for NFC-Forum.
enum ptxNSC_SoftReset ptxNSC_SoftReset_t
Types of Soft-Reset.
ptxStatus_t ptxNSC_RfTestRun(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNsc_RfTest_Id_t rfTestId, uint8_t *rfTestParams, size_t rfTestParamsLen)
Function for NSC_RF_RUN_CMD.
ptxStatus_t ptxNSC_DiscoverCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_Discover_Param_t *discoverParams)
Function for NSC_RF_DISCOVER_CMD.
ptxStatus_t ptxNSC_RRA(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint16_t regAddress)
NSC Read Random Address (just read one byte)
enum ptxNSC_CmdSched_Param ptxNSC_CmdSched_Param_t
NSC command execution schedule control flag.
#define PTX_NSC_TYPES_LISASENSRES_LEN
Definition ptxNSC_InterfaceTypes.h:161
#define PTX_NSC_TYPES_LISBSENSRES_LEN
Definition ptxNSC_InterfaceTypes.h:164
ptxStatus_t ptxNSC_LoadSystemCfg(ptxNSC_t *nscCtx, struct ptxNSC_System *sysCfgParams, uint8_t paramSource)
Loads NSC System-Configuration parameters and Reads them.
ptxStatus_t ptxNSC_PresCheck_IsoDep_Nack(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl)
ISO-DEP Presence Check (NACK).
ptxStatus_t ptxNSC_WCA(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint16_t Address, uint8_t *pData, size_t length)
NSC WCA.
ptxStatus_t ptxNSC_WriteSystemCfg(ptxNSC_t *nscCtx, struct ptxNSC_System *sysCfgParams)
Writes NSC System-Configuration parameters.
ptxStatus_t ptxNSC_ReadCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_ReadCmd_Par_t nscReadPar)
Function used to build and send NSC_READ_CMD.
ptxStatus_t ptxNSC_GetGPIOInput(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl, uint8_t gpioNr)
Gets the current value of a selected GPIO-pin (value returned in Completion-path).
ptxStatus_t ptxNSC_SetUcodeInactive(ptxNSC_t *nscCtx)
Set the uCode Image as Inactive.
enum ptxNSC_RevisionType ptxNSC_RevisionType_t
NSC Revision-Info Types.
#define PTX_NSC_RFCONFIG_NAME_CAPACITY
Definition ptxNSC_Interface.h:82
ptxStatus_t ptxNSC_GetDeactivateTimeout(struct ptxNSC *nscCtx, uint32_t *currentTimeout)
Function to retrieve the current timeout value in [ms] to wait for a NSC.RF_DEACTIVATE_RSP.
ptxStatus_t ptxNSC_SetDeactivateTimeout(struct ptxNSC *nscCtx, uint32_t *currentTimeout)
Function to set the current timeout value in [ms] to wait for a NSC.RF_DEACTIVATE_RSP.
enum ptxNSC_ResetCpuEn ptxNSC_ResetCpuEn_t
Types of Enable cpu in NSC Reset CMD.
ptxStatus_t ptxNSC_NscResetCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_ResetCpuEn_t cpuEn)
Function for NSC_RESET_CMD.
#define PTX_NSC_IC_SERIAL_NUMBER_LENGTH
Definition ptxNSC_Interface.h:87
ptxStatus_t ptxNSC_RfActivate(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_RfActiv_Param_t *actParams)
Function used to select card to activate when chip is Reader and there are more than one card on the ...
ptxStatus_t ptxNSC_InitCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_Init_Param_t *initParams)
Function for NSC_INIT_CMD.
ptxStatus_t ptxNSC_RfConfig(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_RfConfig_Param_t *rfConfigParams)
Function used to build and send NSC_RF_CONFIG_REG.
struct ptxNSC * pptxNSC_t
Definition ptxNSC_Interface.h:124
ptxStatus_t ptxNSC_ReadTempSensor(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
Function for internal temperature sensor readout.
size_t ptxNSC_NscDataMsg_GetMaxPayload(ptxNSC_t *nscCtx)
Get Maximum payload length that can be transmitted to the NSC component.
ptxStatus_t ptxNSC_DeRegisterExtension(ptxNSC_t *nscCtx, uint8_t extensionID)
De-Register an NSC-Extension (Prototype/RFU).
ptxStatus_t ptxNSC_RRA_Multi(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint16_t *addresses, size_t numberOfAddresses)
NSC Read Random Address Multiple addresses to read from.
ptxStatus_t ptxNSC_DFY_Init(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
Function for filling NSC_INIT_CMD.
ptxStatus_t ptxNSC_T5T_IsolatedEoF(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl)
T5T Isolated EoF.
ptxStatus_t ptxNSC_RegisterExtension(ptxNSC_t *nscCtx, ptxNSC_Custom_Extension_t *extension)
Register an NSC-Extension (Prototype/RFU).
ptxStatus_t ptxNSC_NscCltMsg(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint8_t *pldBytes, uint8_t *pldParityBits, size_t length)
Function used to send NSC Data Msg to the chip.
enum ptxNsc_RfTest_Id ptxNsc_RfTest_Id_t
Test-IDs for RF-Test command.
ptxStatus_t(* pptxTbInt_GetIORQNtf_t)(void *cpLayer, struct ptxIoRq *io_rq)
Integration get IO RQ Ntf.
Definition ptxNSC_Interface.h:119
#define PTX_NSC_MAX_EXTENSIONS
Definition ptxNSC_InterfaceTypes.h:225
ptxStatus_t ptxNSC_SetNrResidualTxBits(ptxNSC_t *nscCtx, uint8_t transparentModeEnabled, uint8_t nrTxBits)
Enables or disables the NFC Type-A Transparent Mode and allows to set the number of residual Tx-bits ...
ptxStatus_t ptxNSC_RfTestStop(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
Function for NSC_RF_STOP_CMD.
struct ptxNSC_InitParam ptxNSC_InitParam_t
ptxStatus_t ptxNSC_NSCRfDeactivateCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNSC_Rf_Deact_Param_t *rfDeactParam)
Function for NSC_RF_DEACTIVATE_CMD.
#define PTX_NSC_TYPES_LISAATS_LEN
Definition ptxNSC_InterfaceTypes.h:163
#define PTX_NSC_GPIO_MAX_GPIOS
Definition ptxNSC_InterfaceTypes.h:216
ptxStatus_t ptxNSC_RCA(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, uint16_t regAddress, size_t length)
NSC read continuous Address.
ptxStatus_t ptxNSC_EmvGetDiscParams(struct ptxNSC *nscCtx, struct ptxNSC_Discover_Param *discoverParams)
Get discovery loop parameters for EMV.
ptxStatus_t ptxNSC_WRAMulti(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxTypes_WRA_t *pWRA, size_t WRASize)
NSC WRA Multiple values.
ptxStatus_t ptxNSC_StandbyCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
NSC_STANDY_CMD.
ptxStatus_t ptxNSC_SetUcodeActive(ptxNSC_t *nscCtx)
Set the uCode Image as Active.
ptxStatus_t ptxNSC_RfSetParamsCmd(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl, ptxNsc_RfPar_t *rfPar, size_t rfParLen)
Function for NSC_RF_SET_PARAMETER_CMD.
ptxStatus_t ptxNSC_Hal_Read_Synchronous(ptxNSC_t *nscCtx, uint8_t *rxBuf, size_t *rxLen)
Read upcoming data from the chip.
#define PTX_NSC_TYPES_LISANFCID1_LEN
Definition ptxNSC_InterfaceTypes.h:162
ptxStatus_t ptxNSC_PresCheck_NfcDep_AttentionCmd(struct ptxNSC *nscCtx, struct ptxIoRq *ioCpl)
ISO-DEP Presence Check (Attention Command).
ptxStatus_t ptxNSC_DFY_Activation(ptxNSC_t *nscCtx, struct ptxIoRq *ioCpl)
Function for DFY Activation. (Performed as synchronous operation).
ptxStatus_t ptxNSC_RfConfig_NvmLoad(ptxNSC_t *nscCtx, ptxNSC_RfConfig_Param_t *rfConfParams)
Function used to load RF-Config parameters from NVM to given parameter structure.
ptxNSC_Pause_Options
NSC Pause Options. .
Definition ptxNSC_InterfaceTypes.h:329
uint16_t ptxStatus_t
Status Type.
Definition ptx_Status.h:82
enum ptxStatus_Comps ptxStatus_Comps_t
Component Definitions.
struct ptxSemaphore * ptxSemaphore_t
Semaphore Wrapper Structure - Forward Declaration.
Definition ptxOsal.h:100
Buffer Pool Item structure.
Definition ptxBufferPool.h:114
Buffer Pool structure.
Definition ptxBufferPool.h:133
FIFO I/O Request structure.
Definition ptx_Fifo_IoRq.h:96
Main Component Struture.
Definition ptxHce.h:175
Main HAL Component structure.
Definition ptxHal_Ext.h:113
I/O Request structure.
Definition ptx_IoRq.h:154
Logger Component Structure.
Definition ptxLog.h:208
Definition ptxNSC_InterfaceTypes.h:1080
NSC Discover parameter structure.
Definition ptxNSC_InterfaceTypes.h:686
NSC General purpose buffer. Used to share already allocated data between threads.
Definition ptxNSC_InternalTypes.h:996
NSC Init CMD parameter structure.
Definition ptxNSC_InterfaceTypes.h:431
Definition ptxNSC_Interface.h:130
struct ptxHCI * HCI
Definition ptxNSC_Interface.h:131
struct ptxFifoIoRq * FIO
Definition ptxNSC_Interface.h:136
size_t NscBuffersSize
Definition ptxNSC_Interface.h:143
pptxTbInt_GetIORQNtf_t GetIORQDefault
Definition ptxNSC_Interface.h:139
struct ptxHCE * HCE
Definition ptxNSC_Interface.h:132
void * Integration
Definition ptxNSC_Interface.h:138
struct ptxLog * LOG
Definition ptxNSC_Interface.h:135
uint32_t ComSpeedApp
Definition ptxNSC_Interface.h:140
uint8_t BufPoolDbgLogEn
Definition ptxNSC_Interface.h:145
uint8_t IsNCICommanding
Definition ptxNSC_Interface.h:142
uint8_t HwFlowControl
Definition ptxNSC_Interface.h:141
struct ptxHal * HAL
Definition ptxNSC_Interface.h:133
size_t NumBuffers
Definition ptxNSC_Interface.h:144
struct ptxOsal * OS
Definition ptxNSC_Interface.h:134
struct ptxNvm * NVM
Definition ptxNSC_Interface.h:137
NSC Misc. Rf Config Parameters.
Definition ptxNSC_InternalTypes.h:1056
NSC Read CMD parameter structure.
Definition ptxNSC_InterfaceTypes.h:476
NSC RF Deactivate Parameters.
Definition ptxNSC_InterfaceTypes.h:817
NSC Rf Activate structure.
Definition ptxNSC_InterfaceTypes.h:649
NSC Rf Config Parameters.
Definition ptxNSC_InterfaceTypes.h:531
System confiurations.
Definition ptxNSC_System.h:80
NSC Write CMD parameter structure.
Definition ptxNSC_InterfaceTypes.h:457
Definition ptxNSC_Interface.h:152
struct ptxFifoIoRq * FIO
Definition ptxNSC_Interface.h:156
uint8_t ListenA_ATS[PTX_NSC_TYPES_LISAATS_LEN]
Definition ptxNSC_Interface.h:195
void * NSCData
Definition ptxNSC_Interface.h:171
uint32_t PollA_Enable
Definition ptxNSC_Interface.h:187
uint32_t NscRxDelay
Definition ptxNSC_Interface.h:186
ptxSemaphore_t SemPauseThreadConfirm
Definition ptxNSC_Interface.h:167
uint8_t * NSC_HCI_Data
Definition ptxNSC_Interface.h:199
ptxNSC_RFMiscConfig_Param_t RFConfigMiscParams
Definition ptxNSC_Interface.h:203
volatile uint8_t ExitFlag
Definition ptxNSC_Interface.h:168
pptxTbInt_GetIORQNtf_t GetIORQDefault
Definition ptxNSC_Interface.h:162
uint8_t ListenA_NFCID1[PTX_NSC_TYPES_LISANFCID1_LEN]
Definition ptxNSC_Interface.h:194
uint8_t ListenB_ATTRIB_RES[PTX_NSC_TYPES_LISBATTRIBRES_LEN]
Definition ptxNSC_Interface.h:198
uint8_t TypeATransparentModeActive
Definition ptxNSC_Interface.h:208
void * Integration
Definition ptxNSC_Interface.h:159
ptxSemaphore_t SemIoSync
Definition ptxNSC_Interface.h:164
uint8_t GPIO_Cfg[PTX_NSC_GPIO_MAX_GPIOS]
Definition ptxNSC_Interface.h:205
uint8_t ChainingState
Definition ptxNSC_Interface.h:176
size_t NSC_HCI_Data_Len
Definition ptxNSC_Interface.h:200
uint8_t StateUCodeImage
Definition ptxNSC_Interface.h:180
uint8_t ListenA_ATQA[PTX_NSC_TYPES_LISASENSRES_LEN]
Definition ptxNSC_Interface.h:192
uint8_t ProductID
Definition ptxNSC_Interface.h:206
uint32_t ListenA_Enable
Definition ptxNSC_Interface.h:191
char RfConfigFileName[PTX_NSC_RFCONFIG_NAME_CAPACITY]
Definition ptxNSC_Interface.h:202
struct ptxThread * RxThread
Definition ptxNSC_Interface.h:170
struct ptxNSC_RoutingTable * RoutingTable
Definition ptxNSC_Interface.h:173
struct ptxLog * LOG
Definition ptxNSC_Interface.h:155
struct ptxNSC_Custom_Extension CustomExtension[PTX_NSC_MAX_EXTENSIONS]
Definition ptxNSC_Interface.h:222
ptxNSC_CmdSched_Param_t CmdSchedule
Definition ptxNSC_Interface.h:218
uint32_t NscSpeed
Definition ptxNSC_Interface.h:184
struct ptxNSC_HCI * NscHci
Definition ptxNSC_Interface.h:174
uint8_t TransparentModeNrResidualTxBits
Definition ptxNSC_Interface.h:209
uint8_t NrCustomExtensions
Definition ptxNSC_Interface.h:221
ptxNSC_NtfAfterCommError_t GenErrorNtf
Definition ptxNSC_Interface.h:219
uint32_t ListenA_SAK
Definition ptxNSC_Interface.h:193
ptxSemaphore_t SemPauseThreadPause
Definition ptxNSC_Interface.h:166
uint8_t IcSerialNumber[PTX_NSC_IC_SERIAL_NUMBER_LENGTH]
Definition ptxNSC_Interface.h:183
ptxBufferPool_t BP
Definition ptxNSC_Interface.h:160
ptxNSC_States_t State
Definition ptxNSC_Interface.h:182
ptxNSC_WfNtfAfterChained_t WfNtfState
Definition ptxNSC_Interface.h:201
uint8_t RxCltMode
Definition ptxNSC_Interface.h:178
struct ptxNSC_System * NscSystem
Definition ptxNSC_Interface.h:175
uint32_t RspTimeout
Definition ptxNSC_Interface.h:165
ptxNscRdTriggModes_t RdTriggMode
Definition ptxNSC_Interface.h:204
uint32_t ListenB_Enable
Definition ptxNSC_Interface.h:196
uint32_t DeactiveTimeoutMS
Definition ptxNSC_Interface.h:207
uint8_t IsNCICommanding
Definition ptxNSC_Interface.h:161
volatile uint8_t PauseFlag
Definition ptxNSC_Interface.h:169
size_t ChainedLength
Definition ptxNSC_Interface.h:179
uint8_t HwFlowControl
Definition ptxNSC_Interface.h:185
struct ptxHal * HAL
Definition ptxNSC_Interface.h:157
ptxNSC_GPBuffer_t NSCGPBuffer
Definition ptxNSC_Interface.h:172
ptxStatus_Comps_t CompId
Definition ptxNSC_Interface.h:153
struct ptxOsal * OS
Definition ptxNSC_Interface.h:154
uint8_t * ChainedPayload
Definition ptxNSC_Interface.h:177
uint32_t PollB_Enable
Definition ptxNSC_Interface.h:188
struct ptxBufferPool_Item * ActiveResponseBuffer
Definition ptxNSC_Interface.h:163
uint8_t ListenB_SENSB_RES[PTX_NSC_TYPES_LISBSENSRES_LEN]
Definition ptxNSC_Interface.h:197
struct ptxNvm * NVM
Definition ptxNSC_Interface.h:158
uint32_t PollF_Enable
Definition ptxNSC_Interface.h:189
uint32_t DiscoveryIdleTime
Definition ptxNSC_Interface.h:190
Rf Param.
Definition ptxNSC_InterfaceTypes.h:981
Main Nvm Component.
Definition ptxNvm.h:140
WRA data type.
Definition ptxNSC_InterfaceTypes.h:340