SamAV2 Reader HAL. More...

Modules | |
| Register Definitions for Rc523 | |
| Register definitions for Rc663. | |
| Register Definitions for Rc663 | |
| Register definitions for Rc663. | |
| Rc663 User Configuration | |
| Custom Configuration of hardware related settings. | |
| Host Communication | |
| Host Communication. | |
| Command Interface | |
| Command Interface. | |
Data Structures | |
| struct | phhalHw_SamAV2_DataParams_t |
| SamAV2 HAL parameter structure. More... | |
Macros | |
| #define | PHHAL_HW_SAMAV2_ID 0x03 |
| ID for SamAV2 HAL component. | |
| #define | PHHAL_HW_SAMAV2_SHADOW_COUNT 0x000FU |
| Number of shadowed configurations. | |
| #define | PHHAL_HW_SAMAV2_RESERVED_TX_BUFFER_LEN 6U |
| Amount of needed and reserved memory for the protocol overhead. | |
| #define | PHHAL_HW_SAMAV2_RESERVED_RX_BUFFER_LEN 2U |
| Amount of needed and reserved memory for the protocol overhead. | |
| #define | PHHAL_HW_SAMAV2_HC_SAM_UID_SIZE 0x07U |
| Length of the SAM UID. | |
| #define | PHHAL_HW_SAMAV2_KEYENTRY_SIZE_AV1 0x3CU |
| Define the maximum possible size of a key entry in AV1. | |
| #define | PHHAL_HW_SAMAV2_KEYENTRY_SIZE 0x3DU |
| Define the maximum possible size of a key entry. | |
Functions | |
| phStatus_t | phhalHw_SamAV2_Init (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pBalDataParams, void *pReaderHalDataParams, void *pKeyStoreDataParams, void *pCryptoENCDataParams, void *pCryptoMACDataParams, void *pCryptoRngDataParams, uint8_t bOpMode, uint8_t bLogicalChannel, uint8_t *pTxBuffer, uint16_t wTxBufSize, uint8_t *pRxBuffer, uint16_t wRxBufSize) |
| Initialise the HAL component. More... | |
| phStatus_t | phhalHw_SamAV2_DetectMode (phhalHw_SamAV2_DataParams_t *pDataParams) |
| Detect UID, AV1/AV2 mode and HostAuth settings. More... | |
Operation modes | |
| #define | PHHAL_HW_SAMAV2_OPMODE_NON_X 0x00 |
| Non-X operation mode. | |
| #define | PHHAL_HW_SAMAV2_OPMODE_X_RC523 0x01 |
| X-Mode operation (using Rc523). | |
| #define | PHHAL_HW_SAMAV2_OPMODE_X_RC663 0x02 |
| X-Mode operation (using Rc663). | |
| #define | PHHAL_HW_SAMAV3_OPMODE_NON_X 0x00 |
| Non-X operation mode. | |
| #define | PHHAL_HW_SAMAV3_OPMODE_X_RC523 0x01 |
| X-Mode operation (using Rc523). | |
| #define | PHHAL_HW_SAMAV3_OPMODE_X_RC663 0x02 |
| X-Mode operation (using Rc663). | |
Host-Communication modes | |
| #define | PHHAL_HW_SAMAV2_HC_AV1_MODE 0x01U |
| Define the AV1 mode of the SAMAV2. | |
| #define | PHHAL_HW_SAMAV2_HC_AV2_MODE 0x02U |
| Define the AV2 mode of the SAMAV2. | |
| #define | PHHAL_HW_SAMAV3_HC_AV2_MODE 0x02U |
| Sam AV2 hardware is used. | |
| #define | PHHAL_HW_SAMAV3_HC_AV3_MODE 0x03U |
| Sam AV3 hardware is used with sam in Un-Activated or Activated state. | |
Configs | |
| #define | PHHAL_HW_SAMAV2_CONFIG_HOSTMODE (PH_CONFIG_CUSTOM_BEGIN + 0) |
| Get / Set the Hostmode; (e.g. More... | |
| #define | PHHAL_HW_SAMAV2_CONFIG_DISABLE_NONX_CFG_MAPPING (PH_CONFIG_CUSTOM_BEGIN + 1) |
| Disables the mapping of standard-configs to the Reader HAL if set to PH_ON; Default is PH_OFF; Only applicable in NonX-Mode. | |
| #define | PHHAL_HW_SAMAV3_CONFIG_HOSTMODE (PH_CONFIG_CUSTOM_BEGIN + 0) |
| Get / Set the Hostmode; (e.g. More... | |
| #define | PHHAL_HW_SAMAV3_CONFIG_DISABLE_NONX_CFG_MAPPING (PH_CONFIG_CUSTOM_BEGIN + 1) |
| Disables the mapping of standard-configs to the Reader HAL if set to PH_ON; Default is PH_OFF; Only applicable in NonX-Mode. | |
phhalHw_SamAV2 Custom Exchange Option Bits | |
| #define | PHHAL_HW_SAMAV2_EXCHANGE_NO_ENCIPHERING_BIT 0x0010U |
| Suppress MIFARE Crypto enciphering of transmitted data. | |
| #define | PHHAL_HW_SAMAV2_EXCHANGE_NO_DECIPHERING_BIT 0x0020U |
| Suppress deciphering of received MIFARE Crypto streams. | |
DES Key Options | |
| #define | PHHAL_HW_SAMAV2_DES_OPTION_DESFIRE4 0x00 |
| DESFire 4 compatibility mode. | |
| #define | PHHAL_HW_SAMAV2_DES_OPTION_ISO_CRC16 0x01 |
| ISO 10116 mode with CRC16 protection and 4 bytes MAC. | |
| #define | PHHAL_HW_SAMAV2_DES_OPTION_ISO_CRC32 0x02 |
| ISO 10116 mode with CRC32 protection and 8 bytes MAC. | |
SamAV2 Reader HAL.
Also supports AV1 backwards compatibility mode.
| #define PHHAL_HW_SAMAV2_CONFIG_HOSTMODE (PH_CONFIG_CUSTOM_BEGIN + 0) |
Get / Set the Hostmode; (e.g.
| #define PHHAL_HW_SAMAV3_CONFIG_HOSTMODE (PH_CONFIG_CUSTOM_BEGIN + 0) |
Get / Set the Hostmode; (e.g.
| phStatus_t phhalHw_SamAV2_Init | ( | phhalHw_SamAV2_DataParams_t * | pDataParams, |
| uint16_t | wSizeOfDataParams, | ||
| void * | pBalDataParams, | ||
| void * | pReaderHalDataParams, | ||
| void * | pKeyStoreDataParams, | ||
| void * | pCryptoENCDataParams, | ||
| void * | pCryptoMACDataParams, | ||
| void * | pCryptoRngDataParams, | ||
| uint8_t | bOpMode, | ||
| uint8_t | bLogicalChannel, | ||
| uint8_t * | pTxBuffer, | ||
| uint16_t | wTxBufSize, | ||
| uint8_t * | pRxBuffer, | ||
| uint16_t | wRxBufSize | ||
| ) |
Initialise the HAL component.
The operation mode used is only dependend on the pReaderHalDataParams parameter.
If it's value is NULL X-Mode operation is performed, otherwise the HAL operates in Non-X Mode.
Non-X Mode Specific: It is not neccessary to do any (non-specific) calls to the linked Reader-HAL except an Init(),
the SamAV2 HAL will take over complete control of the linked Reader.
Specific initialisation like PHHAL_HW_CONFIG_BAL_CONNECTION or PHHAL_HW_CONFIG_SERIAL_BITRATE etc. though may be neccessary depending on the used HAL.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlaying component. |
| [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. |
| [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. |
| [in] | bOpMode | [In] The desired operation mode; e.g. PHHAL_HW_SAMAV2_OPMODE_NON_X. |
| [in] | bLogicalChannel | [In] The desired logical channel for this HAL. |
| [in] | pTxBuffer | [In] Pointer to global transmit buffer. |
| [in] | wTxBufSize | [In] Size of the global transmit buffer. |
| [in] | pRxBuffer | [In] Pointer to global receive buffer. |
| [in] | wRxBufSize | [In] Size of the global receive buffer. |
| phStatus_t phhalHw_SamAV2_DetectMode | ( | phhalHw_SamAV2_DataParams_t * | pDataParams | ) |
Detect UID, AV1/AV2 mode and HostAuth settings.
| PH_ERR_SUCCESS | Operation successful. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |