Renesas PTX1xxR IoT-Reader API (non-OS) Version 7.3.1
Renesas Software Stack for IoT-Reader Applications (non-OS)
ptxHce.h
Go to the documentation of this file.
1
49#ifndef COMPS_HCE_PTXHCE_H_
50#define COMPS_HCE_PTXHCE_H_
51
52/*
53 * ####################################################################################################################
54 * INCLUDES
55 * ####################################################################################################################
56 */
57#include "ptxStatus.h"
58#include "ptxNSC_Event.h"
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/*
65 * ####################################################################################################################
66 * DATA DEFINITIONS
67 * ####################################################################################################################
68 */
69
70/*
71 * Forward declarations.
72 */
73struct ptxPlat;
74struct ptxNSC;
75struct ptxNSC_Event;
76
80typedef struct
81{
83 uint8_t ListenTypeA;
84
85 /*
86 * RFU
87 */
88
90
94typedef enum
95{
96 HceRfProt_Undefined = 0x00,
97 HceRfProt_T2T = 0x02,
98 HceRfProt_IsoDep = 0x04
99
101
105typedef enum
106{
107 e_MaxNrOfEventRecords = 32,
108 e_SizeOfShortMsgBuffer = 3, /* pay-load of medium size data message buffers. */
109 e_SizeOfActivationBuffer = 16, /* pay-load of medium size data message buffers. */
110
112
116typedef enum
117{
118 e_EvtRecordIndexMin = 0,
119 e_EvtRecordIndexMax = e_MaxNrOfEventRecords-1,
120 e_EvtMaxNrOfRecords,
121 e_EvtRecIndexNotSet
122
124
129{
130 HceEvent_ExtFieldOn,
131 HceEvent_ExtFieldOff,
132 HceEvent_Activated_ListenA,
133 HceEvent_Data,
134 HceEvent_Deactivated,
135 HceEvent_NoEvent,
136
138
142typedef struct
143{
145 uint8_t RxMsgDataShortMsgData[e_SizeOfShortMsgBuffer];
146 uint8_t *RxMsgData;
147 uint32_t RxMsgDataLen;
150
164
168typedef struct ptxHce
169{
171 struct ptxPlat *Plat;
172 struct ptxNSC *Nsc;
175 uint8_t ActivationData[e_SizeOfActivationBuffer];
176 uint8_t *AppRxBuffer;
183
188#define PTX_HCE_DEACTIVATE_REASON_DESELECT (uint8_t)0x01
189#define PTX_HCE_DEACTIVATE_REASON_RELEASE (uint8_t)0x02
190#define PTX_HCE_DEACTIVATE_REASON_FIELD_OFF (uint8_t)0x03
194/*
195 * ####################################################################################################################
196 * HCE API FUNCTIONS
197 * ####################################################################################################################
198 */
199
212ptxStatus_t ptxHce_Init ( ptxHce_t *hce, struct ptxPlat *plat, struct ptxNSC *nsc, uint8_t *appRxBuffer, uint16_t appRxBufferSize );
213
214
224
248
271ptxStatus_t ptxHce_Send_Data ( ptxHce_t *hce, uint8_t *tx, uint32_t txLength );
272
284ptxStatus_t ptxHce_ReserveEventRecord ( ptxHce_t *hce, ptxHce_EventRecord_t **evtRecord, uint16_t *evtRecordIndex );
294ptxStatus_t ptxHce_AddNewEventPending ( ptxHce_t *hce, uint16_t recordIndex );
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif /* Guard */
301
ptxStatus_t ptxHce_Get_Event(ptxHce_t *hce, ptxHce_EventRecord_t **event)
This function allows the user to request latest event notification data received from the PTX card em...
ptxStatus_t ptxHce_ReserveEventRecord(ptxHce_t *hce, ptxHce_EventRecord_t **evtRecord, uint16_t *evtRecordIndex)
Reserves an Event Record at the Tail of the Event Queue.
struct ptxHce ptxHce_t
HCE Main Structure (Context).
ptxStatus_t ptxHce_AddNewEventPending(ptxHce_t *hce, uint16_t recordIndex)
Adds a new pending Event Record at the Tail of the Event Queue.
ptxStatus_t ptxHce_Init(ptxHce_t *hce, struct ptxPlat *plat, struct ptxNSC *nsc, uint8_t *appRxBuffer, uint16_t appRxBufferSize)
This function initializes the Host Card Emulation Component (HCE).
ptxHce_EventType
HCE Event Identifiers.
Definition ptxHce.h:129
ptxHce_EventQueueDimensions_t
HCE Event Queue Management (Dimensions)
Definition ptxHce.h:106
ptxStatus_t ptxHce_Deinit(ptxHce_t *hce)
This function De-initializes the Host Card Emulation Component.
ptxHce_EventQueueRanges_t
HCE Event Queue Management (Ranges)
Definition ptxHce.h:117
enum ptxHce_EventType ptxHce_EventType_t
HCE Event Identifiers.
ptxStatus_t ptxHce_Send_Data(ptxHce_t *hce, uint8_t *tx, uint32_t txLength)
This function allows the currently activated card to send data to a nearby card reader.
ptxHce_RfProtocol_t
HCE RF-Protocol Type(s)
Definition ptxHce.h:95
uint16_t ptxStatus_t
Status Type.
Definition ptxStatus.h:70
enum ptxStatus_Comps ptxStatus_Comps_t
Component Definitions.
HCE RF-Discovery Configuration for Listen-Mode.
Definition ptxHce.h:81
uint8_t ListenTypeA
Definition ptxHce.h:83
HCE Event Queue.
Definition ptxHce.h:155
ptxHce_EventQueueRanges_t TailIndex
Definition ptxHce.h:158
ptxHce_EventQueueRanges_t NrOfEntries
Definition ptxHce.h:156
ptxHce_EventQueueRanges_t MaxNrOfEntries
Definition ptxHce.h:159
ptxHce_EventQueueRanges_t HeadIndex
Definition ptxHce.h:157
HCE Event Record Type.
Definition ptxHce.h:143
uint8_t * RxMsgData
Definition ptxHce.h:146
ptxHce_EventType_t EventID
Definition ptxHce.h:144
uint32_t RxMsgDataLen
Definition ptxHce.h:147
HCE Main Structure (Context).
Definition ptxHce.h:169
uint32_t AppRxBufferSize
Definition ptxHce.h:177
uint32_t AppRxBufferIndex
Definition ptxHce.h:178
uint8_t * AppRxBuffer
Definition ptxHce.h:176
struct ptxPlat * Plat
Definition ptxHce.h:171
uint8_t DiscoverState
Definition ptxHce.h:180
uint8_t ActivationData[e_SizeOfActivationBuffer]
Definition ptxHce.h:175
struct ptxNSC * Nsc
Definition ptxHce.h:172
ptxHce_EventQueue_t EventQ
Definition ptxHce.h:173
ptxStatus_Comps_t CompId
Definition ptxHce.h:170
NSC event information.
Definition ptxNSC_Event.h:128
Main NSC component structure.
Definition ptxNSC.h:1184