NXP Reader Library  v17.1.0.2535
Hardware Abstraction Layer

These are the Components which are used to abstract the functionality of the physical reader device to a generic interface. More...

Collaboration diagram for Hardware Abstraction Layer:

Modules

 Examples
 Example code to configure HAL and BAL for various reader(s).
 
 Component : Callback
 Callback Reader HAL.
 
 Component : DUT
 any Reader HAL
 
 Component : LicenseeWrapper
 Licensee Wrapper HAL.
 
 Component : MfcCrypto
 MfcCrypto Reader HAL.
 
 Component : Pcsc
 PCSC HAL component.
 
 Component : Rc523
 RC523 Reader HAL.
 
 Component : Rc632
 RC632 Reader HAL.
 
 Component : Rc663
 RC663 Reader HAL.
 
 Component : Rd70x
 RD70x (Pegoda1) Reader HAL.
 
 Component : Rd710
 RD710 (Pegoda2) Reader HAL.
 
 Component : RdCardSim
 RdCardSim Reader HAL.
 
 Component : SamAV2
 SamAV2 Reader HAL.
 
 Component : SamAV3
 SamAV3 Reader HAL.
 
 CommunicationType
 Sam macros to configure communication type. The macros to be used if configuration identifier is Communication Type for the below mentioned interfaces.
 
 I2C_BitRate
 Sam macros to configure I2C BitRate. The macros to be used if configuration identifier is I2C BitRate for the below mentioned interfaces.
 

Functions

phStatus_t phhalHw_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform Data Exchange with Picc. More...
 
phStatus_t phhalHw_WriteRegister (void *pDataParams, uint8_t bAddress, uint8_t bValue)
 Write value to register address. More...
 
phStatus_t phhalHw_ReadRegister (void *pDataParams, uint8_t bAddress, uint8_t *pValue)
 Read value from register address. More...
 
phStatus_t phhalHw_ExecuteCmd (void *pDataParams, uint8_t bCmd, uint16_t wOption, uint8_t bIrq0WaitFor, uint8_t bIrq1WaitFor, uint8_t *pTxBuffer, uint16_t wTxLength, uint16_t wRxBufferSize, uint8_t *pRxBuffer, uint16_t *pRxLength)
 Execute bCmd command with pTxBuffer parameters. More...
 
phStatus_t phhalHw_ApplyProtocolSettings (void *pDataParams, uint8_t bCardType)
 Apply protocol settings. More...
 
phStatus_t phhalHw_MfcAuthenticateKeyNo (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint16_t wKeyNo, uint16_t wKeyVersion, uint8_t *pUid)
 Perform MIFARE(R) Classic Authentication using a key number. More...
 
phStatus_t phhalHw_MfcAuthenticate (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint8_t *pKey, uint8_t *pUid)
 Perform MIFARE(R) Classic Authentication using a key. More...
 
phStatus_t phhalHw_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phhalHw_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 
phStatus_t phhalHw_FieldOn (void *pDataParams)
 Switch on the RF-field. More...
 
phStatus_t phhalHw_FieldOff (void *pDataParams)
 Switch off the RF-field. More...
 
phStatus_t phhalHw_FieldReset (void *pDataParams)
 Perform RF-Reset. More...
 
phStatus_t phhalHw_Wait (void *pDataParams, uint8_t bUnit, uint16_t wTimeout)
 Blocks until the time given by wTimeout elapsed. More...
 
phStatus_t phhalHw_I18000p3m3Inventory (void *pDataParams, uint8_t *pSelCmd, uint8_t bSelCmdLen, uint8_t bNumValidBitsinLastByte, uint8_t *pBeginRndCmd, uint8_t bTSprocessing, uint8_t **ppRxBuffer, uint16_t *wRxBufferLen)
 ISO 18000p3m3 Inventory command. More...
 
phStatus_t phhalHw_I18000p3m3ResumeInventory (void *pDataParams, uint8_t **ppRxBuffer, uint16_t *wRxBufferLen)
 ISO 18000p3m3 resume inventory command. More...
 
phStatus_t phhalHw_ReadEEPROM (void *pDataParams, uint16_t wOption, uint32_t dwAddr_ProtIndex, uint32_t dwNoOfBytesToRead, uint8_t **ppResponse, uint16_t *pRespLen)
 Reads the EEPROM information. More...
 
phStatus_t phhalHw_WriteEEPROM (void *pDataParams, uint16_t wOption, uint32_t dwStartAddr, uint8_t *pData, uint16_t wDataLen)
 Writes the EEPROM information. More...
 

Communication Configs

#define PHHAL_HW_CONFIG_PARITY   0x0000U
 Enable or Disable Parity.
 
#define PHHAL_HW_CONFIG_TXCRC   0x0001U
 Enable or Disable TxCrc.
 
#define PHHAL_HW_CONFIG_RXCRC   0x0002U
 Enable or Disable RxCrc.
 
#define PHHAL_HW_CONFIG_TXLASTBITS   0x0003U
 Set number of valid bits of last Tx-Byte.
 
#define PHHAL_HW_CONFIG_RXLASTBITS   0x0004U
 Get number of valid bits of last Rx-Byte.
 
#define PHHAL_HW_CONFIG_RXALIGN   0x0005U
 Set Rx-Aligned Bits.
 
#define PHHAL_HW_CONFIG_RXDEAFBITS   0x0006U
 Configure Receiver Deaf-Time in ETUs.
 
#define PHHAL_HW_CONFIG_TXWAIT_US   0x0007U
 Set TxWait (= time between last RxIrq and Tx of succeeding frame) in microseconds.
 
#define PHHAL_HW_CONFIG_CLEARBITSAFTERCOLL   0x0008U
 Enable or Disable clearing of bits after coll.
 
