Specific SAM HAL component for SAM (AV4 and future SAM's)
More...
|
| | Error Codes |
| | Error Codes received from SAM and the equivalent Reader Library mapped error codes returned to user.
|
| |
| | Host Communication |
| | Implementation of Host Communication interfaces.
|
| |
| | Utility |
| | Implementation of Utility interfaces.
|
| |
| | Command Interface |
| | Implementation of all SAM commands.
|
| |
| | Global Defines |
| | Macro Definitions used across the whole SAM implementation.
|
| |
|
|
#define | PHHAL_HW_SAM_ID 0x13U |
| | ID for SAM (AV4 and future SAM's) HAL component.
|
| |
|
| phStatus_t | phhalHw_Sam_Init (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pBalDataParams, void *pReaderHalDataParams, void *pKeyStoreDataParams, void *pCryptoENCDataParams, void *pCryptoMACDataParams, void *pCryptoRngDataParams, void *pPLUpload_CryptoENCDataParams, void *pPLUpload_CryptoMACDataParams, uint8_t bOpMode, uint8_t bLogicalChannel, uint8_t *pTxBuffer, uint16_t wTxBufSize, uint8_t *pRxBuffer, uint16_t wRxBufSize, uint8_t *pPLUploadBuf, uint8_t *pCmdBuff, uint16_t wCmdBuffSize) |
| | Interface to initialize the SAM (AV4 and future SAM's) component. More...
|
| |
| phStatus_t | phhalHw_Sam_DetectMode (phhalHw_Sam_DataParams_t *pDataParams) |
| | Saves UID and mode of SAM (AV3, AV4, future SAM's). More...
|
| |
Specific SAM HAL component for SAM (AV4 and future SAM's)
- Supports New features of SAM AV4.
- Supports AV3 backwards compatibility mode.
- Post Initialization of SAM, it's must to call Detect Mode interface to know the current state of SAM. Whether it's is in one of the following modes
- SAM supports 4 logical channels.
- Each Logical channel can have it's own authentication and session keys, and e.g. can have multiple PICC authentications at a time, on separate logical channels, basically running 2 independent secure messaging channels.
- Other example would be that one logical channel for PICC communication and authentication, second one for an Offline Crypto key, that is used to additionally encrypt data that is written to a PICC with a separate key.
- This component returns mapped error code for the actual error codes received from SAM. To get the actual error code returned by SAM call Get Config with configuration identifier as Actual SAM Error.
- SAM Supports communication command exchange via ISO7816 T = 1 and I2C communication. To configure the communication type call Set Config with configuration identifier as Communication Type
- To configure I2C Timeout, I2C BitRate and I2C Slave Address, call the below identifiers using Set Config interface
- Default 0x2B will be used as Slave Address and 200ms timeout for I2C Communication.
◆ phhalHw_Sam_Init()
| phStatus_t phhalHw_Sam_Init |
( |
phhalHw_Sam_DataParams_t * |
pDataParams, |
|
|
uint16_t |
wSizeOfDataParams, |
|
|
void * |
pBalDataParams, |
|
|
void * |
pReaderHalDataParams, |
|
|
void * |
pKeyStoreDataParams, |
|
|
void * |
pCryptoENCDataParams, |
|
|
void * |
pCryptoMACDataParams, |
|
|
void * |
pCryptoRngDataParams, |
|
|
void * |
pPLUpload_CryptoENCDataParams, |
|
|
void * |
pPLUpload_CryptoMACDataParams, |
|
|
uint8_t |
bOpMode, |
|
|
uint8_t |
bLogicalChannel, |
|
|
uint8_t * |
pTxBuffer, |
|
|
uint16_t |
wTxBufSize, |
|
|
uint8_t * |
pRxBuffer, |
|
|
uint16_t |
wRxBufSize, |
|
|
uint8_t * |
pPLUploadBuf, |
|
|
uint8_t * |
pCmdBuff, |
|
|
uint16_t |
wCmdBuffSize |
|
) |
| |
Interface to initialize the SAM (AV4 and future SAM's) component.
- pTxBuffer should be Size + Reserved Tx Buffer Len. If pTxBuffer is 256, then it should be 256 + Reserved Tx Buffer Len.
- pRxBuffer should be Size + Reserved Rx Buffer Len. If pRxBuffer is 256, then it should be 256 + Reserved Rx Buffer Len.
- The operation mode used is only depended on the pReaderHalDataParams parameter.
- If pReaderHalDataParams parameter value is NULL X-Mode operation is performed, otherwise the HAL operates in S-Mode (Non-X) Mode.
- Non-X Mode Specific: It is not necessary to do any (non-specific) calls to the linked Reader-HAL except an Init(), the Sam HAL will take over complete control of the linked Reader.
- In case of S-Mode communication,
- Pegoda - 3 reader (CLRD730): pBalDataParams parameter should be initialized with BAL SAM component, BAL SAM's pLowerBalDataParams parameter should be linked to one of the following,
- Pegoda - 2 reader (MFEV710)
- SAM inserted in Reader slot: pBalDataParams parameter should be initialized with BAL SAM component and BAL SAM's pLowerBalDataParams parameter should be linked to BAL PCSCWin.
- SAM inserted in other contact based readers: pBalDataParams parameter should be initialized with BAL PCSCWin component.
- In case of X-Mode communication for Pegoda - 2 reader (MFEV710, SAM inserted in Reader slot), pBalDataParams parameter should be initialized with BAL PCSCWin component.
- SAM Supports communication command exchange via ISO7816 T = 1 and I2C communication. To configure the communication type call Set Config with configuration identifier as Communication Type
- To configure I2C Timeout, I2C BitRate and I2C Slave Address, call the below identifiers using Set Config interface
- Default 0x2B will be used as Slave Address and 200ms timeout for I2C Communication.
- Returns
- Status code
- Return values
-
- Parameters
-
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wSizeOfDataParams | [In] Specifies the size of the data parameter structure. |
| [in] | pBalDataParams | [In] Pointer to the lower layers parameter structure. |
| [in] | pReaderHalDataParams | [In] Pointer to a Reader-HAL in Non-X Mode. Can be NULL if X-Mode is intended. |
| [in] | pKeyStoreDataParams | [In] Pointer to the KeyStore used for Host Authentication interfaces. |
| [in] | pCryptoENCDataParams | [In] Pointer to the ENC crypto layers parameter structure. |
| [in] | pCryptoMACDataParams | [In] Pointer to the MAC crypto layers parameter structure. |
| [in] | pCryptoRngDataParams | [In] Pointer to the parameter structure of the CryptoRng layer. |
| pPLUpload_CryptoENCDataParams | Pointer to the ENC crypto layers parameter structure. This will be used for ProgrammableLogic feature only. |
| pPLUpload_CryptoMACDataParams | Pointer to the MAC crypto layers parameter structure. This will be used for ProgrammableLogic feature only. |
| [in] | bOpMode | [In] The desired operation mode. One of the below values
|
| [in] | bLogicalChannel | [In] The desired logical channel for this HAL.
|
| [in] | pTxBuffer | [In] Buffer for SAM command transmission. |
| [in] | wTxBufSize | [In] Size of the global transmit buffer. |
| [in] | pRxBuffer | [In] Buffer for SAM command Reception. |
| [in] | wRxBufSize | [In] Size of the global receive buffer. |
| [in] | pPLUploadBuf | [In] Buffer for Programmable Logic operations. |
| [in] | pCmdBuff | [In] Pointer to global command buffer. This will be used to frame SAM Command internally by the library. |
| [in] | wCmdBuffSize | [In] Size of the global transmit buffer. |
◆ phhalHw_Sam_DetectMode()
Saves UID and mode of SAM (AV3, AV4, future SAM's).
This function should be called prior to all other functions even before Host Authentication.
- Returns
- Status code
- Return values
-
- Parameters
-
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |