All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Smart Card PHY GPIO Driver
Smart Card

## Overview

The Smart Card interface GPIO driver handles the GPIO and FTM/TPM peripheral for clock generation, which covers all necessary functions to control the ICC. These functions are ICC clock setup, ICC voltage turning on/off, activation/deactivation, and ICC reset sequences. This driver doesn't support the ICC pin short circuit protection and an emergency deactivation.

## Macros

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

## Functions

void | SMARTCARD_PHY_GPIO_GetDefaultConfig (smartcard_interface_config_t *config)
| Fill in config structure with default values. More...
status_t | SMARTCARD_PHY_GPIO_Init (UART_Type *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz)
| Initializes a Smart card interface instance for operation. More...
void | SMARTCARD_PHY_GPIO_Deinit (UART_Type *base, smartcard_interface_config_t *config)
| De-initializes a Smart card interface. More...
status_t | SMARTCARD_PHY_GPIO_Activate (UART_Type *base, smartcard_context_t *context, smartcard_reset_type_t resetType)
| Activates the Smart card IC. More...
status_t | SMARTCARD_PHY_GPIO_Deactivate (UART_Type *base, smartcard_context_t *context)
| De-activates the Smart card IC. More...
status_t | SMARTCARD_PHY_GPIO_Control (UART_Type *base, smartcard_context_t *context, smartcard_interface_control_t control, uint32_t param)
| Controls Smart card interface IC. More...

## Function Documentation

void SMARTCARD_PHY_GPIO_GetDefaultConfig | ( | smartcard_interface_config_t * | config | ) |

Parameters

  config | The Smart card 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_GPIO_Init | ( | UART_Type * | base,
|  | smartcard_interface_config_t const * | config,
|  | uint32_t | srcClock_Hz
| ) |  |

Parameters

  base | The Smart card peripheral module 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_GPIO_GetDefaultConfig().
  srcClock_Hz | Smart card clock generation module source clock.

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

void SMARTCARD_PHY_GPIO_Deinit | ( | UART_Type * | base,
|  | smartcard_interface_config_t * | config
| ) |  |

Stops Smart card clock and disable VCC.

Parameters

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

status_t SMARTCARD_PHY_GPIO_Activate | ( | UART_Type * | base,
|  | smartcard_context_t * | context,
|  | smartcard_reset_type_t | resetType
| ) |  |

Parameters

  base | The Smart card peripheral module base address.
  context | A pointer to a Smart card 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_GPIO_Deactivate | ( | UART_Type * | base,
|  | smartcard_context_t * | context
| ) |  |

Parameters

  base | The Smart card peripheral module base address.
  context | A pointer to a Smart card driver context structure.

Return values

  kStatus_SMARTCARD_Success | or kStatus_SMARTCARD_OtherError in case of error.

status_t SMARTCARD_PHY_GPIO_Control | ( | UART_Type * | base,
|  | smartcard_context_t * | context,
|  | smartcard_interface_control_t | control,
|  | uint32_t | param
| ) |  |

Parameters

  base | The Smart card peripheral module base address.
  context | A pointer to a Smart card 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.