MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Smart Card FreeRTOS Driver

Overview

Data Structures

struct  rtos_smartcard_context_t
 Runtime RTOS Smart card driver context. More...
 

Macros

#define RTOS_SMARTCARD_COMPLETE   0x1u
 Smart card RTOS transfer complete flag.
 
#define RTOS_SMARTCARD_TIMEOUT   0x2u
 Smart card RTOS transfer time-out flag.
 
#define SMARTCARD_Control(base, context, control, param)   SMARTCARD_EMVSIM_Control(base, context, control, param)
 Common Smart card driver API defines. More...
 
#define SMARTCARD_Transfer(base, context, xfer)   SMARTCARD_EMVSIM_TransferNonBlocking(base, context, xfer)
 Common Smart card API macro.
 
#define SMARTCARD_AbortTransfer(base, context)   SMARTCARD_EMVSIM_AbortTransfer(base, context)
 Common Smart card API macro.
 
#define SMARTCARD_Init(base, context, sourceClockHz)   SMARTCARD_EMVSIM_Init(base, context, sourceClockHz)
 Common Smart card API macro.
 
#define SMARTCARD_Deinit(base)   SMARTCARD_EMVSIM_Deinit(base)
 Common Smart card API macro.
 
#define SMARTCARD_GetTransferRemainingBytes(base, context)   SMARTCARD_EMVSIM_GetTransferRemainingBytes(base, context)
 Common Smart card API macro.
 
#define SMARTCARD_GetDefaultConfig(cardParams)   SMARTCARD_EMVSIM_GetDefaultConfig(cardParams)
 Common Smart card API macro.
 
#define SMARTCARD_PHY_Activate(base, context, resetType)   SMARTCARD_PHY_EMVSIM_Activate(base, context, resetType)
 Common Smart card API macro.
 
#define SMARTCARD_PHY_Deactivate(base, context)   SMARTCARD_PHY_EMVSIM_Deactivate(base, context)
 Common Smart card API macro.
 
#define SMARTCARD_PHY_Control(base, context, control, param)   SMARTCARD_PHY_EMVSIM_Control(base, context, control, param)
 Common Smart card API macro.
 
#define SMARTCARD_PHY_Init(base, config, sourceClockHz)   SMARTCARD_PHY_EMVSIM_Init(base, config, sourceClockHz)
 Common Smart card API macro.
 
#define SMARTCARD_PHY_Deinit(base, config)   SMARTCARD_PHY_EMVSIM_Deinit(base, config)
 Common Smart card API macro \
 
#define SMARTCARD_PHY_GetDefaultConfig(config)   SMARTCARD_PHY_EMVSIM_GetDefaultConfig(config)
 Common Smart card API macro.
 

Functions

int SMARTCARD_RTOS_Init (void *base, rtos_smartcard_context_t *ctx, uint32_t sourceClockHz)
 Initializes a Smart card (EMVSIM/UART) peripheral for Smart card/ISO-7816 operation. More...
 
int SMARTCARD_RTOS_Deinit (rtos_smartcard_context_t *ctx)
 This function disables the Smart card (EMVSIM/UART) interrupts, disables the transmitter and receiver, and flushes the FIFOs (for modules that support FIFOs) and gates Smart card clock in SIM. More...
 
int SMARTCARD_RTOS_Transfer (rtos_smartcard_context_t *ctx, smartcard_xfer_t *xfer)
 Transfers data using interrupts. More...
 
int SMARTCARD_RTOS_AbortTransfer (rtos_smartcard_context_t *ctx)
 Terminates an asynchronous EMVSIM transfer early. More...
 
int SMARTCARD_RTOS_WaitForXevent (rtos_smartcard_context_t *ctx)
 Waits until the transfer is finished. More...
 
int SMARTCARD_RTOS_Control (rtos_smartcard_context_t *ctx, smartcard_control_t control, uint32_t param)
 Controls the Smart card module per different user requests. More...
 
int SMARTCARD_RTOS_PHY_Control (rtos_smartcard_context_t *ctx, smartcard_interface_control_t control, uint32_t param)
 Controls the Smart card module as per different user request. More...
 
int SMARTCARD_RTOS_PHY_Activate (rtos_smartcard_context_t *ctx, smartcard_reset_type_t resetType)
 Activates the Smart card interface. More...
 
int SMARTCARD_RTOS_PHY_Deactivate (rtos_smartcard_context_t *ctx)
 Deactivates the Smart card interface. More...
 

Data Structure Documentation

struct rtos_smartcard_context_t

Data Fields

SemaphoreHandle_t x_sem
 RTOS unique access assurance object.
 
SemaphoreHandle_t x_event
 RTOS synchronization object.
 
smartcard_context_t x_context
 transactional layer state
 

Macro Definition Documentation

#define SMARTCARD_Control (   base,
  context,
  control,
  param 
)    SMARTCARD_EMVSIM_Control(base, context, control, param)

Common Smart card API macro

Function Documentation

int SMARTCARD_RTOS_Init ( void *  base,
rtos_smartcard_context_t ctx,
uint32_t  sourceClockHz 
)

Also initialize Smart card PHY interface.

This function ungates the Smart card clock, initializes the module to EMV default settings, configures the IRQ state structure, and enables the module-level interrupt to the core. Initializes RTOS synchronization objects and context.

Parameters
baseThe Smart card peripheral base address.
ctxThe Smart card RTOS structure.
sourceClockHzSmart card clock generation module source clock.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_Deinit ( rtos_smartcard_context_t ctx)

It also deactivates Smart card PHY interface, stops Smart card clocks, and frees all synchronization objects allocated in the RTOS Smart card context.

Parameters
ctxThe Smart card RTOS state.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_Transfer ( rtos_smartcard_context_t ctx,
smartcard_xfer_t xfer 
)

A blocking (also known as synchronous) function means that the function returns after the transfer is done. User can cancel this transfer by calling the function AbortTransfer.

Parameters
ctxA pointer to the RTOS Smart card driver context.
xferSmart card transfer structure.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_AbortTransfer ( rtos_smartcard_context_t ctx)

During an async EMVSIM transfer, the user can terminate the transfer early if the transfer is still in progress.

Parameters
ctxA pointer to the RTOS Smart card driver context.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_WaitForXevent ( rtos_smartcard_context_t ctx)

Task waits on a transfer finish event. Don't initialize the transfer. Instead, wait for a transfer callback. This function can be used while waiting on an initial TS character.

Parameters
ctxA pointer to the RTOS Smart card driver context.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_Control ( rtos_smartcard_context_t ctx,
smartcard_control_t  control,
uint32_t  param 
)
Parameters
ctxThe Smart card RTOS context pointer.
controlControl type.
paramInteger value to control the command.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_PHY_Control ( rtos_smartcard_context_t ctx,
smartcard_interface_control_t  control,
uint32_t  param 
)
Parameters
ctxThe Smart card RTOS context pointer.
controlControl type
paramInteger value to control the command.
Returns
A zero in success or error code.
int SMARTCARD_RTOS_PHY_Activate ( rtos_smartcard_context_t ctx,
smartcard_reset_type_t  resetType 
)
Parameters
ctxThe Smart card RTOS driver context structure.
resetTypetype of reset to be performed, possible values = kSmartcardColdReset, kSmartcardWarmReset
Returns
A zero in success or error code.
int SMARTCARD_RTOS_PHY_Deactivate ( rtos_smartcard_context_t ctx)
Parameters
ctxThe Smart card RTOS driver context structure.
Returns
A zero in success or error code.