| 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 NCN8025 Driver
Smart Card

## Overview

The Smart Card interface NCN8025 driver handles the external interface chip NCN8025 which supports all necessary functions to control the ICC. These functions involve PHY pin initialization, ICC voltage selection and activation, ICC clock generation, ICC card detection, and activation/deactivation sequences.

## Files
file | fsl_smartcard_phy_ncn8025.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.
#define | SMARTCARD_NCN8025_STATUS_PRES (0x01u)
| Masks for NCN8025 status register. More...
#define | SMARTCARD_NCN8025_STATUS_ACTIVE (0x02u)
| SMARTCARD phy NCN8025 smartcard active status.
#define | SMARTCARD_NCN8025_STATUS_FAULTY (0x04u)
| SMARTCARD phy NCN8025 smartcard faulty status.
#define | SMARTCARD_NCN8025_STATUS_CARD_REMOVED (0x08u)
| SMARTCARD phy NCN8025 smartcard removed status.
#define | SMARTCARD_NCN8025_STATUS_CARD_DEACTIVATED (0x10u)
| SMARTCARD phy NCN8025 smartcard deactivated status.

## Functions
void | SMARTCARD_PHY_NCN8025_GetDefaultConfig (smartcard_interface_config_t *config)
| Fill in config structure with default values. More...
status_t | SMARTCARD_PHY_NCN8025_Init (void *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz)
| Initializes an SMARTCARD interface instance for operation. More...
void | SMARTCARD_PHY_NCN8025_Deinit (void *base, smartcard_interface_config_t *config)
| De-initializes an SMARTCARD interface. More...
status_t | SMARTCARD_PHY_NCN8025_Activate (void *base, smartcard_context_t *context, smartcard_reset_type_t resetType)
| Activates the smart card IC. More...
status_t | SMARTCARD_PHY_NCN8025_Deactivate (void *base, smartcard_context_t *context)
| De-activates the smart card IC. More...
status_t | SMARTCARD_PHY_NCN8025_Control (void *base, smartcard_context_t *context, smartcard_interface_control_t control, uint32_t param)
| Controls SMARTCARD interface IC. More...
void | SMARTCARD_PHY_NCN8025_IRQHandler (void *base, smartcard_context_t *context)
| SMARTCARD interface IC IRQ ISR. More...

## Macro Definition Documentation

#define SMARTCARD_NCN8025_STATUS_PRES (0x01u)

SMARTCARD phy NCN8025 smartcard present status

## Function Documentation

void SMARTCARD_PHY_NCN8025_GetDefaultConfig | ( | smartcard_interface_config_t * | config | ) |

Parameters

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

status_t SMARTCARD_PHY_NCN8025_Init | ( | void * | base,
|  | smartcard_interface_config_t const * | config,
|  | uint32_t | srcClock_Hz
| ) |  |

Parameters

  base | The SMARTCARD peripheral base address.
  config | The user configuration structure of type smartcard_interface_config_t. The user can call to fill out configuration structure function SMARTCARD_PHY_NCN8025_GetDefaultConfig().
  srcClock_Hz | Smartcard clock generation module source clock.

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

void SMARTCARD_PHY_NCN8025_Deinit | ( | void * | base,
|  | smartcard_interface_config_t * | config
| ) |  |

Stops smartcard clock and disable VCC.

Parameters

  base | The SMARTCARD peripheral module base address.
  config | The user configuration structure of type smartcard_interface_config_t.

status_t SMARTCARD_PHY_NCN8025_Activate | ( | void * | base,
|  | smartcard_context_t * | context,
|  | smartcard_reset_type_t | resetType
| ) |  |

Parameters

  base | The SMARTCARD peripheral module 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_NCN8025_Deactivate | ( | void * | base,
|  | smartcard_context_t * | context
| ) |  |

Parameters

  base | The SMARTCARD peripheral module 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_NCN8025_Control | ( | void * | base,
|  | smartcard_context_t * | context,
|  | smartcard_interface_control_t | control,
|  | uint32_t | param
| ) |  |

Parameters

  base | The SMARTCARD peripheral module 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.

void SMARTCARD_PHY_NCN8025_IRQHandler | ( | void * | base,
|  | smartcard_context_t * | context
| ) |  |

Parameters

  base | The SMARTCARD peripheral module base address.
  context | The smartcard context pointer.