| Kinetis SDK v.2.0 API Reference Manual Rev. 0 Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Files | Macros | Functions
Smart Card PHY EMVSIM Driver
Smart Card

## Overview

The Smart Card interface EMVSIM driver handles the EMVSIM peripheral, which covers all necessary functions to control the ICC. These functions are ICC clock setup, ICC voltage turning on/off, ICC card detection, activation/deactivation, and ICC reset sequences. The EMVSIM peripheral covers all features of interface ICC chips.

## Files
file | fsl_smartcard_phy_emvsim.h

## Macros
#define | SMARTCARD_ATR_DURATION_ADJUSTMENT (360u)
| SMARTCARD define which specify adjustment number of clock cycles during which ATR string has to be received.
#define | SMARTCARD_INIT_DELAY_CLOCK_CYCLES_ADJUSTMENT (4200u)
| SMARTCARD define which specify adjustment number of clock cycles until initial 'TS' character has to be received.

## Functions
void | SMARTCARD_PHY_EMVSIM_GetDefaultConfig (smartcard_interface_config_t *config)
| Fill in smartcardInterfaceConfig structure with default values. More...
status_t | SMARTCARD_PHY_EMVSIM_Init (EMVSIM_Type *base, const smartcard_interface_config_t *config, uint32_t srcClock_Hz)
| Configures an SMARTCARD interface for operation. More...
void | SMARTCARD_PHY_EMVSIM_Deinit (EMVSIM_Type *base, const smartcard_interface_config_t *config)
| De-initializes an SMARTCARD interface. More...
status_t | SMARTCARD_PHY_EMVSIM_Activate (EMVSIM_Type *base, smartcard_context_t *context, smartcard_reset_type_t resetType)
| Activates the smart card IC. More...
status_t | SMARTCARD_PHY_EMVSIM_Deactivate (EMVSIM_Type *base, smartcard_context_t *context)
| De-activates the smart card IC. More...
status_t | SMARTCARD_PHY_EMVSIM_Control (EMVSIM_Type *base, smartcard_context_t *context, smartcard_interface_control_t control, uint32_t param)
| Controls SMARTCARD interface IC. More...

## Function Documentation

void SMARTCARD_PHY_EMVSIM_GetDefaultConfig | ( | smartcard_interface_config_t * | config | ) |

Parameters

  config | The user configuration structure of type smartcard_interface_config_t. Function fill in members: clockToResetDelay = 40000, vcc = kSmartcardVoltageClassB3_3V with default values.

status_t SMARTCARD_PHY_EMVSIM_Init | ( | EMVSIM_Type * | base,
|  | const smartcard_interface_config_t * | config,
|  | uint32_t | srcClock_Hz
| ) |  |

Parameters

  base | The SMARTCARD peripheral module base address.
  config | The user configuration structure of type smartcard_interface_config_t. The user is responsible to fill out the members of this structure and to pass the pointer of this structure into this function or call SMARTCARD_PHY_EMVSIMInitUserConfigDefault to fill out structure with default values.
  srcClock_Hz | SMARTCARD clock generation module source clock.

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

void SMARTCARD_PHY_EMVSIM_Deinit | ( | EMVSIM_Type * | base,
|  | const smartcard_interface_config_t * | config
| ) |  |

Stops SMARTCARD clock and disable VCC.

Parameters

  base | Smartcard peripheral module base address.
  config | SMARTCARD configuration structure.

status_t SMARTCARD_PHY_EMVSIM_Activate | ( | EMVSIM_Type * | base,
|  | smartcard_context_t * | context,
|  | smartcard_reset_type_t | resetType
| ) |  |

Parameters

  base | The EMVSIM peripheral base address.
  context | A pointer to a SMARTCARD driver context structure.
  resetType | type of reset to be performed, possible values = kSmartcardColdReset, kSmartcardWarmReset

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

status_t SMARTCARD_PHY_EMVSIM_Deactivate | ( | EMVSIM_Type * | base,
|  | smartcard_context_t * | context
| ) |  |

Parameters

  base | The EMVSIM peripheral base address.
  context | A pointer to a smartcard driver context structure.

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

status_t SMARTCARD_PHY_EMVSIM_Control | ( | EMVSIM_Type * | base,
|  | smartcard_context_t * | context,
|  | smartcard_interface_control_t | control,
|  | uint32_t | param
| ) |  |

Parameters

  base | The EMVSIM peripheral base address.
  context | A pointer to a SMARTCARD driver context structure.
  control | A interface command type.
  param | Integer value specific to control type

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.