#define PHHAL_HW_CONFIG_TXDATARATE   0x0009U
 Configure Data-Rate for Transmission.
 
#define PHHAL_HW_CONFIG_RXDATARATE   0x000AU
 Configure Data-Rate for Reception.
 
#define PHHAL_HW_CONFIG_MODINDEX   0x000BU
 Set modulation index (unit and value are hardware-dependent).
 
#define PHHAL_HW_CONFIG_ASK100   0x000CU
 Enable (PH_ON) or disable (PH_OFF) 100% modulation.
 
#define PHHAL_HW_CONFIG_TIMEOUT_VALUE_US   0x000DU
 Set RC Timeout (in [us]).
 
#define PHHAL_HW_CONFIG_TIMEOUT_VALUE_MS   0x000EU
 Set RC Timeout (in [ms]).
 
#define PHHAL_HW_CONFIG_SUBCARRIER   0x000FU
 Subcarrier setting for ISO 15693.
 
#define PHHAL_HW_CONFIG_TIMING_MODE   0x0010U
 Set the timing mode.
 
#define PHHAL_HW_CONFIG_TIMING_US   0x0011U
 Retrieve elapsed time of RC timer ([us]).
 
#define PHHAL_HW_CONFIG_TIMING_MS   0x0012U
 Retrieve elapsed time of RC timer ([ms]).
 
#define PHHAL_HW_CONFIG_FIELD_OFF_TIME   0x0013U
 Set the field off time for field-reset ([ms]); Note: A value of 0 is not allowed.
 
#define PHHAL_HW_CONFIG_FIELD_RECOVERY_TIME   0x0014U
 Set the field recovery time for field-reset ([ms]); Note: For ISO15693 operation, this should be at least set to 1ms.
 
#define PHHAL_HW_CONFIG_SYMBOL_START   0x0015U
 Disable / Set the SOF symbol of a frame.
 
#define PHHAL_HW_CONFIG_SYMBOL_END   0x0016U
 Disable / Set the EOF symbol of a frame.
 
#define PHHAL_HW_CONFIG_TIMER_DEVIATION_PROXIMITY_CHECK   0x8013U
 Configure the Timer deviation percentage. More...
 
#define PHHAL_HW_CONFIG_ASYNCHRONOUS_IN_REPLY_PROCESS   0x8014U
 Enable/Disable Handling of ISO-15693 ASynchronous In-Reply process command.
 

Sets the CRC type for Tx(PHHAL_HW_CONFIG_TXCRC) and Rx(PHHAL_HW_CONFIG_RXCRC).

Values can be one of
PHHAL_HW_CRCTYPE_CRC5,
PHHAL_HW_CRCTYPE_CRC16
optionally combined with the following inversion option.
PHHAL_HW_CRCOPTION_INVERTED.

#define PHHAL_HW_CONFIG_CRCTYPE   0x0017U
 
#define PHHAL_HW_CONFIG_FRAME_SYNC   0x0017U
 Set Frame Sync for Rc663.
 
#define PHHAL_HW_CONFIG_TXDATANUM   0x0018U
 Tranmitter Data number register.
 
#define PHHAL_HW_CONFIG_CARD_TYPE   0x0019U
 Getter for the current card type.
 
#define PHHAL_HW_CONFIG_SET_READER_IC   0x0020U
 Gets or Set the Reader IC information. More...
 
#define PHHAL_HW_CONFIG_DISABLE_MF_CRYPTO1   0x002EU
 Disable MIFARE(R) Classic Crypto1.
 
#define PHHAL_HW_CONFIG_ADDITIONAL_INFO   0x002FU
 Set / Get additional information.
 
#define PHHAL_HW_CONFIG_RXBUFFER_STARTPOS   0x0030U
 Start position of RX buffer to be used (never changed by HAL).
 
#define PHHAL_HW_CONFIG_RXBUFFER_BUFSIZE   0x0031U
 Buffer size of RX buffer set at Init.
 
#define PHHAL_HW_CONFIG_TXBUFFER_BUFSIZE   0x0032U
 Buffer size of TX buffer set at Init.
 
#define PHHAL_HW_CONFIG_TXBUFFER_LENGTH   0x0033U
 Amount of valid bytes in TX buffer.
 
#define PHHAL_HW_CONFIG_TXBUFFER   0x0034U
 Access the TxBuffer at the address defined by PHHAL_HW_CONFIG_ADDITIONAL_INFO.
 
#define PHHAL_HW_CONFIG_MAX_PRECACHED_BYTES   0x0035U
 Configures the max. More...
 
#define PHHAL_HW_CONFIG_BAL_CONNECTION   0x0040U
 Set the BAL connection type. More...
 
#define PHHAL_HW_CONFIG_SERIAL_BITRATE   0x0041U
 Bitrate for serial communication.
 
#define PHHAL_HW_CONFIG_RFRESET_ON_TIMEOUT   0x0050U
 Perform an Rf-Reset in case of a timeout (only for phhalHw_Exchange).
 
#define PHHAL_HW_CONFIG_SETMINFDT   0x0051U
 Set/Reset minimum FDT (only for PC)
 

Enable symbol send (PH_ON).


ISO/IEC 18000p3m3 protocol will use data send (PH_OFF).

#define PHHAL_HW_CONFIG_SET_SYMBOL_SEND   0x005DU
 
#define PHHAL_HW_CONFIG_COMMUNICATION_CONFIG   0x0089U
 Change the setting for the Socket communication (only for phhalHw_Exchange in combination with RdCardSim).
 

Configuration for I2C communication

#define PHHAL_HW_CONFIG_SAM_COMMUNICATION_TYPE   0x0060U
 Configure communication type. More...
 
