Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_emvsim_hal.h File Reference
#include <assert.h>
#include <stdint.h>
#include <stdbool.h>
#include "fsl_device_registers.h"

Enumerations

enum  emvsim_module_param_t {
  kEmvsimParamVersion = 0U,
  kEmvsimParamTxFifoSize = 1U,
  kEmvsimParamRxFifoSize = 2U
}
 Module basic parameter selections. More...
 
enum  emvsim_gpc_clock_select_t {
  kEmvsimGPCClockDisable = 0U,
  kEmvsimGPCCardClock = 1U,
  kEmvsimGPCRxClock = 2U,
  kEmvsimGPCTxClock = 3U
}
 General Purpose Counter clock selections. More...
 
enum  emvsim_crc_flip_control_t {
  kEmvsimCrcNoFlip = 0U,
  kEmvsimCrcFlip = 1U
}
 CRC bit flip control. More...
 
enum  emvsim_crc_inv_control_t {
  kEmvsimCrcNoInv = 0U,
  kEmvsimCrcInv = 1U
}
 CRC bit inversion control. More...
 
enum  emvsim_stop_clock_control_t {
  kEmvsimStopDownAllClocks = 0U,
  kEmvsimStopDownAllButCardClock = 1U
}
 EMVSIM STOP instruction clock control. More...
 
enum  emvsim_doze_clock_control_t {
  kEmvsimDozeDownAllClocks = 0U,
  kEmvsimDozeDownNoClocks = 1U
}
 EMVSIM DOZE instruction clock control. More...
 
enum  emvsim_data_convention_t {
  kEmvsimDirectConvention = 0U,
  kEmvsimInverseConvention = 1U
}
 EMVSIM data convention. More...
 
enum  emvsim_character_mode_t {
  kEmvsimCharacter12EtuMode = 0U,
  kEmvsimCharacter11EtuMode = 1U
}
 EMVSIM character mode. More...
 
enum  emvsim_control_t {
  kEmvsimCtrlInverseConvention = 0U,
  kEmvsimCtrlinitialCharacterMode = 1U,
  kEmvsimCtrlANACKEnable = 2U,
  kEmvsimCtrlONACKEnable = 3U,
  kEmvsimCtrlFlushRx = 8U,
  kEmvsimCtrlFlushTx = 9U,
  kEmvsimCtrlSwRst = 10U,
  kEmvsimCtrlKillClocks = 11U,
  kEmvsimCtrlDozeEnable = 12U,
  kEmvsimCtrlStopEnable = 13U,
  kEmvsimCtrlReceiverEnable = 16U,
  kEmvsimCtrlTransmitterEnable = 17U,
  kEmvsimCtrlRcvr11ModeEnable = 18U,
  kEmvsimCtrlRxDmaEnable = 19U,
  kEmvsimCtrlTxDmaEnable = 20U,
  kEmvsimCtrlInvertCrcOutput = 24U,
  kEmvsimCtrlFlipCrcOutput = 25U,
  kEmvsimCtrlFlipCrcInput = 26U,
  kEmvsimCtrlCWTEnable = 27U,
  kEmvsimCtrlLrcEnable = 28U,
  kEmvsimCtrlCrcEnable = 29U,
  kEmvsimCtrlXmtCrcOrLrcEnable = 30U,
  kEmvsimCtrlBWTEnable = 31U
}
 EMVSIM Control functions. More...
 
enum  emvsim_interrupt_t {
  kEmvsimIntRxData = 0U,
  kEmvsimIntGPCnt1 = 1U,
  kEmvsimIntBGTErr = 2U,
  kEmvsimIntBWTErr = 3U,
  kEmvsimIntRxNackThreshold = 4U,
  kEmvsimIntCWTErr = 5U,
  kEmvsimIntGPCnt0 = 6U,
  kEmvsimIntTxDataThreshold = 7U,
  kEmvsimIntTxFIFOFull = 8U,
  kEmvsimIntTxNackThresold = 9U,
  kEmvsimIntTxFIFOEmpty = 10U,
  kEmvsimIntEarlyTxComplete = 11U,
  kEmvsimIntRxFIFOOverflow = 12U,
  kEmvsimIntTxComplete = 13U,
  kEmvsimIntRxDataThreshold = 14U,
  kEmvsimIntPresenceDetect = 15U
}
 EMVSIM interrupt status/reasons. More...
 
