can: xcan.h File Reference

| can Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions
xcan.h File Reference

## Data Structures
struct | XCan_Config
| This typedef contains configuration information for a device. More...
struct | XCan
| The XCan driver instance data. More...

## Macros
#define | XCan_IsTxDone(InstancePtr)
| This macro checks if the transmission is complete. More...
#define | XCan_IsTxFifoFull(InstancePtr)
| This macro checks if the transmission FIFO is full. More...
#define | XCan_IsHighPriorityBufFull(InstancePtr)
| This macro checks if the Transmission High Priority Buffer is full. More...
#define | XCan_IsRxEmpty(InstancePtr)
| This macro checks if the receive FIFO is empty. More...
#define | XCan_IsAcceptFilterBusy(InstancePtr)
| This macro checks if the CAN device is ready for the driver to change Acceptance Filter Identifier Registers (AFIR) and Acceptance Filter Mask Registers (AFMR). More...
#define | XCan_CreateIdValue(StandardId, SubRemoteTransReq, IdExtension, ExtendedId, RemoteTransReq)
| This macro calculates CAN message identifier value given identifier field values. More...
#define | XCan_CreateDlcValue(DataLengCode) (((DataLengCode) << XCAN_DLCR_DLC_SHIFT) & XCAN_DLCR_DLC_MASK)
| This macro calculates value for Data Length Code register given Data Length Code value. More...
CAN operation modes
#define | XCAN_MODE_CONFIG 0x00000001
| Configuration mode. More...
#define | XCAN_MODE_NORMAL 0x00000002
| Normal mode. More...
#define | XCAN_MODE_LOOPBACK 0x00000004
| Loop Back mode. More...
#define | XCAN_MODE_SLEEP 0x00000008
| Sleep mode. More...
Callback identifiers used as parameters to XCan_SetHandler()
#define | XCAN_HANDLER_SEND 1
| Handler type for frame sending interrupt. More...
#define | XCAN_HANDLER_RECV 2
| Handler type for frame reception interrupt. More...
#define | XCAN_HANDLER_ERROR 3
| Handler type for error interrupt. More...
#define | XCAN_HANDLER_EVENT 4
| Handler type for all other interrupts. More...

## Typedefs
typedef void(* | XCan_SendRecvHandler )(void *CallBackRef)
| Callback type for frame sending and reception interrupts. More...
typedef void(* | XCan_ErrorHandler )(void *CallBackRef, u32 ErrorMask)
| Callback type for error interrupt. More...
typedef void(* | XCan_EventHandler )(void *CallBackRef, u32 Mask)
| Callback type for all kinds of interrupts except sending frame interrupt, receiving frame interrupt, and error interrupt. More...

## Functions
int | XCan_Initialize (XCan *InstancePtr, u16 DeviceId)
| This routine initializes a specific XCan instance/driver. More...
int | XCan_VmInitialize (XCan *InstancePtr, u16 DeviceId, UINTPTR VirtAddr)
| This routine initializes of a specific XCan instance/driver. More...
void | XCan_Reset (XCan *InstancePtr)
| This function resets the CAN device. More...
u8 | XCan_GetMode (XCan *InstancePtr)
| This routine returns current operation mode the CAN device is in. More...
void | XCan_EnterMode (XCan *InstancePtr, u8 OperationMode)
| This function allows the CAN device to enter one of the following operation modes: More...
u32 | XCan_GetStatus (XCan *InstancePtr)
| This function returns Status value from Status Register (SR). More...
void | XCan_GetBusErrorCounter (XCan *InstancePtr, u8 *RxErrorCount, u8 *TxErrorCount)
| This function reads Receive and Transmit error counters. More...
u32 | XCan_GetBusErrorStatus (XCan *InstancePtr)
| This function reads Error Status value from Error Status Register (ESR). More...
void | XCan_ClearBusErrorStatus (XCan *InstancePtr, u32 Mask)
| This function clears Error Status bit(s) previously set in Error Status Register (ESR). More...
int | XCan_Send (XCan *InstancePtr, u32 *FramePtr)
| This function sends a CAN Frame. More...
int | XCan_Recv (XCan *InstancePtr, u32 *FramePtr)
| This function receives a CAN Frame. More...
int | XCan_SendHighPriority (XCan *InstancePtr, u32 *FramePtr)
| This routine sends a CAN High Priority frame. More...
void | XCan_AcceptFilterEnable (XCan *InstancePtr, u32 FilterIndexes)
| This routine enables individual acceptance filters. More...
void | XCan_AcceptFilterDisable (XCan *InstancePtr, u32 FilterIndexes)
| This routine disables individual acceptance filters. More...
u32 | XCan_AcceptFilterGetEnabled (XCan *InstancePtr)
| This function returns enabled acceptance filters. More...
int | XCan_AcceptFilterSet (XCan *InstancePtr, u32 FilterIndex, u32 MaskValue, u32 IdValue)
| This function sets values to the Acceptance Filter Mask Register (AFMR) and Acceptance Filter ID Register (AFIR) for the specified Acceptance Filter. More...
void | XCan_AcceptFilterGet (XCan *InstancePtr, u32 FilterIndex, u32 *MaskValue, u32 *IdValue)
| This function reads the values of the Acceptance Filter Mask and ID Register for the specified Acceptance Filter. More...
XCan_Config * | XCan_LookupConfig (u16 DeviceId)
| This function looks for the device configuration based on the unique device ID. More...
XCan_Config * | XCan_GetConfig (unsigned int InstanceIndex)
| This function looks for the device configuration based on the device index. More...
int | XCan_SetBaudRatePrescaler (XCan *InstancePtr, u8 Prescaler)
| This routine sets Baud Rate Prescaler value. More...
u8 | XCan_GetBaudRatePrescaler (XCan *InstancePtr)
| This routine gets Baud Rate Prescaler value. More...
int | XCan_SetBitTiming (XCan *InstancePtr, u8 SyncJumpWidth, u8 TimeSegment2, u8 TimeSegment1)
| This routine sets Bit time. More...
void | XCan_GetBitTiming (XCan *InstancePtr, u8 *SyncJumpWidth, u8 *TimeSegment2, u8 *TimeSegment1)
| This routine gets Bit time. More...
int | XCan_SelfTest (XCan *InstancePtr)
| This function runs a self-test on the CAN driver/device. More...
void | XCan_InterruptEnable (XCan *InstancePtr, u32 Mask)
| This routine enables interrupt(s). More...
void | XCan_InterruptDisable (XCan *InstancePtr, u32 Mask)
| This routine disables interrupt(s). More...
u32 | XCan_InterruptGetEnabled (XCan *InstancePtr)
| This routine returns enabled interrupt(s). More...
u32 | XCan_InterruptGetStatus (XCan *InstancePtr)
| This routine returns interrupt status read from Interrupt Status Register. More...
void | XCan_InterruptClear (XCan *InstancePtr, u32 Mask)
| This function clears interrupt(s). More...
void | XCan_IntrHandler (void *InstancePtr)
| This routine is the interrupt handler for the CAN driver. More...
int | XCan_SetHandler (XCan *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)
| This routine installs an asynchronous callback function for the given HandlerType: More...