XilinxProcessorIPLib/drivers/can/src/xcan.c
int XCan_SendHighPriority(XCan *InstancePtr, u32 *FramePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * Check if TX High Priority Buffer has room. If not, return error code
	 */
	if (XCan_IsHighPriorityBufFull(InstancePtr) == TRUE) {
		return XST_FIFO_NO_ROOM;
	}

	/* Write IDR */
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_ID_OFFSET,
			FramePtr[0]);

	/* Write DLC */
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DLC_OFFSET,
			FramePtr[1]);

	/* Write Data Word 1 */
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DW1_OFFSET,
			FramePtr[2]);

	/* Write Data Word 2 */
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DW2_OFFSET,
			FramePtr[3]);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This routine sends a CAN High Priority frame. This function first checks if
* TX High Priority Buffer is empty. If yes, it then writes the given frame into
* the Buffer. If not, This function returns immediately. This function does not
* wait for the given frame being sent to CAN bus.
*
* @param	InstancePtr is a pointer to the XCan instance to be worked on.
* @param	FramePtr is a pointer to a 32-bit aligned buffer containing the
*		CAN High Priority frame to be sent.
*
* @return
*		- XST_SUCCESS if TX High Priority Buffer was not full and the
*		given frame was written into the buffer;
*		- XST_FIFO_NO_ROOM if there is no room in the TX High Priority
*		Buffer for this frame.
*
* @note
*
* If the frame needs to be sent immediately and not delayed by processor's
* interrupts handling, the caller should disable interrupt at processor
* level before invoking this function.
*
******************************************************************************/
This routine sends a CAN High Priority frame. This function first checks if
TX High Priority Buffer is empty. If yes, it then writes the given frame into
the Buffer. If not, This function returns immediately. This function does not
wait for the given frame being sent to CAN bus.
This routine sends a CAN High Priority frame . This function first checks if TX High Priority Buffer is empty . If yes it then writes the given frame into the Buffer . If not This function returns immediately . This function does not wait for the given frame being sent to CAN bus .
int XCan_SendHighPriority(XCan *InstancePtr, u32 *FramePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	if (XCan_IsHighPriorityBufFull(InstancePtr) == TRUE) {
		return XST_FIFO_NO_ROOM;
	}
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_ID_OFFSET,
			FramePtr[0]);
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DLC_OFFSET,
			FramePtr[1]);
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DW1_OFFSET,
			FramePtr[2]);
	XCan_WriteReg(InstancePtr->BaseAddress, XCAN_TXBUF_DW2_OFFSET,
			FramePtr[3]);
	return XST_SUCCESS;
}
int XCan_SendHighPriority ( XCan * InstancePtr , u32 * FramePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; if ( XCan_IsHighPriorityBufFull ( InstancePtr ) == TRUE ) { return XST_FIFO_NO_ROOM ; } XCan_WriteReg ( InstancePtr -> BaseAddress , XCAN_TXBUF_ID_OFFSET , FramePtr [ 0 ] ) ; XCan_WriteReg ( InstancePtr -> BaseAddress , XCAN_TXBUF_DLC_OFFSET , FramePtr [ 1 ] ) ; XCan_WriteReg ( InstancePtr -> BaseAddress , XCAN_TXBUF_DW1_OFFSET , FramePtr [ 2 ] ) ; XCan_WriteReg ( InstancePtr -> BaseAddress , XCAN_TXBUF_DW2_OFFSET , FramePtr [ 3 ] ) ; return XST_SUCCESS ; }
This routine sends a CAN High Priority frame.
This routine sends a CAN High Priority frame .
/*
	 * Check if TX High Priority Buffer has room. If not, return error code
	 */ /* Write IDR */ /* Write DLC */ /* Write Data Word 1 */ /* Write Data Word 2 */