enum  emvsim_rx_status_t {
  kEmvsimFrameErr = 0U,
  kEmvsimParityErr = 1U,
  kEmvsimBGTErr = 2U,
  kEmvsimBWTErr = 3U,
  kEmvsimRxNackThresholdErr = 4U,
  kEmvsimCWTErr = 5U,
  kEmvsimCRCCheckOk = 6U,
  kEmvsimLRCCheckOk = 7U,
  kEmvsimRxDataThreshold = 8U,
  kEmvsimRxData = 9U,
  kEmvsimRxDataOverflow = 10U,
  kEmvsimRxAllStatus = 11U
}
 EMVSIM receive status flags. More...
 
enum  emvsim_tx_status_t {
  kEmvsimGPCNT1Timeout = 0U,
  kEmvsimGPCNT0Timeout = 1U,
  kEmvsimTxDataThreshold = 2U,
  kEmvsimTxFIFOFull = 3U,
  kEmvsimTxComplete = 4U,
  kEmvsimEarlyTxComplete = 5U,
  kEmvsimTxFIFOEmpty = 6U,
  kEmvsimTxNackThresholdErr = 7U,
  kEmvsimTxAllStatus = 8U
}
 EMVSIM transmit status flags. More...
 
enum  emvsim_presence_detect_edge_t {
  kEmvsimPDOnFallingEdge = 0U,
  kEmvsimPDOnRisingEdge = 1U
}
 EMVSIM card presence detection edge control. More...
 
enum  emvsim_presence_detect_status_t {
  kEmvsimPDPinIsLow = 0U,
  kEmvsimPDPinIsHigh = 1U
}
 EMVSIM card presence detection status. More...
 
enum  emvsim_card_clock_stop_polarity_t {
  kEmvsimCardClockStopPolarityIsLow = 0U,
  kEmvsimCardClockStopPolarityIsHigh = 1U
}
 EMVSIM card clock polarity control when card clock is disabled. More...
 
enum  emvsim_reset_card_t {
  kEmvsimResetAssert = 0U,
  kEmvsimResetDeassert = 1U
}
 EMVSIM card reset control. More...
 
enum  emvsim_vcc_en_polarity_t {
  kEmvsimVccEnIsHigh = 0U,
  kEmvsimVccEnIsLow = 1U
}
 EMVSIM card voltage enable signal polarity control. More...
 

Functions

EMVSIM Common Configurations
void EMVSIM_HAL_Init (EMVSIM_Type *base)
 Initializes the EMVSIM controller. More...
 
uint32_t EMVSIM_HAL_GetModuleParameter (EMVSIM_Type *base, emvsim_module_param_t param)
 Returns the EMVSIM controller version, transmit and receive FIFO sizes. More...
 
static uint8_t EMVSIM_HAL_GetTxFifoSize (EMVSIM_Type *base)
 Returns the EMVSIM controller transmit FIFO size. More...
 
static uint8_t EMVSIM_HAL_GetRxFifoSize (EMVSIM_Type *base)
 Returns the EMVSIM controller receive FIFO size. More...
 
void EMVSIM_HAL_SetGPCClockSelect (EMVSIM_Type *base, uint8_t gpcNumber, emvsim_gpc_clock_select_t gpcClockSel)
 Selects the EMVSIM general purpose counter clock. More...
 
static void EMVSIM_HAL_SetClockPrescaler (EMVSIM_Type *base, uint8_t prescaler)
 Sets the clock prescaler for the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetBaudrateDivisor (EMVSIM_Type *base, uint16_t divisor)
 Sets the baudrate divisor for the EMVSIM controller. More...
 
void EMVSIM_HAL_SetControl (EMVSIM_Type *base, emvsim_control_t control, bool enable)
 Enables/disables different control functions of the EMVSIM controller. More...
 
bool EMVSIM_HAL_GetControl (EMVSIM_Type *base, emvsim_control_t control)
 Returns the current state of different control functions of the EMVSIM controller. More...
 
void EMVSIM_HAL_SetIntMode (EMVSIM_Type *base, emvsim_interrupt_t interrupt, bool enable)
 Enables/disables the EMVSIM controller interrupt reasons to raise an interrupt. More...
 