#define PHHAL_HW_CONFIG_I2C_SLAVE_ADDRESS   0x0061U
 Config the I2C Slave address to be used.
 
#define PHHAL_HW_CONFIG_I2C_BITRATE   0x0062U
 Config the Data-Rate for I2C communication. More...
 
#define PHHAL_HW_CONFIG_I2C_TIMEOUT_MS   0x0063U
 Configure I2C polling Timeout in terms of millisecond.
 

Custom Error Codes (start with offset higher than max value of PHHAL_HW_SAMAV2_ERR/PHHAL_HW_SAMAV3_ERR error codes

#define PHHAL_HW_ISO3_ERR_ISO3   (PH_ERR_CUSTOM_BEGIN + 48)
 Non standard error. More...
 
#define PHHAL_HW_ISO3_ERR_IIR_FILTER_OVERFLOW   (PH_ERR_CUSTOM_BEGIN + 49)
 IIR filter overflow error.
 
#define PHHAL_HW_ISO3_ERR_INCOMPATIBLE_SERVER_VERSION   (PH_ERR_CUSTOM_BEGIN + 50)
 Incompatible server version for current ISO3 driver implementation.
 
#define PHHAL_HW_ISO3_ERR_INCOMPATIBLE_FPGA_VERSION   (PH_ERR_CUSTOM_BEGIN + 51)
 Incompatible FPGA version for current ISO3 driver implementation.
 
#define PHHAL_HW_RDFPGAV6_ERR_DLL   (PH_ERR_CUSTOM_BEGIN + 52)
 phCDllReader.dll threw an non standard error read wAddionalInfo to get error code.
 
#define PHHAL_HW_MP300_ERR_MP300   (PH_ERR_CUSTOM_BEGIN + 53)
 Non standard error. More...
 
#define PHHAL_HW_MP300_ERR_ADJUST_RX_CHANNEL_2   (PH_ERR_CUSTOM_BEGIN + 54)
 Adjust rx Channel failed.
 
#define PHHAL_HW_MP300_ERR_FDT_METHODE2_NOT_SUPPORTED   (PH_ERR_CUSTOM_BEGIN + 55)
 FDT Measurement methode 2 is not supported with the current response.
 

Card Configs

#define PHHAL_HW_CARDTYPE_CURRENT   0x0000U
 Re-Apply settings for current Communication Mode.
 
#define PHHAL_HW_CARDTYPE_ISO14443A   0x0001U
 ISO/IEC 14443A Mode.
 
#define PHHAL_HW_CARDTYPE_ISO14443B   0x0002U
 ISO/IEC 14443B Mode.
 
#define PHHAL_HW_CARDTYPE_FELICA   0x0003U
 Felica (JIS X 6319) Mode.
 
#define PHHAL_HW_CARDTYPE_ISO15693   0x0004U
 ISO/IEC 15693 Mode.
 
#define PHHAL_HW_CARDTYPE_ICODEEPCUID   0x0005U
 NXP I-Code EPC/UID Mode.
 
#define PHHAL_HW_CARDTYPE_I18000P3M3   0x0006U
 ISO/IEC 18000-3 Mode3.
 
#define PHHAL_HW_CARDTYPE_I18092MPI   0x0007U
 ISO/IEC ISO18092 (NFC) Passive Initiator Mode.
 
#define PHHAL_HW_CARDTYPE_I18092MPT   0x0008U
 ISO/IEC ISO18092 (NFC) Passive Target Mode.
 

CRC Values

#define PHHAL_HW_CRCTYPE_CRC5   0x0001U
 5 bit length, polynomial x^5+x^3+1U, preset value 01001b, residue 00000b.
 
#define PHHAL_HW_CRCTYPE_CRC16   0x0002U
 ISO/IEC 13239, 16 bit length, polynomial x^16+x^12+x^5+1U, preset value 0xFFFF, residue 0x1D0F.
 
#define PHHAL_HW_CRCOPTION_INVERTED   0x0100U
 To indicate that the CRC generated should be inverted. More...
 

Rf Datarate Values

#define PHHAL_HW_RF_DATARATE_106   0x0000U
 Data rate setting for 106 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_212   0x0001U
 Data rate setting for 212 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_424   0x0002U
 Data rate setting for 424 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_848   0x0003U
 Data rate setting for 848 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_1695   0x0004U
 Data rate setting for 1695 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_3390   0x0005U
 Data rate setting for 3390 kBit/s.
 
#define PHHAL_HW_RF_DATARATE_6780   0x0006U
 Data rate setting for 6780 kBit/s.
 
#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_256   0x000AU
 Data rate setting for ISO15693 '1 out of 256' mode. More...
 
#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4   0x000BU
 Data rate setting for ISO15693 '1 out of 4' mode. More...
 
#define PHHAL_HW_RF_RX_DATARATE_LOW   0x000CU
 Data rate setting for ISO15693 low datarate.
 
#define PHHAL_HW_RF_RX_DATARATE_HIGH   0x000DU
 Data rate setting for ISO15693 high datarate.
 
#define PHHAL_HW_RF_RX_DATARATE_FAST_LOW   0x000EU
 Data rate setting for ISO15693 fast (low*2) datarate (FAST INVENTORY (PAGE) READ).
 
#define PHHAL_HW_RF_RX_DATARATE_FAST_HIGH   0x000FU
 Data rate setting for ISO15693 fast (high*2) datarate (FAST INVENTORY (PAGE) READ).
 
#define PHHAL_HW_RF_DATARATE_EPCUID   0x0010U
 Data rate setting for EPC/UID.
 
#define PHHAL_HW_RF_TX_DATARATE_I18000P3M3   0x0011U
 Tx Data rate setting for ISO18000-3 Mode3.
 
#define PHHAL_HW_RF_RX_DATARATE_I18000P3M3_MAN2   0x0012U
 Rx Data rate setting for ISO18000-3 Mode3 Manchester 2SCP.
 
#define PHHAL_HW_RF_RX_DATARATE_I18000P3M3_MAN4   0x0013U
 Rx Data rate setting for ISO18000-3 Mode3 Manchester 4SCP.
 
#define PHHAL_HW_RX_I18000P3M3_FL_423_MAN2   0x0013U
 ICode ISO18000-3 Mode3 424 kBit/s (M=2).
 
#define PHHAL_HW_RX_I18000P3M3_FL_847_MAN2   0x0014U
 ICode ISO18000-3 Mode3 847 kBit/s (M=2).
 
#define PHHAL_HW_RX_I18000P3M3_FL_423_MAN4   0x0015U
 ICode ISO18000-3 Mode3 424 kBit/s (M=4).
 
#define PHHAL_HW_RX_I18000P3M3_FL_847_MAN4   0x0016U
 ICode ISO18000-3 Mode3 847 kBit/s (M=4).
 
#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_53   0x0017U
 Data rate setting for ISO15693 '1 out of 4' mode. More...
 
#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_106   0x0018U
 Data rate setting for ISO15693 '1 out of 4' mode. More...
 
#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_212   0x0019U
 Data rate setting for ISO15693 '1 out of 4' mode. More...
 
#define PHHAL_HW_RF_I15693_53KBPS_DATARATE   0x001BU
 Data rate setting for 53 kbps. More...
 

Rf Subcarrier Values

#define PHHAL_HW_SUBCARRIER_SINGLE   0x0000U
 Sub carrier setting for ISO15693 single subcarrier.
 
#define PHHAL_HW_SUBCARRIER_DUAL   0x0001U
 Sub carrier setting for ISO15693 / EPC V2 dual subcarrier.
 
#define PHHAL_HW_SUBCARRIER_QUAD   0x0002U
 Sub carrier setting for EPC V2 quad subcarrier.
 

Time Units

#define PHHAL_HW_TIME_MICROSECONDS   0x0000U
 Time in microseconds (us).
 
#define PHHAL_HW_TIME_MILLISECONDS   0x0001U
 Time in milliseconds (ms).
 

Timing Mode settings

#define PHHAL_HW_TIMING_MODE_OFF   0x0000U
 Time Measurement disabled.
 
#define PHHAL_HW_TIMING_MODE_FDT   0x0001U
 Measures time from Tx-End until Rx-Begin.
 
#define PHHAL_HW_TIMING_MODE_COMM   0x0002U
 Measures the duration of the complete communication.
 
#define PHHAL_HW_TIMING_MODE_OPTION_MASK   0xFF00U
 Additional option-mask for time measurement.
 
#define PHHAL_HW_TIMING_MODE_OPTION_DEFAULT   0x0000U
 The timing value is cummulated on each Exchange until it gets retrieved by phhalHw_GetConfig.
 
#define PHHAL_HW_TIMING_MODE_OPTION_AUTOCLEAR   0x0100U
 Automatically resets the current timing value prior to any communication.
 

Field Reset default times

#define PHHAL_HW_FIELD_OFF_DEFAULT   0x0005U
 Default Field-Off time.
 
#define PHHAL_HW_FIELD_RECOVERY_DEFAULT   0x0005U
 Default Field-Recovery time.
 

Frame Symbols (use #PH_OFF to disable)

#define PHHAL_HW_SYMBOL_ICODEEPCUID_SSOF   0x0001U
 ICode EPC/UID Short Start Of Frame.
 
#define PHHAL_HW_SYMBOL_ICODEEPCUID_LSOF   0x0002U
 ICode EPC/UID Long Start Of Frame.
 
#define PHHAL_HW_SYMBOL_ICODEEPCUID_CEOF   0x0003U
 ICode EPC/UID Common End Of Frame.
 
#define PHHAL_HW_SYMBOL_ICODEEPCUID_CS   0x0004U
 ICode EPC/UID Close Slot.
 
#define PHHAL_HW_SYMBOL_I15693_SOF   0x0005U
 ISO15693 SOF (aumatically choosen between 1/256 and 1/4).
 
#define PHHAL_HW_SYMBOL_I18000P3M3_PREAMBLE   0x0006U
 ISO18000-3 Mode3 Preamble.
 
#define PHHAL_HW_SYMBOL_I18000P3M3_FSYNC   0x0007U
 ISO18000-3 Mode3 Frame-Sync.
 

MIFARE Classic Authenticate Options

#define PHHAL_HW_MFC_KEYA   0x0AU
 MIFARE Classic Key Type A.
 
#define PHHAL_HW_MFC_KEYB   0x0BU
 MIFARE Classic Key Type B.
 
#define PHHAL_HW_MFC_KEY_LENGTH   0x06U
 Length of a MIFARE Classic key (for completeness).
 

BAL Connection types

#define PHHAL_HW_BAL_CONNECTION_RS232   0x0000U
 ReaderIC is connected via RS232.
 
#define PHHAL_HW_BAL_CONNECTION_SPI   0x0001U
 ReaderIC is connected via SPI.
 
#define PHHAL_HW_BAL_CONNECTION_I2C   0x0002U
 ReaderIC or SAM is connected via I2C.
 

RS232 Bitrate Values

#define PHHAL_HW_RS232_BITRATE_7200   0x0000U
 7.200 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_9600   0x0001U
 9.600 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_14400   0x0002U
 14.400 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_19200   0x0003U
 19.200 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_38400   0x0004U
 38.400 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_57600   0x0005U
 57.500 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_115200   0x0006U
 115.200 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_128000   0x0007U
 128.000 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_230400   0x0008U
 230.400 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_460800   0x0009U
 460.800 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_921600   0x000AU
 921.600 kBit/s.
 
#define PHHAL_HW_RS232_BITRATE_1228800   0x000BU
 1.228.800 kBit/s.
 

Min FDT values

#define PHHAL_HW_MINFDT_106_US   (91 + 10)
 (n * 128 + 84) / 13.56; n = 9.
 
#define PHHAL_HW_MINFDT_212_US   (87 + 40)
 (n * 128 + 148) / 13.56; n = 8.
 
#define PHHAL_HW_MINFDT_424_US   (84 + 35)
 (n * 128 + 116) / 13.56; n = 8.
 
#define PHHAL_HW_MINFDT_848_US   (83 + 45)
 (n * 128 + 100) / 13.56; n = 8.
 

Parameter values for ISO/IEC 18000p3m3 HAL APIs \n

#define PHHAL_HW_I18000P3M3_GET_MAX_RESPS   0U
 Gets responses from more than one slots limited by the RX buffer size and number of slots.
 
#define PHHAL_HW_I18000P3M3_ONE_TS_ONLY   1U
 Gets response for only one time slot.
 
#define PHHAL_HW_I18000P3M3_GET_TAG_HANDLE   2U
 Gets response for only one time slot. More...
 
#define PHHAL_HW_I18000P3M3_PERFORM_RESIZE   3U
 Perform Resize Round.
 
#define PHHAL_HW_I18000P3M3_SESSION_S0   0x00U
 Session S0.
 
#define PHHAL_HW_I18000P3M3_SESSION_S2   0x02U
 Session S2.
 
#define PHHAL_HW_I18000P3M3_TARGET_INVENTORIED_S0   0x00U
 INVENTORIED_S0 target.
 
#define PHHAL_HW_I18000P3M3_TARGET_INVENTORIED_S2   0x02U
 INVENTORIED_S2 target.
 
#define PHHAL_HW_I18000P3M3_TARGET_SL   0x04U
 SL target.
 
#define PHHAL_HW_I18000P3M3_UPDN_INCREMENT   0x06U
 Increment Q.
 
#define PHHAL_HW_I18000P3M3_UPDN_NOCHANGE   0x00U
 Do not change Q.
 
#define PHHAL_HW_I18000P3M3_UPDN_DECREMENT   0x03U
 Decrement Q.
 
#define PHHAL_HW_I18000P3M3_CMD_RESIZE_ROUND   0x09U
 ResizeRound command code.
 

Detailed Description

These are the Components which are used to abstract the functionality of the physical reader device to a generic interface.

Macro Definition Documentation

◆ PHHAL_HW_CONFIG_TIMER_DEVIATION_PROXIMITY_CHECK

#define PHHAL_HW_CONFIG_TIMER_DEVIATION_PROXIMITY_CHECK   0x8013U

Configure the Timer deviation percentage.

This configuration should be used while performing ProximityCheck command.

◆ PHHAL_HW_CONFIG_SET_READER_IC

#define PHHAL_HW_CONFIG_SET_READER_IC   0x0020U

Gets or Set the Reader IC information.

This will be helpful in Sam is connected in X mode.

◆ PHHAL_HW_CONFIG_MAX_PRECACHED_BYTES

#define PHHAL_HW_CONFIG_MAX_PRECACHED_BYTES   0x0035U

Configures the max.

number of bytes which are precached prior to command execution.

◆ PHHAL_HW_CONFIG_BAL_CONNECTION

#define PHHAL_HW_CONFIG_BAL_CONNECTION   0x0040U

Set the BAL connection type.

The default value is always PHHAL_HW_BAL_CONNECTION_RS232.

◆ PHHAL_HW_CONFIG_SAM_COMMUNICATION_TYPE

#define PHHAL_HW_CONFIG_SAM_COMMUNICATION_TYPE   0x0060U

Configure communication type.

◆ PHHAL_HW_CONFIG_I2C_BITRATE

#define PHHAL_HW_CONFIG_I2C_BITRATE   0x0062U

Config the Data-Rate for I2C communication.

Supported values are

  • 0x00: 100 Kbits/s (Standard Mode)
  • 0x01: 400 Kbits/s (Fast Mode)
  • 0x02: 1 Mbits/s (Fast Mode Plus)
  • 0x03: 3.4 Mbits/s (High Speed Mode)

◆ PHHAL_HW_ISO3_ERR_ISO3

#define PHHAL_HW_ISO3_ERR_ISO3   (PH_ERR_CUSTOM_BEGIN + 48)

Non standard error.

Read wAddionalInfo to get error code.

◆ PHHAL_HW_MP300_ERR_MP300

#define PHHAL_HW_MP300_ERR_MP300   (PH_ERR_CUSTOM_BEGIN + 53)

Non standard error.

Read wAddionalInfo to get error code.

◆ PHHAL_HW_CRCOPTION_INVERTED

#define PHHAL_HW_CRCOPTION_INVERTED   0x0100U

To indicate that the CRC generated should be inverted.

This should be ORed with the CRCTYPEs above.

◆ PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_256

#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_256   0x000AU

Data rate setting for ISO15693 '1 out of 256' mode.

1.66kb/s

◆ PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4

#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4   0x000BU

Data rate setting for ISO15693 '1 out of 4' mode.

26 kb/s

◆ PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_53

#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_53   0x0017U

Data rate setting for ISO15693 '1 out of 4' mode.

53 kb/s

◆ PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_106

#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_106   0x0018U

Data rate setting for ISO15693 '1 out of 4' mode.

106 kb/s

◆ PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_212

#define PHHAL_HW_RF_TX_DATARATE_1_OUT_OF_4_212   0x0019U

Data rate setting for ISO15693 '1 out of 4' mode.

212 kb/s

◆ PHHAL_HW_RF_I15693_53KBPS_DATARATE

#define PHHAL_HW_RF_I15693_53KBPS_DATARATE   0x001BU

Data rate setting for 53 kbps.

Used for Testing

◆ PHHAL_HW_I18000P3M3_GET_TAG_HANDLE

#define PHHAL_HW_I18000P3M3_GET_TAG_HANDLE   2U

Gets response for only one time slot.

Also sends a ReqRN to get the tag handle for this slot.

Function Documentation

◆ phhalHw_Exchange()

phStatus_t phhalHw_Exchange ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform Data Exchange with Picc.

wOption can be one of:

wOption can be combined with:

Component : Rc523 Special Behaviour:
If PHHAL_HW_CARDTYPE_I18092MPT is chosen, Exchange performs the reception BEFORE the transmission.
For details refer to Component : Rc523.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwOption is invalid.
PH_ERR_SUCCESS_INCOMPLETE_BYTEOperation successful, incomplete byte received; Retrieve number of valid bits of last byte with PHHAL_HW_CONFIG_RXLASTBITS.
PH_ERR_IO_TIMEOUTNo response detected within the configured time frame.
PH_ERR_INTEGRITY_ERRORResponse received but CRC or Parity is invalid.
PH_ERR_COLLISION_ERRORResponse received but a collision occured; Retrieve number of valid bits of last byte with PHHAL_HW_CONFIG_RXLASTBITS.
PH_ERR_BUFFER_OVERFLOWInternal receive buffer is too small for transmission or smaller than the response.
PH_ERR_FRAMING_ERRORFrame format is either invalid for configured protocol or corrupted.
PH_ERR_PROTOCOL_ERRORFrame format is definitely invalid for configured protocol.
PH_ERR_READ_WRITE_ERRORHardware problem.
PH_ERR_TEMPERATURE_ERRORHardware problem.
PH_ERR_RF_ERRORHardware problem.
PH_ERR_INTERFACE_ERRORHardware problem.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Number of bytes to transmit.
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] Number of received data bytes.

◆ phhalHw_WriteRegister()

phStatus_t phhalHw_WriteRegister ( void *  pDataParams,
uint8_t  bAddress,
uint8_t  bValue 
)

Write value to register address.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORHardware problem.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bAddress[In] Register Address.
[in]bValue[In] Register Value.

◆ phhalHw_ReadRegister()

phStatus_t phhalHw_ReadRegister ( void *  pDataParams,
uint8_t  bAddress,
uint8_t pValue 
)

Read value from register address.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORHardware problem.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bAddress[In] Register Address.
[out]pValue[Out] Register Value.

◆ phhalHw_ExecuteCmd()

phStatus_t phhalHw_ExecuteCmd ( void *  pDataParams,
uint8_t  bCmd,
uint16_t  wOption,
uint8_t  bIrq0WaitFor,
uint8_t  bIrq1WaitFor,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint16_t  wRxBufferSize,
uint8_t pRxBuffer,
uint16_t pRxLength 
)

Execute bCmd command with pTxBuffer parameters.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORHardware problem.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bCmd[In] Command to be executed on the Reader IC.
[in]wOption[In] Option field for exchange.
[in]bIrq0WaitFor[In] IRQs on IRQ0 reg to be enabled.
[in]bIrq1WaitFor[In] IRQs on IRQ1 reg to be enabled.
[in]pTxBuffer[In] Buffer to be put into the FIFO before executing the command.
[in]wTxLength[In] Length of the Tx buffer.
[in]wRxBufferSize[In] Length of Rx buffer.
[out]pRxBuffer[out] Receive Buffer.
[out]pRxLength[out] Length of received data(valid).

◆ phhalHw_ApplyProtocolSettings()

phStatus_t phhalHw_ApplyProtocolSettings ( void *  pDataParams,
uint8_t  bCardType 
)

Apply protocol settings.

To keep the current card type, use PHHAL_HW_CARDTYPE_CURRENT for bCardType.
Component : Rc523 Special Behaviour:
If PHHAL_HW_CARDTYPE_I18092MPT is chosen, Rx- and TxBuffers have to be different.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERbCardType is invalid or not supported.
PH_ERR_INTERFACE_ERRORHardware problem.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bCardType[In] Type of card for which the HAL should be configured for.

◆ phhalHw_MfcAuthenticateKeyNo()

phStatus_t phhalHw_MfcAuthenticateKeyNo ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint16_t  wKeyNo,
uint16_t  wKeyVersion,
uint8_t pUid 
)

