XilinxProcessorIPLib/drivers/board_common/src/rfclk/src/xrfclk.c
static int XRFClk_I2cIoExpanderConfig()
{
	u8 tx[3] = { I2C_IO_EXPANDER_CONFIG_REG_ADDR };
	u8 rx;
	int ret;

	ret = XRFClk_I2CRdData(FD_I2C0, I2C_ADDR_I2C_IO_EXPANDER, &rx, 1);
	if (ret == XST_FAILURE) {
		LOG("read expander data");
		return XST_FAILURE;
	}

	/* Set MUX_SEL_0/1 to output */
	tx[1] = rx & ~(I2C_MUX_SEL_0 | I2C_MUX_SEL_1);
	ret = XRFClk_I2CWrData(FD_I2C0, I2C_ADDR_I2C_IO_EXPANDER, tx, 2);
	if (ret == XST_FAILURE) {
		LOG("write expander data");
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
/****************************************************************************/
/**
*
* This function is used to enable GPIO_SEL on I2C expander for ZCU111.
*
* @param	ChipId indicates the RF clock chip Id.
*
* @return
*	- XST_SUCCESS if successful.
*	- XST_FAILURE if failed.
*
* @note		None
*
****************************************************************************/
This function is used to enable GPIO_SEL on I2C expander for ZCU111.
This function is used to enable GPIO_SEL on I2C expander for ZCU111 .
static int XRFClk_I2cIoExpanderConfig()
{
	u8 tx[3] = { I2C_IO_EXPANDER_CONFIG_REG_ADDR };
	u8 rx;
	int ret;
	ret = XRFClk_I2CRdData(FD_I2C0, I2C_ADDR_I2C_IO_EXPANDER, &rx, 1);
	if (ret == XST_FAILURE) {
		LOG("read expander data");
		return XST_FAILURE;
	}
	tx[1] = rx & ~(I2C_MUX_SEL_0 | I2C_MUX_SEL_1);
	ret = XRFClk_I2CWrData(FD_I2C0, I2C_ADDR_I2C_IO_EXPANDER, tx, 2);
	if (ret == XST_FAILURE) {
		LOG("write expander data");
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
static int XRFClk_I2cIoExpanderConfig ( ) { u8 tx [ 3 ] = { I2C_IO_EXPANDER_CONFIG_REG_ADDR } ; u8 rx ; int ret ; ret = XRFClk_I2CRdData ( FD_I2C0 , I2C_ADDR_I2C_IO_EXPANDER , & rx , 1 ) ; if ( ret == XST_FAILURE ) { LOG ( " " ) ; return XST_FAILURE ; } tx [ 1 ] = rx & ~ ( I2C_MUX_SEL_0 | I2C_MUX_SEL_1 ) ; ret = XRFClk_I2CWrData ( FD_I2C0 , I2C_ADDR_I2C_IO_EXPANDER , tx , 2 ) ; if ( ret == XST_FAILURE ) { LOG ( " " ) ; return XST_FAILURE ; } return XST_SUCCESS ; }
This function is used to enable GPIO_SEL on I2C expander for ZCU111.
This function is used to enable GPIO_SEL on I2C expander for ZCU111 .
/* Set MUX_SEL_0/1 to output */