bool EMVSIM_HAL_GetIntMode (EMVSIM_Type *base, emvsim_interrupt_t interrupt)
 Returns whether different interrupt reasons are masked or unmasked in the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetReceiverNackThreshold (EMVSIM_Type *base, uint8_t rnackThreshold)
 Sets the receiver NACK threshold value of the EMVSIM controller. More...
 
static uint8_t EMVSIM_HAL_GetReceiverNackThreshold (EMVSIM_Type *base)
 Returns the receiver NACK threshold value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetReceiverDataThreshold (EMVSIM_Type *base, uint8_t rdt)
 Sets the receiver data threshold value of the EMVSIM controller. More...
 
static uint8_t EMVSIM_HAL_GetReceiverDataThreshold (EMVSIM_Type *base)
 Returns the receiver data threshold value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetTransmitterNackThreshold (EMVSIM_Type *base, uint8_t tnackThreshold)
 Sets the transmitter NACK threshold value of the EMVSIM controller. More...
 
static uint8_t EMVSIM_HAL_GetTransmitterNackThreshold (EMVSIM_Type *base)
 Returns the transmitter NACK threshold value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetTransmitterDataThreshold (EMVSIM_Type *base, uint8_t tdt)
 Sets the transmitter data threshold value of the EMVSIM controller. More...
 
static uint8_t EMVSIM_HAL_GetTransmitterDataThreshold (EMVSIM_Type *base)
 Returns the transmitter data threshold value of EMVSIM controller. More...
 
static bool EMVSIM_HAL_IsReceiveFifoEmpty (EMVSIM_Type *base)
 Returns the state of the received FIFO (either empty or has bytes to read from EMVSIM controller). More...
 
static bool EMVSIM_HAL_IsTransmitFifoFull (EMVSIM_Type *base)
 Returns the state of the transmitted FIFO (either full or bytes can be written into the transmit FIFO of the EMVSIM controller). More...
 
bool EMVSIM_HAL_GetReceiveStatus (EMVSIM_Type *base, emvsim_rx_status_t rxStatus)
 Returns the receive status of the EMVSIM controller. More...
 
void EMVSIM_HAL_ClearReceiveStatus (EMVSIM_Type *base, emvsim_rx_status_t rxStatus)
 Clears the receive status of the EMVSIM controller. More...
 
bool EMVSIM_HAL_GetTransmitStatus (EMVSIM_Type *base, emvsim_tx_status_t txStatus)
 Returns the transmit status of the EMVSIM controller. More...
 
void EMVSIM_HAL_ClearTransmitStatus (EMVSIM_Type *base, emvsim_tx_status_t txStatus)
 Clears the transmit status of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetCardPresenceDetectEdge (EMVSIM_Type *base, emvsim_presence_detect_edge_t spdes)
 Sets the card presence detection edge of the EMVSIM controller. More...
 
static
emvsim_presence_detect_edge_t 
EMVSIM_HAL_GetCardPresenceDetectEdge (EMVSIM_Type *base)
 Returns the current setting of the card presence detection edge of the EMVSIM controller. More...
 
static
emvsim_presence_detect_status_t 
EMVSIM_HAL_GetCardPresenceDetectPinStatus (EMVSIM_Type *base)
 Returns the card presence detection pin level of the EMVSIM controller. More...
 
static bool EMVSIM_HAL_GetCardPresenceDetectInterruptStatus (EMVSIM_Type *base)
 Returns the card presence detection interrupt status of the EMVSIM controller. More...
 
static void EMVSIM_HAL_ClearCardPresenceDetectInterruptStatus (EMVSIM_Type *base)
 Clears the card presence detection interrupt status of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetAutoPowerDown (EMVSIM_Type *base, bool spd)
 Enables/disables the auto power down of the EMVSIM controller. More...
 
static bool EMVSIM_HAL_GetAutoPowerDown (EMVSIM_Type *base)
 Returns whether the state of auto power down of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetCardClockStopPolarity (EMVSIM_Type *base, emvsim_card_clock_stop_polarity_t scsp)
 Sets the clock signal polarity during clock stop of EMVSIM controller. More...
 
static
emvsim_card_clock_stop_polarity_t 
EMVSIM_HAL_GetCardClockStopPolarity (EMVSIM_Type *base)
 Returns the current setting of the clock signal polarity during the clock stop of the EMVSIM controller. More...
 
static void EMVSIM_HAL_EnableCardClock (EMVSIM_Type *base)
 Enables the card clock from the EMVSIM controller. More...
 
