Beispiel #1
0
/**
 * @brief  Initializes the xx95HF for the FELICA protocol
 * @param  void
 * @return TRUE (if well configured) / FALSE (Communication issue)
 */
static int8_t FELICA_Init( uint8_t *pDataRead )
{
	int8_t  status;
	u8     ProtocolSelectParameters [4]  = {0x51, 0x13, 0x01,0x0D};
	u8     WriteAmpliGain [2]  = {PCD_TYPEF_ARConfigA, PCD_TYPEF_ARConfigB};
	u8     AutoFDet [2]  = {0x02,0xA1};

	
	/* sends a protocol Select command to the pcd to configure it */
	errchk(PCD_ProtocolSelect(0x05,PCD_PROTOCOL_FELICA,ProtocolSelectParameters,pDataRead));
	TechnoSelected = PCDPROTOCOL_18092;
	
	/* in order to adjust the demodulation gain of the PCD*/
  errchk(PCD_WriteRegister    ( 0x04,AFE_ANALOG_CONF_REG_SELECTION,0x01,WriteAmpliGain,pDataRead)); 

	/* in order to adjust the auto detect of the PCD*/
	errchk(PCD_WriteRegister    ( 0x04,0x0A,0x01,AutoFDet,pDataRead)); 
	
	/* GT min time to respect before sending REQ_C */
	delay_us(20400);

	return ISO18092_SUCCESSCODE;
Error:
 return ISO18092_ERRORCODE_DEFAULT;
	
}
Beispiel #2
0
/**
 * @brief  this function writes the  configuration registers according to AFE_SET_ANALOG_CONFIG command
 * @retval ISO14443B_SUCCESSCODE  : the function is successful.
 * @retval ISO14443B_ERRORCODE_DEFAULT  : an error occured
 */
static int8_t ISO14443B_WriteARConfigB ( void )
{
	uint8_t SetAnalogConfigParameter [2]	= { PCD_TYPEB_ARConfigA, PCD_TYPEB_ARConfigB	};
	int8_t	status;
	uint8_t *pDataRead = u95HFBuffer;

	errchk(PCD_WriteRegister 			( 0x04,AFE_ANALOG_CONF_REG_SELECTION,0x01,SetAnalogConfigParameter,pDataRead));

	return ISO14443B_SUCCESSCODE;
Error:
	return ISO14443B_ERRORCODE_DEFAULT; 
}
Beispiel #3
0
/**
 * @brief  this command initializes the PCD device for the IS014443A protocol
 * @param  none
 * @return ISO14443A_SUCCESSCODE the function is succesful
 * @return ISO14443A_ERRORCODE_DEFAULT : an error occured
 */
int8_t ISO14443A_Init ( void )
{
	u8  ProtocolSelectParameters []  = {0x00, 0x01, 0xA0},
			WriteRegisterParameters []  = {0x5A, 0x04},
			DemoGainParameters []  = {0x01, 0xDF};
	uint8_t  *pDataRead = u95HFBuffer;
	int8_t  status;

	ISO14443A_InitStructure( );

	/* sends a protocol Select command to the pcd to configure it */
	errchk(PCD_ProtocolSelect(0x04,PCD_PROTOCOL_ISO14443A,ProtocolSelectParameters,pDataRead)); 

	errchk(PCD_WriteRegister    ( 0x04,0x3A,0x00,WriteRegisterParameters,pDataRead));

	/* in order to adjust the demoduation gain of the PCD*/
	errchk(PCD_WriteRegister (0x04,0x68,0x01,DemoGainParameters,u95HFBuffer));

#if 0
  errchk(PCD_WriteRegister  ( 0x03,0x68,0x00,&StartIndex,pDataRead)); 

	for(i=0; i<=1; i++)
	{
		errchk(PCD_WriteRegister  ( 0x03,0x69,0x00,&DemoGainParameters[i],pDataRead)); 
	} 

 
	errchk(PCD_WriteRegister  ( 0x03,0x68,0x00,&StartIndex,pDataRead)); 
	for(i=0; i<=5; i++)
	{
		errchk(PCD_ReadRegister ( 0x03,0x69,0x01,0x00,pDataRead));
		DemoGainParameters[i] = pDataRead[2];
	}
#endif
 
 return ISO14443A_SUCCESSCODE;
Error:
 return ISO14443A_ERRORCODE_DEFAULT;
	
}
Beispiel #4
0
/**
 * @brief  this function reads the configuration registers according to AFE_SET_ANALOG_CONFIG command
 * @param  *pDataRead	: Pointer to the PCD response
 * @retval ISO14443B_SUCCESSCODE  : the function is successful.
 * @retval ISO14443B_ERRORCODE_DEFAULT  : an error occured
 */
static int8_t ISO14443BReadARConfigB (uint8_t *pDataRead )
{
	int8_t 	status;
	uc8 data = 0x01;
	
	/* Select the register */
	errchk(PCD_WriteRegister (0x03,AFE_ANALOG_CONF_REG_SELECTION,0x00,&data,pDataRead));	
	/* Read the ARConfigA and B register */
	errchk(PCD_ReadRegister	( 0x03,AFE_ANALOG_CONF_REG_SELECTION,0x02,0x01,pDataRead));

	return ISO14443B_SUCCESSCODE;
Error:
	return ISO14443B_ERRORCODE_DEFAULT; 


}