NXP Reader Library  v17.1.0.2535
HAL Initialization for Pegoda 1 (RD70x)

Example code to configure HAL and BAL for Rd70x (Pegoda 1) reader. More...

Collaboration diagram for HAL Initialization for Pegoda 1 (RD70x):

Modules

 Software Initialization
 Example code to configure PAL 3A, 4A, 4, MIFARE and SLI15693 to work in software mode.
 

Detailed Description

Example code to configure HAL and BAL for Rd70x (Pegoda 1) reader.

#define CHECK_SUCCESS(x) \
if ( (x) != PH_ERR_SUCCESS ) \
{ \
printf ( "\n\n" ); \
printf ( "An error occurred: (0x%04X)\n", (x) ); \
printf ( "Pressing any key will exit the demo.\n" ); \
_getch (); \
return 0; \
}
/* Variables */
phStatus_t wStatus = 0;
uint16_t wCount = 0;
uint8_t aReaderList[512];
uint8_t aTx_HalBuffer[512];
uint8_t aRx_HalBuffer[512];
void* pBal_Generic = NULL;
void* pHal_Generic = NULL;
/* Initialize the reader BAL component */
wStatus = phbalReg_Rd70xUsbWin_Init ( &stBal_Rd70x, sizeof ( stBal_Rd70x ) );
CHECK_SUCCESS ( wStatus );
/* Get list of connected pegoda readers. */
wStatus = phbalReg_GetPortList ( &stBal_Rd70x, sizeof ( aReaderList ), aReaderList, &wCount );
CHECK_SUCCESS ( wStatus );
/* Connect to the first reader out of the list. */
wStatus = phbalReg_SetPort (aReaderList);
CHECK_SUCCESS ( wStatus );
/* Open the reader port. */
wStatus = phbalReg_OpenPort ( &stBal_Rd70x );
CHECK_SUCCESS ( wStatus );
/* Initialize the reader HAL component. */
wStatus = phhalHw_Rd70x_Init ( &stHal_Rd70x, sizeof ( stHal_Rd70x ), &stBal_Rd70x, aTx_HalBuffer,
sizeof ( aTx_HalBuffer ), aRx_HalBuffer, sizeof ( aRx_HalBuffer ) );
CHECK_SUCCESS ( wStatus );
/* Update the generic components. */
pBal_Generic = &stBal_Rd70x;
pHal_Generic = &stHal_Rd70x;
phhalHw_Rd70x_DataParams_t
Rd70x HAL parameter structure.
Definition: phhalHw.h:432
phbalReg_GetPortList
phStatus_t phbalReg_GetPortList(void *pDataParams, uint16_t wPortBufSize, uint8_t *pPortNames, uint16_t *pNumOfPorts)
List all available ports.
phbalReg_Rd70xUsbWin_DataParams_t
Rd70x USB (Windows) BAL parameter structure.
Definition: phbalReg.h:462
phStatus_t
uint16_t phStatus_t
phcsBfl_Status_t is a signed short value, using the positive range.
Definition: ph_TypeDefs.h:158
phbalReg_SetPort
phStatus_t phbalReg_SetPort(void *pDataParams, uint8_t *pPortName)
Select Port to be used.
uint16_t
unsigned short uint16_t
16 bit unsigned integer
Definition: ph_TypeDefs.h:62
phbalReg_Rd70xUsbWin_Init
phStatus_t phbalReg_Rd70xUsbWin_Init(phbalReg_Rd70xUsbWin_DataParams_t *pDataParams, uint16_t wSizeOfDataParams)
Initialise the PEGODA USB BAL component.
phhalHw_Rd70x_Init
phStatus_t phhalHw_Rd70x_Init(phhalHw_Rd70x_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, phbalReg_Rd70xUsbWin_DataParams_t *pBalDataParams, uint8_t *pTxBuffer, uint16_t wTxBufSize, uint8_t *pRxBuffer, uint16_t wRxBufSize)
Initialise the HAL component.
phbalReg_OpenPort
phStatus_t phbalReg_OpenPort(void *pDataParams)
Open communication port.
uint8_t
unsigned char uint8_t
8 bit unsigned integer
Definition: ph_TypeDefs.h:56