Perform MIFARE(R) Classic Authentication using a key number.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERbKeyType, wKeyNo or wKeyVersion is invalid.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bBlockNo[In] Blocknumber on card to authenticate to.
[in]bKeyType[In] Either PHHAL_HW_MFC_KEYA or PHHAL_HW_MFC_KEYB.
[in]wKeyNo[In] Key number to be used in authentication.
[in]wKeyVersion[In] Key version to be used in authentication.
[in]pUid[In] Serial number of current cascade level; uint8_t[4].

◆ phhalHw_MfcAuthenticate()

phStatus_t phhalHw_MfcAuthenticate ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint8_t pKey,
uint8_t pUid 
)

Perform MIFARE(R) Classic Authentication using a key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERbKeyType is invalid.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bBlockNo[In] Blocknumber on card to authenticate to.
[in]bKeyType[In] Either PHHAL_HW_MFC_KEYA or PHHAL_HW_MFC_KEYB
[in]pKey[In] Key to be used in authentication.
[in]pUid[In] Serial number of current cascade level; uint8_t[4].

◆ phhalHw_SetConfig()

phStatus_t phhalHw_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

phhalHw_SamAV2 Special Behaviour:
In NonX-Mode every setting (except PHHAL_HW_CONFIG_DISABLE_MF_CRYPTO1 and PHHAL_HW_SAMAV2_CONFIG_HOSTMODE)
is passed on to the linked Reader-HAL.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_PARAMETER_OVERFLOWSetting the parameter value would lead to an overflow.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[in]wValue[In] Configuration Value.

◆ phhalHw_GetConfig()

phStatus_t phhalHw_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

phhalHw_SamAV2 Special Behaviour:
In NonX-Mode every query (except PHHAL_HW_CONFIG_RXLASTBITS, PHHAL_HW_CONFIG_DISABLE_MF_CRYPTO1 and PHHAL_HW_SAMAV2_CONFIG_HOSTMODE)
is passed on to the linked Reader-HAL.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_PARAMETER_OVERFLOWThe parameter value is larger than the range of pValue.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[out]pValue[Out] Configuration Value.

◆ phhalHw_FieldOn()

phStatus_t phhalHw_FieldOn ( void *  pDataParams)

Switch on the RF-field.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phhalHw_FieldOff()

phStatus_t phhalHw_FieldOff ( void *  pDataParams)

Switch off the RF-field.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phhalHw_FieldReset()

phStatus_t phhalHw_FieldReset ( void *  pDataParams)

Perform RF-Reset.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phhalHw_Wait()

phStatus_t phhalHw_Wait ( void *  pDataParams,
uint8_t  bUnit,
uint16_t  wTimeout 
)

Blocks until the time given by wTimeout elapsed.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERbUnit is invalid.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bUnit[In] Unit of given timeout value (either PHHAL_HW_TIME_MICROSECONDS or PHHAL_HW_TIME_MILLISECONDS).
[in]wTimeout[In] Timeout value.

