]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/include/xcanps.h
Add in the CORTEX_A53_64-bit_UltraScale_MPSoC demo application (a demo has been inclu...
[freertos] / FreeRTOS / Demo / CORTEX_A53_64-bit_UltraScale_MPSoC / RTOSDemo_A53_bsp / psu_cortexa53_0 / include / xcanps.h
1 /******************************************************************************
2 *
3 * Copyright (C) 2010 - 2015 Xilinx, Inc.  All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
30 *
31 ******************************************************************************/
32 /*****************************************************************************/
33 /**
34 *
35 * @file xcanps.h
36 *
37 * The Xilinx CAN driver component.  This component supports the Xilinx
38 * CAN Controller.
39 *
40 * The CAN Controller supports the following features:
41 *       - Confirms to the ISO 11898-1, CAN 2.0A and CAN 2.0B standards.
42 *       - Supports both Standard (11 bit Identifier) and Extended (29 bit
43 *         Identifier) frames.
44 *       - Supports Bit Rates up to 1 Mbps.
45 *       - Transmit message object FIFO with a user configurable depth of
46 *         up to 64 message objects.
47 *       - Transmit prioritization through one TX High Priority Buffer.
48 *       - Receive message object FIFO with a user configurable depth of
49 *         up to 64 message objects.
50 *       - Watermark interrupts for Rx FIFO with configurable Watermark.
51 *       - Acceptance filtering with 4 acceptance filters.
52 *       - Sleep mode with automatic wake up.
53 *       - Loop Back mode for diagnostic applications.
54 *       - Snoop mode for diagnostic applications.
55 *       - Maskable Error and Status Interrupts.
56 *       - Readable Error Counters.
57 *       - External PHY chip required.
58 *       - Receive Timestamp.
59 *
60 * The device driver supports all the features listed above, if applicable.
61 *
62 * <b>Driver Description</b>
63 *
64 * The device driver enables higher layer software (e.g., an application) to
65 * communicate to the CAN. The driver handles transmission and reception of
66 * CAN frames, as well as configuration of the controller. The driver is simply a
67 * pass-through mechanism between a protocol stack and the CAN. A single device
68 * driver can support multiple CANs.
69 *
70 * Since the driver is a simple pass-through mechanism between a protocol stack
71 * and the CAN, no assembly or disassembly of CAN frames is done at the
72 * driver-level. This assumes that the protocol stack passes a correctly
73 * formatted CAN frame to the driver for transmission, and that the driver
74 * does not validate the contents of an incoming frame
75 *
76 * <b>Operation Modes</b>
77 *
78 * The CAN controller supports the following modes of operation:
79 *   - <b>Configuration Mode</b>: In this mode the CAN timing parameters and
80 *        Baud Rate Pre-scalar parameters can be changed. In this mode the CAN
81 *        controller loses synchronization with the CAN bus and drives a
82 *        constant recessive bit on the bus line. The Error Counter Register are
83 *        reset. The CAN controller does not receive or transmit any messages
84 *        even if there are pending transmit requests from the TX FIFO or the TX
85 *        High Priority Buffer. The Storage FIFOs and the CAN configuration
86 *        registers are still accessible.
87 *   - <b>Normal Mode</b>:In Normal Mode the CAN controller participates in bus
88 *        communication, by transmitting and receiving messages.
89 *   - <b>Sleep Mode</b>: In Sleep Mode the CAN Controller does not transmit any
90 *        messages. However, if any other node transmits a message, then the CAN
91 *        Controller receives the transmitted message and exits from Sleep Mode.
92 *        If there are new transmission requests from either the TX FIFO or the
93 *        TX High Priority Buffer when the CAN Controller is in Sleep Mode, these
94 *        requests are not serviced, and the CAN Controller continues to remain
95 *        in Sleep Mode. Interrupts are generated when the CAN controller enters
96 *       Sleep mode or Wakes up from Sleep mode.
97 *   - <b>Loop Back Mode</b>: In Loop Back mode, the CAN controller transmits a
98 *        recessive bit stream on to the CAN Bus. Any message that is transmitted
99 *        is looped back to the �Rx� line and acknowledged. The CAN controller
100 *        thus receives any message that it transmits. It does not participate in
101 *        normal bus communication and does not receive any messages that are
102 *        transmitted by other CAN nodes. This mode is used for diagnostic
103 *        purposes.
104 *   - <b>Snoop Mode</b>: In Snoop mode, the CAN controller transmits a
105 *        recessive bit stream on to the CAN Bus and does not participate
106 *        in normal bus communication but receives messages that are transmitted
107 *        by other CAN nodes. This mode is used for diagnostic purposes.
108 *
109 *
110 * <b>Buffer Alignment</b>
111 *
112 * It is important to note that frame buffers passed to the driver must be
113 * 32-bit aligned.
114 *
115 * <b>Receive Address Filtering</b>
116 *
117 * The device can be set to accept frames whose Identifiers match any of the
118 * 4 filters set in the Acceptance Filter Mask/ID registers.
119 *
120 * The incoming Identifier is masked with the bits in the Acceptance Filter Mask
121 * Register. This value is compared with the result of masking the bits in the
122 * Acceptance Filter ID Register with the Acceptance Filter Mask Register. If
123 * both these values are equal, the message will be stored in the RX FIFO.
124 *
125 * Acceptance Filtering is performed by each of the defined acceptance filters.
126 * If the incoming identifier passes through any acceptance filter then the
127 * frame is stored in the RX FIFO.
128 *
129 * If the Accpetance Filters are not set up then all the received messages are
130 * stroed in the RX FIFO.
131 *
132 * <b>PHY Communication</b>
133 *
134 * This driver does not provide any mechanism for directly programming PHY.
135 *
136 * <b>Interrupts</b>
137 *
138 * The driver has no dependencies on the interrupt controller. The driver
139 * provides an interrupt handler. User of this driver needs to provide
140 * callback functions. An interrupt handler example is available with
141 * the driver.
142 *
143 * <b>Threads</b>
144 *
145 * This driver is not thread safe.  Any needs for threads or thread mutual
146 * exclusion must be satisfied by the layer above this driver.
147 *
148 * <b>Device Reset</b>
149 *
150 * Bus Off interrupt that can occur in the device requires a device reset.
151 * The user is responsible for resetting the device and re-configuring it
152 * based on its needs (the driver does not save the current configuration).
153 * When integrating into an RTOS, these reset and re-configure obligations are
154 * taken care of by the OS adapter software if it exists for that RTOS.
155 *
156 * <b>Device Configuration</b>
157 *
158 * The device can be configured in various ways during the FPGA implementation
159 * process. Configuration parameters are stored in the xcanps_g.c files.
160 * A table is defined where each entry contains configuration information
161 * for a CAN device.  This information includes such things as the base address
162 * of the memory-mapped device.
163 *
164 * <b>Asserts</b>
165 *
166 * Asserts are used within all Xilinx drivers to enforce constraints on argument
167 * values. Asserts can be turned off on a system-wide basis by defining, at
168 * compile time, the NDEBUG identifier. By default, asserts are turned on and it
169 * is recommended that users leave asserts on during development.
170 *
171 * <b>Building the driver</b>
172 *
173 * The XCanPs driver is composed of several source files. This allows the user
174 * to build and link only those parts of the driver that are necessary.
175 * <br><br>
176 *
177 * <pre>
178 * MODIFICATION HISTORY:
179 *
180 * Ver   Who    Date     Changes
181 * ----- -----  -------- -----------------------------------------------
182 * 1.00a xd/sv  01/12/10 First release
183 * 1.01a bss    12/27/11 Added the APIs XCanPs_SetTxIntrWatermark and
184 *                       XCanPs_GetTxIntrWatermark.
185 *                       Updated the Register/bit definitions
186 *                       Changed XCANPS_RXFWIR_RXFLL_MASK to XCANPS_WIR_FW_MASK
187 *                       Changed XCANPS_RXWIR_OFFSET to XCANPS_WIR_OFFSET
188 *                       Added XCANPS_IXR_TXFEMP_MASK for Tx Fifo Empty
189 *                       Changed XCANPS_IXR_RXFLL_MASK to
190 *                       XCANPS_IXR_RXFWMFLL_MASK
191 *                       Changed
192 *                       XCANPS_TXBUF_ID_OFFSET to XCANPS_TXHPB_ID_OFFSET
193 *                       XCANPS_TXBUF_DLC_OFFSET to XCANPS_TXHPB_DLC_OFFSET
194 *                       XCANPS_TXBUF_DW1_OFFSET to XCANPS_TXHPB_DW1_OFFSET
195 *                       XCANPS_TXBUF_DW2_OFFSET to XCANPS_TXHPB_DW2_OFFSET
196 * 2.1 adk               23/08/14 Fixed CR:798792 Peripheral test for CANPS IP in
197 *                       SDK claims a 40kbps baud rate but it's not.
198 * 3.0 adk     09/12/14  Added support for Zynq Ultrascale Mp.Also code
199 *                       modified for MISRA-C:2012 compliance.
200 * </pre>
201 *
202 ******************************************************************************/
203 #ifndef XCANPS_H                        /* prevent circular inclusions */
204 #define XCANPS_H                        /* by using protection macros */
205
206 #ifdef __cplusplus
207 extern "C" {
208 #endif
209
210 /***************************** Include Files *********************************/
211
212 #include "xstatus.h"
213 #include "xcanps_hw.h"
214 #include "xil_types.h"
215
216 /************************** Constant Definitions *****************************/
217
218 /** @name CAN operation modes
219  *  @{
220  */
221 #define XCANPS_MODE_CONFIG      0x00000001U /**< Configuration mode */
222 #define XCANPS_MODE_NORMAL      0x00000002U /**< Normal mode */
223 #define XCANPS_MODE_LOOPBACK    0x00000004U /**< Loop Back mode */
224 #define XCANPS_MODE_SLEEP       0x00000008U /**< Sleep mode */
225 #define XCANPS_MODE_SNOOP       0x00000010U /**< Snoop mode */
226 /* @} */
227
228 /** @name Callback identifiers used as parameters to XCanPs_SetHandler()
229  *  @{
230  */
231 #define XCANPS_HANDLER_SEND 1U /**< Handler type for frame sending interrupt */
232 #define XCANPS_HANDLER_RECV 2U /**< Handler type for frame reception interrupt*/
233 #define XCANPS_HANDLER_ERROR  3U /**< Handler type for error interrupt */
234 #define XCANPS_HANDLER_EVENT  4U /**< Handler type for all other interrupts */
235 /* @} */
236
237 /**************************** Type Definitions *******************************/
238
239 /**
240  * This typedef contains configuration information for a device.
241  */
242 typedef struct {
243         u16 DeviceId;           /**< Unique ID of device */
244         u32 BaseAddr;           /**< Register base address */
245 } XCanPs_Config;
246
247 /******************************************************************************/
248 /**
249  * Callback type for frame sending and reception interrupts.
250  *
251  * @param       CallBackRef is a callback reference passed in by the upper layer
252  *              when setting the callback functions, and passed back to the
253  *              upper layer when the callback is invoked.
254 *******************************************************************************/
255 typedef void (*XCanPs_SendRecvHandler) (void *CallBackRef);
256
257 /******************************************************************************/
258 /**
259  * Callback type for error interrupt.
260  *
261  * @param       CallBackRef is a callback reference passed in by the upper layer
262  *              when setting the callback functions, and passed back to the
263  *              upper layer when the callback is invoked.
264  * @param       ErrorMask is a bit mask indicating the cause of the error. Its
265  *              value equals 'OR'ing one or more XCANPS_ESR_* values defined in
266  *              xcanps_hw.h
267 *******************************************************************************/
268 typedef void (*XCanPs_ErrorHandler) (void *CallBackRef, u32 ErrorMask);
269
270 /******************************************************************************/
271 /**
272  * Callback type for all kinds of interrupts except sending frame interrupt,
273  * receiving frame interrupt, and error interrupt.
274  *
275  * @param       CallBackRef is a callback reference passed in by the upper layer
276  *              when setting the callback functions, and passed back to the
277  *              upper layer when the callback is invoked.
278  * @param       Mask is a bit mask indicating the pending interrupts. Its value
279  *              equals 'OR'ing one or more XCANPS_IXR_* defined in xcanps_hw.h
280 *******************************************************************************/
281 typedef void (*XCanPs_EventHandler) (void *CallBackRef, u32 Mask);
282
283 /**
284  * The XCanPs driver instance data. The user is required to allocate a
285  * variable of this type for every CAN device in the system. A pointer
286  * to a variable of this type is then passed to the driver API functions.
287  */
288 typedef struct {
289         XCanPs_Config CanConfig;        /**< Device configuration */
290         u32 IsReady;                    /**< Device is initialized and ready */
291
292         /**
293          * Callback and callback reference for TXOK interrupt.
294          */
295         XCanPs_SendRecvHandler SendHandler;
296         void *SendRef;
297
298         /**
299          * Callback and callback reference for RXOK/RXNEMP/RXFLL interrupts.
300          */
301         XCanPs_SendRecvHandler RecvHandler;
302         void *RecvRef;
303
304         /**
305          * Callback and callback reference for ERROR interrupt.
306          */
307         XCanPs_ErrorHandler ErrorHandler;
308         void *ErrorRef;
309
310         /**
311          * Callback  and callback reference for RXOFLW/RXUFLW/TXBFLL/TXFLL/
312          * Wakeup/Sleep/Bus off/ARBLST interrupts.
313          */
314         XCanPs_EventHandler EventHandler;
315         void *EventRef;
316
317 } XCanPs;
318
319
320 /***************** Macros (Inline Functions) Definitions *********************/
321
322 /****************************************************************************/
323 /**
324 *
325 * This macro checks if the transmission is complete.
326 *
327 * @param        InstancePtr is a pointer to the XCanPs instance.
328 *
329 * @return
330 *               - TRUE if the transmission is done.
331 *               - FALSE if the transmission is not done.
332 *
333 * @note         C-Style signature:
334 *               int XCanPs_IsTxDone(XCanPs *InstancePtr)
335 *
336 *******************************************************************************/
337 #define XCanPs_IsTxDone(InstancePtr) \
338         (((XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),          \
339                 XCANPS_ISR_OFFSET) & XCANPS_IXR_TXOK_MASK) != (u32)0) ? TRUE : FALSE)
340
341
342 /****************************************************************************/
343 /**
344 *
345 * This macro checks if the transmission FIFO is full.
346 *
347 * @param        InstancePtr is a pointer to the XCanPs instance.
348 *
349 * @return
350 *               - TRUE if TX FIFO is full.
351 *               - FALSE if the TX FIFO is NOT full.
352 *
353 * @note         C-Style signature:
354 *               int XCanPs_IsTxFifoFull(XCanPs *InstancePtr)
355 *
356 *****************************************************************************/
357 #define XCanPs_IsTxFifoFull(InstancePtr) \
358         (((XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),  \
359                 XCANPS_SR_OFFSET) & XCANPS_SR_TXFLL_MASK) != (u32)0) ? TRUE : FALSE)
360
361
362 /****************************************************************************/
363 /**
364 *
365 * This macro checks if the Transmission High Priority Buffer is full.
366 *
367 * @param        InstancePtr is a pointer to the XCanPs instance.
368 *
369 * @return
370 *               - TRUE if the TX High Priority Buffer is full.
371 *               - FALSE if the TX High Priority Buffer is NOT full.
372 *
373 * @note         C-Style signature:
374 *               int XCanPs_IsHighPriorityBufFull(XCanPs *InstancePtr)
375 *
376 *****************************************************************************/
377 #define XCanPs_IsHighPriorityBufFull(InstancePtr) \
378         (((XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),  \
379                 XCANPS_SR_OFFSET) & XCANPS_SR_TXBFLL_MASK) != (u32)0) ? TRUE : FALSE)
380
381
382 /****************************************************************************/
383 /**
384 *
385 * This macro checks if the receive FIFO is empty.
386 *
387 * @param        InstancePtr is a pointer to the XCanPs instance.
388 *
389 * @return
390 *               - TRUE if RX FIFO is empty.
391 *               - FALSE if the RX FIFO is NOT empty.
392 *
393 * @note         C-Style signature:
394 *               int XCanPs_IsRxEmpty(XCanPs *InstancePtr)
395 *
396 *****************************************************************************/
397 #define XCanPs_IsRxEmpty(InstancePtr) \
398         (((XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),  \
399                 XCANPS_ISR_OFFSET) & XCANPS_IXR_RXNEMP_MASK) != (u32)0) ? FALSE : TRUE)
400
401
402 /****************************************************************************/
403 /**
404 *
405 * This macro checks if the CAN device is ready for the driver to change
406 * Acceptance Filter Identifier Registers (AFIR) and Acceptance Filter Mask
407 * Registers (AFMR).
408 *
409 * AFIR and AFMR for a filter are changeable only after the filter is disabled
410 * and this routine returns FALSE. The filter can be disabled using the
411 * XCanPs_AcceptFilterDisable function.
412 *
413 * Use the XCanPs_Accept_* functions for configuring the acceptance filters.
414 *
415 * @param        InstancePtr is a pointer to the XCanPs instance.
416 *
417 * @return
418 *               - TRUE if the device is busy and NOT ready to accept writes to
419 *               AFIR and AFMR.
420 *               - FALSE if the device is ready to accept writes to AFIR and
421 *               AFMR.
422 *
423 * @note         C-Style signature:
424 *               int XCanPs_IsAcceptFilterBusy(XCanPs *InstancePtr)
425 *
426 *****************************************************************************/
427 #define XCanPs_IsAcceptFilterBusy(InstancePtr)          \
428         (((XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),  \
429                 XCANPS_SR_OFFSET) & XCANPS_SR_ACFBSY_MASK) != (u32)0) ? TRUE : FALSE)
430
431
432 /****************************************************************************/
433 /**
434 *
435 * This macro calculates CAN message identifier value given identifier field
436 * values.
437 *
438 * @param        StandardId contains Standard Message ID value.
439 * @param        SubRemoteTransReq contains Substitute Remote Transmission
440 *               Request value.
441 * @param        IdExtension contains Identifier Extension value.
442 * @param        ExtendedId contains Extended Message ID value.
443 * @param        RemoteTransReq contains Remote Transmission Request value.
444 *
445 * @return       Message Identifier value.
446 *
447 * @note         C-Style signature:
448 *               u32 XCanPs_CreateIdValue(u32 StandardId,
449 *                                       u32 SubRemoteTransReq,
450 *                                       u32 IdExtension, u32 ExtendedId,
451 *                                       u32 RemoteTransReq)
452 *
453 *               Read the CAN specification for meaning of each parameter.
454 *
455 *****************************************************************************/
456 #define XCanPs_CreateIdValue(StandardId, SubRemoteTransReq, IdExtension, \
457                 ExtendedId, RemoteTransReq)                             \
458  ((((StandardId) << XCANPS_IDR_ID1_SHIFT) & XCANPS_IDR_ID1_MASK) |      \
459  (((SubRemoteTransReq) << XCANPS_IDR_SRR_SHIFT) & XCANPS_IDR_SRR_MASK)|\
460  (((IdExtension) << XCANPS_IDR_IDE_SHIFT) & XCANPS_IDR_IDE_MASK) |      \
461  (((ExtendedId) << XCANPS_IDR_ID2_SHIFT) & XCANPS_IDR_ID2_MASK) |       \
462  ((RemoteTransReq) & XCANPS_IDR_RTR_MASK))
463
464
465 /****************************************************************************/
466 /**
467 *
468 * This macro calculates value for Data Length Code register given Data
469 * Length Code value.
470 *
471 * @param        DataLengCode indicates Data Length Code value.
472 *
473 * @return       Value that can be assigned to Data Length Code register.
474 *
475 * @note         C-Style signature:
476 *               u32 XCanPs_CreateDlcValue(u32 DataLengCode)
477 *
478 *               Read the CAN specification for meaning of Data Length Code.
479 *
480 *****************************************************************************/
481 #define XCanPs_CreateDlcValue(DataLengCode) \
482         (((DataLengCode) << XCANPS_DLCR_DLC_SHIFT) & XCANPS_DLCR_DLC_MASK)
483
484
485 /****************************************************************************/
486 /**
487 *
488 * This macro clears the timestamp in the Timestamp Control Register.
489 *
490 * @param        InstancePtr is a pointer to the XCanPs instance.
491 *
492 * @return       None.
493 *
494 * @note         C-Style signature:
495 *               void XCanPs_ClearTimestamp(XCanPs *InstancePtr)
496 *
497 *****************************************************************************/
498 #define XCanPs_ClearTimestamp(InstancePtr)                      \
499         XCanPs_WriteReg((InstancePtr)->CanConfig.BaseAddr,              \
500                                 XCANPS_TCR_OFFSET, XCANPS_TCR_CTS_MASK)
501
502 /************************** Function Prototypes ******************************/
503
504 /*
505  * Functions in xcanps.c
506  */
507 s32 XCanPs_CfgInitialize(XCanPs *InstancePtr, XCanPs_Config *ConfigPtr,
508                                 u32 EffectiveAddr);
509
510 void XCanPs_Reset(XCanPs *InstancePtr);
511 u8 XCanPs_GetMode(XCanPs *InstancePtr);
512 void XCanPs_EnterMode(XCanPs *InstancePtr, u8 OperationMode);
513 u32 XCanPs_GetStatus(XCanPs *InstancePtr);
514 void XCanPs_GetBusErrorCounter(XCanPs *InstancePtr, u8 *RxErrorCount,
515                                  u8 *TxErrorCount);
516 u32 XCanPs_GetBusErrorStatus(XCanPs *InstancePtr);
517 void XCanPs_ClearBusErrorStatus(XCanPs *InstancePtr, u32 Mask);
518 s32 XCanPs_Send(XCanPs *InstancePtr, u32 *FramePtr);
519 s32 XCanPs_Recv(XCanPs *InstancePtr, u32 *FramePtr);
520 s32 XCanPs_SendHighPriority(XCanPs *InstancePtr, u32 *FramePtr);
521 void XCanPs_AcceptFilterEnable(XCanPs *InstancePtr, u32 FilterIndexes);
522 void XCanPs_AcceptFilterDisable(XCanPs *InstancePtr, u32 FilterIndexes);
523 u32 XCanPs_AcceptFilterGetEnabled(XCanPs *InstancePtr);
524 s32 XCanPs_AcceptFilterSet(XCanPs *InstancePtr, u32 FilterIndex,
525                          u32 MaskValue, u32 IdValue);
526 void XCanPs_AcceptFilterGet(XCanPs *InstancePtr, u32 FilterIndex,
527                           u32 *MaskValue, u32 *IdValue);
528
529 s32 XCanPs_SetBaudRatePrescaler(XCanPs *InstancePtr, u8 Prescaler);
530 u8 XCanPs_GetBaudRatePrescaler(XCanPs *InstancePtr);
531 s32 XCanPs_SetBitTiming(XCanPs *InstancePtr, u8 SyncJumpWidth,
532                           u8 TimeSegment2, u8 TimeSegment1);
533 void XCanPs_GetBitTiming(XCanPs *InstancePtr, u8 *SyncJumpWidth,
534                            u8 *TimeSegment2, u8 *TimeSegment1);
535
536 s32 XCanPs_SetRxIntrWatermark(XCanPs *InstancePtr, u8 Threshold);
537 u8 XCanPs_GetRxIntrWatermark(XCanPs *InstancePtr);
538 s32 XCanPs_SetTxIntrWatermark(XCanPs *InstancePtr, u8 Threshold);
539 u8 XCanPs_GetTxIntrWatermark(XCanPs *InstancePtr);
540
541 /*
542  * Diagnostic functions in xcanps_selftest.c
543  */
544 s32 XCanPs_SelfTest(XCanPs *InstancePtr);
545
546 /*
547  * Functions in xcanps_intr.c
548  */
549 void XCanPs_IntrEnable(XCanPs *InstancePtr, u32 Mask);
550 void XCanPs_IntrDisable(XCanPs *InstancePtr, u32 Mask);
551 u32 XCanPs_IntrGetEnabled(XCanPs *InstancePtr);
552 u32 XCanPs_IntrGetStatus(XCanPs *InstancePtr);
553 void XCanPs_IntrClear(XCanPs *InstancePtr, u32 Mask);
554 void XCanPs_IntrHandler(void *InstancePtr);
555 s32 XCanPs_SetHandler(XCanPs *InstancePtr, u32 HandlerType,
556                         void *CallBackFunc, void *CallBackRef);
557
558 /*
559  * Functions in xcanps_sinit.c
560  */
561 XCanPs_Config *XCanPs_LookupConfig(u16 DeviceId);
562
563 #ifdef __cplusplus
564 }
565 #endif
566
567 #endif /* end of protection macro */