static void EMVSIM_HAL_DisableCardClock (EMVSIM_Type *base)
 Disables the card clock from the EMVSIM controller. More...
 
static bool EMVSIM_HAL_IsCardClockEnabled (EMVSIM_Type *base)
 Returns the current setting of the card clock from the EMVSIM controller. More...
 
static void EMVSIM_HAL_ResetCard (EMVSIM_Type *base, emvsim_reset_card_t srst)
 Asserts/de-asserts the card reset signal from the EMVSIM controller. More...
 
static emvsim_reset_card_t EMVSIM_HAL_GetCardResetState (EMVSIM_Type *base)
 Returns whether the card reset signal has been asserted from the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetCardVCCEnablePolarity (EMVSIM_Type *base, emvsim_vcc_en_polarity_t vccenp)
 Sets the polarity of the VCC enable signal from the EMVSIM controller. More...
 
static emvsim_vcc_en_polarity_t EMVSIM_HAL_GetCardVCCEnablePolarity (EMVSIM_Type *base)
 Returns the polarity of the VCC enable signal from the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetVCCEnable (EMVSIM_Type *base, bool svccEnable)
 Controls the state of the VCC enable signal from the EMVSIM controller. More...
 
static bool EMVSIM_HAL_GetVCCEnable (EMVSIM_Type *base)
 Returns the state of the VCC enable signal from the EMVSIM controller. More...
 
static void EMVSIM_HAL_EnableAutoPowerDown (EMVSIM_Type *base)
 Enables the auto power down feature of the EMVSIM controller. More...
 
static void EMVSIM_HAL_DisableAutoPowerDown (EMVSIM_Type *base)
 Disables the auto power down feature of the EMVSIM controller. More...
 
static bool EMVSIM_HAL_IsAutoPowerDownEnabled (EMVSIM_Type *base)
 Returns the current state of the auto power down feature of the EMVSIM controller. More...
 
static void EMVSIM_HAL_GetChar (EMVSIM_Type *base, uint8_t *readData)
 Reads the received data byte from the EMVSIM controller. More...
 
static uint32_t EMVSIM_HAL_GetRxDataRegAddr (EMVSIM_Type *base)
 Returns the address of the receive data byte register of the EMVSIM controller. More...
 
static void EMVSIM_HAL_PutChar (EMVSIM_Type *base, uint8_t writeData)
 Writes a byte data to the transmit data byte of the EMVSIM controller. More...
 
static uint32_t EMVSIM_HAL_GetTxDataRegAddr (EMVSIM_Type *base)
 Returns the address of the transmit data byte register of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetAdditionalTransmitterGuardTime (EMVSIM_Type *base, uint8_t getu)
 Sets an additional transmitter guard time value of the EMVSIM controller. More...
 
static uint8_t EMVSIM_HAL_GetAdditionalTransmitterGuardTime (EMVSIM_Type *base)
 Returns the current setting of the additional transmitter guard time value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetCharacterWaitTime (EMVSIM_Type *base, uint16_t cwt)
 Sets the character wait time value of the EMVSIM controller. More...
 
static uint16_t EMVSIM_HAL_GetCharacterWaitTime (EMVSIM_Type *base)
 Returns the character wait time value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetBlockWaitTime (EMVSIM_Type *base, uint32_t bwt)
 Sets the block wait time value of the EMVSIM controller. More...
 
static uint32_t EMVSIM_HAL_GetBlockWaitTime (EMVSIM_Type *base)
 Returns the block wait time value of the EMVSIM controller. More...
 
static void EMVSIM_HAL_SetBlockGuardTime (EMVSIM_Type *base, uint16_t bgt)
 Sets the block guard time value of the EMVSIM controller. More...
 
static uint16_t EMVSIM_HAL_GetBlockGuardTime (EMVSIM_Type *base)
 Returns the block guard time value of the EMVSIM controller. More...
 
void EMVSIM_HAL_SetGPCNTValue (EMVSIM_Type *base, uint8_t gpcntIndex, uint16_t gpcntVal)
 Sets the timeout value of the general purpose counters of the EMVSIM controller. More...
 
uint16_t EMVSIM_HAL_GetGPCNTValue (EMVSIM_Type *base, uint8_t gpcntIndex)
 Returns the timeout value of the general purpose counters of the EMVSIM controller. More...