canps: xcanps.h File Reference

| canps Xilinx SDK Drivers API Documentation

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

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

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

## Macros
#define | XCanPs_IsTxDone(InstancePtr)
| This macro checks if the transmission is complete. More...
#define | XCanPs_IsTxFifoFull(InstancePtr)
| This macro checks if the transmission FIFO is full. More...
#define | XCanPs_IsHighPriorityBufFull(InstancePtr)
| This macro checks if the Transmission High Priority Buffer is full. More...
#define | XCanPs_IsRxEmpty(InstancePtr)
| This macro checks if the receive FIFO is empty. More...
#define | XCanPs_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 | XCanPs_CreateIdValue(StandardId, SubRemoteTransReq, IdExtension, ExtendedId, RemoteTransReq)
| This macro calculates CAN message identifier value given identifier field values. More...
#define | XCanPs_CreateDlcValue(DataLengCode) (((DataLengCode) << XCANPS_DLCR_DLC_SHIFT) & XCANPS_DLCR_DLC_MASK)
| This macro calculates value for Data Length Code register given Data Length Code value. More...
#define | XCanPs_ClearTimestamp(InstancePtr)
| This macro clears the timestamp in the Timestamp Control Register. More...
CAN operation modes
#define | XCANPS_MODE_CONFIG 0x00000001U
| Configuration mode. More...
#define | XCANPS_MODE_NORMAL 0x00000002U
| Normal mode. More...
#define | XCANPS_MODE_LOOPBACK 0x00000004U
| Loop Back mode. More...
#define | XCANPS_MODE_SLEEP 0x00000008U
| Sleep mode. More...
#define | XCANPS_MODE_SNOOP 0x00000010U
| Snoop mode. More...
Callback identifiers used as parameters to XCanPs_SetHandler()
#define | XCANPS_HANDLER_SEND 1U
| Handler type for frame sending interrupt. More...
#define | XCANPS_HANDLER_RECV 2U
| Handler type for frame reception interrupt. More...
#define | XCANPS_HANDLER_ERROR 3U
| Handler type for error interrupt. More...
#define | XCANPS_HANDLER_EVENT 4U
| Handler type for all other interrupts. More...

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

## Functions
void | XCanPs_Reset (XCanPs *InstancePtr)
| This function resets the CAN device. More...
u8 | XCanPs_GetMode (XCanPs *InstancePtr)
| This routine returns the current operation mode of the CAN device. More...
void | XCanPs_EnterMode (XCanPs *InstancePtr, u8 OperationMode)
| This function allows the CAN device to enter one of the following operation modes: More...
u32 | XCanPs_GetStatus (XCanPs *InstancePtr)
| This function returns Status value from Status Register (SR). More...
void | XCanPs_GetBusErrorCounter (XCanPs *InstancePtr, u8 *RxErrorCount, u8 *TxErrorCount)
| This function reads Receive and Transmit error counters. More...
u32 | XCanPs_GetBusErrorStatus (XCanPs *InstancePtr)
| This function reads Error Status value from Error Status Register (ESR). More...
void | XCanPs_ClearBusErrorStatus (XCanPs *InstancePtr, u32 Mask)
| This function clears Error Status bit(s) previously set in Error Status Register (ESR). More...
s32 | XCanPs_Send (XCanPs *InstancePtr, u32 *FramePtr)
| This function sends a CAN Frame. More...
s32 | XCanPs_Recv (XCanPs *InstancePtr, u32 *FramePtr)
| This function receives a CAN Frame. More...
s32 | XCanPs_SendHighPriority (XCanPs *InstancePtr, u32 *FramePtr)
| This routine sends a CAN High Priority frame. More...
void | XCanPs_AcceptFilterEnable (XCanPs *InstancePtr, u32 FilterIndexes)
| This routine enables individual acceptance filters. More...
void | XCanPs_AcceptFilterDisable (XCanPs *InstancePtr, u32 FilterIndexes)
| This routine disables individual acceptance filters. More...
u32 | XCanPs_AcceptFilterGetEnabled (XCanPs *InstancePtr)
| This function returns enabled acceptance filters. More...
s32 | XCanPs_AcceptFilterSet (XCanPs *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 | XCanPs_AcceptFilterGet (XCanPs *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...
s32 | XCanPs_SetBaudRatePrescaler (XCanPs *InstancePtr, u8 Prescaler)
| This routine sets Baud Rate Prescaler value. More...
u8 | XCanPs_GetBaudRatePrescaler (XCanPs *InstancePtr)
| This routine gets Baud Rate Prescaler value. More...
s32 | XCanPs_SetBitTiming (XCanPs *InstancePtr, u8 SyncJumpWidth, u8 TimeSegment2, u8 TimeSegment1)
| This routine sets Bit time. More...
void | XCanPs_GetBitTiming (XCanPs *InstancePtr, u8 *SyncJumpWidth, u8 *TimeSegment2, u8 *TimeSegment1)
| This routine gets Bit time. More...
s32 | XCanPs_SetRxIntrWatermark (XCanPs *InstancePtr, u8 Threshold)
| This routine sets the Rx Full threshold in the Watermark Interrupt Register. More...
u8 | XCanPs_GetRxIntrWatermark (XCanPs *InstancePtr)
| This routine gets the Rx Full threshold from the Watermark Interrupt Register. More...
s32 | XCanPs_SetTxIntrWatermark (XCanPs *InstancePtr, u8 Threshold)
| This routine sets the Tx Empty Threshold in the Watermark Interrupt Register. More...
u8 | XCanPs_GetTxIntrWatermark (XCanPs *InstancePtr)
| This routine gets the Tx Empty threshold from Watermark Interrupt Register. More...
s32 | XCanPs_SelfTest (XCanPs *InstancePtr)
| This function runs a self-test on the CAN driver/device. More...
void | XCanPs_IntrEnable (XCanPs *InstancePtr, u32 Mask)
| This routine enables interrupt(s). More...
void | XCanPs_IntrDisable (XCanPs *InstancePtr, u32 Mask)
| This routine disables interrupt(s). More...
u32 | XCanPs_IntrGetEnabled (XCanPs *InstancePtr)
| This routine returns enabled interrupt(s). More...
u32 | XCanPs_IntrGetStatus (XCanPs *InstancePtr)
| This routine returns interrupt status read from Interrupt Status Register. More...
void | XCanPs_IntrClear (XCanPs *InstancePtr, u32 Mask)
| This function clears interrupt(s). More...
void | XCanPs_IntrHandler (void *InstancePtr)
| This routine is the interrupt handler for the CAN driver. More...
s32 | XCanPs_SetHandler (XCanPs *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)
| This routine installs an asynchronous callback function for the given HandlerType: More...
XCanPs_Config * | XCanPs_LookupConfig (u16 DeviceId)
| This function looks for the device configuration based on the unique device ID. More...