◆ phhalHw_I18000p3m3Inventory()

phStatus_t phhalHw_I18000p3m3Inventory ( void *  pDataParams,
uint8_t pSelCmd,
uint8_t  bSelCmdLen,
uint8_t  bNumValidBitsinLastByte,
uint8_t pBeginRndCmd,
uint8_t  bTSprocessing,
uint8_t **  ppRxBuffer,
uint16_t wRxBufferLen 
)

ISO 18000p3m3 Inventory command.

Note: This function does ISO18000p3m3 BeginRound Sends an Ack Optionally sends a ReqRN Stores the information related to tag reply in the HAL RX Buffer Continues with NextSlot or else pauses and returns based on the option specified Can return multi card information based on the configuration option and the size of HAL RX Buffer. The bTSprocessing (Time slot processing behavior) can take the following values

  • PHHAL_HW_I18000P3M3_GET_MAX_RESPS - Gets responses from more than one slot limited by the Rx Buffer size and number of slots specified in begin round.
  • PHHAL_HW_I18000P3M3_ONE_TS_ONLY - Gets response for only one time slot. Here the number of time slots should be zero in the begin round command.
  • PHHAL_HW_I18000P3M3_GET_TAG_HANDLE - Gets response for only one time slot. Also send a ReqRN to get the tag handle for this slot. Here the number of time slots should be zero in the begin round command.

