XilinxProcessorIPLib/drivers/can/src/xcan.c
void XCan_GetBusErrorCounter(XCan *InstancePtr, u8 *RxErrorCount,
				 u8 *TxErrorCount)
{
	u32 Result;

	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/* Read Error Counter Register and parse it. */
	Result = XCan_ReadReg(InstancePtr->BaseAddress, XCAN_ECR_OFFSET);

	*RxErrorCount = (Result & XCAN_ECR_REC_MASK) >> XCAN_ECR_REC_SHIFT;
	*TxErrorCount = Result & XCAN_ECR_TEC_MASK;
}
/*****************************************************************************/
/**
*
* This function reads Receive and Transmit error counters.
*
* @param	InstancePtr is a pointer to the XCan instance to be worked on.
* @param	RxErrorCount will contain Receive Error Counter value after this
*		function returns.
* @param	TxErrorCount will contain Transmit Error Counter value after
*		this function returns.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function reads Receive and Transmit error counters.
This function reads Receive and Transmit error counters .
void XCan_GetBusErrorCounter(XCan *InstancePtr, u8 *RxErrorCount,
				 u8 *TxErrorCount)
{
	u32 Result;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Result = XCan_ReadReg(InstancePtr->BaseAddress, XCAN_ECR_OFFSET);
	*RxErrorCount = (Result & XCAN_ECR_REC_MASK) >> XCAN_ECR_REC_SHIFT;
	*TxErrorCount = Result & XCAN_ECR_TEC_MASK;
}
void XCan_GetBusErrorCounter ( XCan * InstancePtr , u8 * RxErrorCount , u8 * TxErrorCount ) { u32 Result ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Result = XCan_ReadReg ( InstancePtr -> BaseAddress , XCAN_ECR_OFFSET ) ; * RxErrorCount = ( Result & XCAN_ECR_REC_MASK ) >> XCAN_ECR_REC_SHIFT ; * TxErrorCount = Result & XCAN_ECR_TEC_MASK ; }
This function reads Receive and Transmit error counters.
This function reads Receive and Transmit error counters .
/* Read Error Counter Register and parse it. */