The response is a Pointer to a buffer containing the result of the inventory. The buffer may contain the result of one or more timeslots. Each timeslot result has the following structure: 1 Byte time slot status ( 0 ... Tag response available. 'Tag reply length field', 'Valid bits in last byte field' and 'Tag reply field' are present. 1 ... Tag response available. In addition to three field above, 'Tag handle field' also present. 2 ... No tag replied in timeslot. 'Tag reply length field', 'Valid bits in last byte field' and 'Tag reply field', 'Tag Handle' are not present. 3 ... Two or more tags responded in the timeslot. (Collision). Tag Reply Length, valid bits in last byte and tag reply field not present. ) 1 Byte 'Tag reply' Length (1-66) 1 Byte Valid bits in last Byte (0-7, 0 means all bits are valid) 0-66 Bytes Tag reply 0 or 2 Bytes Handle of the tag, in case the field

A typical sequence in which this API is called is given below

  • BAL initialization (where applicable) - Example - phbalReg_Serial_Init()
  • HAL initialization - Example phhalHw_Rc663_Init();
  • Load ISO 1800p3m3 protocol - phhalHw_ApplyProtocolSettings(pHal, PHHAL_HW_CARDTYPE_I18000P3M3);
  • Turn ON the field - phhalHw_FieldOn();
  • Wait for initial guard time - phalHw_Wait(pHal, 5100, PHHAL_HW_TIME_MICROSECONDS);
  • Start inventory - phhalHw_I18000p3m3Inventory(pHal,pSelectFrame, bSelectFrameLen, bNumValidBits, pBeginRndFrame, bTSProcessing, &pResponse, &wRxLen);
  • Use phpalI18000p3m3 and phalI18000p3m3 APIs to further communicate with the tag.
  • Turn OFF the field - phhalHw_FieldOff();
  • Termination of the application flow.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTWhen there is no tag in the field.
PH_ERR_INVALID_PARAMETERIf wrong value specified for bNumValidBits or pBeginRound.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pSelCmd[In] ISO 18000p3m3 Select command frame.
[in]bSelCmdLen[In] Select command length in bytes- 1 to 39 bytes.
[in]bNumValidBitsinLastByte[In] Number of valid bits in last byte of pSelCmd.
[in]pBeginRndCmd[In] ISO 18000p3m3 BeginRound command frame. This is 17bits i.e., 3 bytes are expected. CRC5 should not be provided.
[in]bTSprocessing[In] TimeSlot processing behavior.
[out]ppRxBuffer[Out] Pointer to HAL RX Buffer containing response from single/multiple tags.
[out]wRxBufferLen[Out] Length of response in HAL RX Buffer.

◆ phhalHw_I18000p3m3ResumeInventory()

phStatus_t phhalHw_I18000p3m3ResumeInventory ( void *  pDataParams,
uint8_t **  ppRxBuffer,
uint16_t wRxBufferLen 
)

ISO 18000p3m3 resume inventory command.

Note: This function is to be called after phhalHw_I18000p3m3Inventory. This internally calls the ISO 18000p3m3 NextSlot command once or multiple times to get responses from remaining slots.

Resume inventory also returns the response similar to phhalHw_I18000p3m3Inventory.

A typical sequence in which this API is called is given below

  • BAL initialization (where applicable) - Example - phbalReg_Serial_Init()
  • HAL initialization - Example phhalHw_Rc663_Init();
  • Load ISO 1800p3m3 protocol - phhalHw_ApplyProtocolSettings(pHal, PHHAL_HW_CARDTYPE_I18000P3M3);
  • Turn ON the field - phhalHw_FieldOn();
  • Wait for initial guard time - phalHw_Wait(pHal, 5100, PHHAL_HW_TIME_MICROSECONDS);
  • Start inventory - phhalHw_I18000p3m3Inventory(pHal,pSelectFrame, bSelectFrameLen, bNumValidBits, pBeginRndFrame, bTSProcessing, &pResponse, &wRxLen);
  • Store the responses received for the tags.
  • If inventory has to be continued then issue the ResumeInventory command - phhalHw_I18000p3m3ResumeInventory(pHal, &pResponse, &wRxLen);
  • Use phpalI18000p3m3 and phalI18000p3m3 APIs to further communicate with the tag.
  • Turn OFF the field - phhalHw_FieldOff();
  • Termination of the application flow.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTWhen there is no tag in the field.
PH_ERR_USE_CONDITIONIf called when the phhalHw_I18000p3m3 was not called previously with bTSprocessing = PHHAL_HW_I18000P3M3_GET_MAX_RESPS.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]ppRxBuffer[Out] Pointer to HAL Rx Buffer containing response from single/multiple tags.
[out]wRxBufferLen[Out] Length of response in hal Rx Buffer.

◆ phhalHw_ReadEEPROM()

phStatus_t phhalHw_ReadEEPROM ( void *  pDataParams,
uint16_t  wOption,
uint32_t  dwAddr_ProtIndex,
uint32_t  dwNoOfBytesToRead,
uint8_t **  ppResponse,
uint16_t pRespLen 
)

Reads the EEPROM information.

Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wOption[IN] Options to be used for EEPROM Reading.
  • 0x0000: Only dwStartAddr and dwLength information will be exchagned to Reader.
  • dwStartAddr and dwLength along with the specified information to this paramter will be exchagned to Reader. These values are specific to Pegoda - 3 Reader.
    • 0x0010: Read information from User area
    • 0x0011: Read information from Secure Lib area
    • 0x0012: Read information from IC Configuration area
    • 0x0020: Read information from RF Configuration area
  • Values other that above specified ones.
[in]dwAddr_ProtIndex[IN] The EEPROM address or Protocol Index from where the information should be read. One of the following,
  • If wOption = 0x0010, 0x0011 or 0x0012, then 2 byte EEPROM address. This is supported by Pegoda - 3 Reader only.
  • If wOption = 0x0020, then 1 byte Protocol index of the RF Configuration. This is supported by Pegoda - 3 Reader only.
  • If wOption = 0x0000, then 4 byte EEPROM address. Reader other than Pegoda 3 reader.
[in]dwNoOfBytesToRead[IN] Number of bytes to be read from EEPROM starting from address specified. If Reader is Pegoda -3 and wOption = 0x0020, then zero should be provided.
[out]ppResponse[OUT] EEPROM information from the mentioned start address (dwStartAddr) until the requested length. Make sure the buffer is allocated for the requested number of bytes (dwLength).
[out]pRespLen[OUT] Length of bytes available in pResponse buffer

◆ phhalHw_WriteEEPROM()

phStatus_t phhalHw_WriteEEPROM ( void *  pDataParams,
uint16_t  wOption,
uint32_t  dwStartAddr,
uint8_t pData,
uint16_t  wDataLen 
)

Writes the EEPROM information.

Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wOption[IN] Options to be used for EEPROM Writing.
  • 0x0000: Only dwStartAddr and dwLength information will be exchagned to Reader.
  • dwStartAddr and dwLength along with the specified information will be exchagned to Reader. These values are specific to Pegoda - 3 Reader.
    • 0x0010: Read information from User area
    • 0x0011: Read information from Secure Lib area
    • 0x0012: Read information from IC Configuration area
    • 0x0020: Read information from RF Configuration area
[in]dwStartAddr[IN] The EEPROM address information to be written. One of the following,
  • If wOption = 0x0010, 0x0011 or 0x0012, then 2 byte EEPROM address. This is supported by Pegoda - 3 Reader only.
  • If wOption = 0x0020, zero should be provided.
  • If wOption = 0x0000, then 4 byte EEPROM address. Reader other than Pegoda 3 reader.
[in]pData[IN] Information to be written to EERPOM. One of the following,
  • If wOption = 0x0000, 0x0010, 0x0011 or 0x0012, then EEPROM value should be provided.
  • If wOption = 0x0020, then 1 byte Protocol index followed 1 byte Register address followed by 4 byte Register Value. This is supported by Pegoda - 3 Reader only.
    Protocol Index1 ( 1 Byte) || Reg Addr1 ( 1 Byte) || Reg Value1 ( 4 Bytes) || Reg Addr2 ( 1 Byte) || Reg Value2 ( 4 Bytes) || ... Reg AddrN ( 1 Byte) || Reg ValueN ( 4 Bytes)
[in]wDataLen[IN] Length of bytes available in pData buffer.