2 * @brief CAN Driver Header File
9 * - Interface Prototypes
11 * which are relevant for the CAN driver.
14 /* (c) Texas Instruments 2009-2012, All rights reserved. */
21 /* USER CODE BEGIN (0) */
25 /* CAN General Definitions */
27 /** @def canLEVEL_ACTIVE
28 * @brief Alias name for CAN error operation level active (Error couter 0-95)
30 #define canLEVEL_ACTIVE 0x00U
32 /** @def canLEVEL_WARNING
33 * @brief Alias name for CAN error operation level warning (Error couter 96-127)
35 #define canLEVEL_WARNING 0x40U
37 /** @def canLEVEL_PASSIVE
38 * @brief Alias name for CAN error operation level passive (Error couter 128-255)
40 #define canLEVEL_PASSIVE 0x20U
42 /** @def canLEVEL_BUS_OFF
43 * @brief Alias name for CAN error operation level bus off (Error couter 256)
45 #define canLEVEL_BUS_OFF 0x80U
48 * @brief Alias name for no CAN error occured
50 #define canERROR_OK 0U
52 /** @def canERROR_STUFF
53 * @brief Alias name for CAN stuff error an RX message
55 #define canERROR_STUFF 1U
57 /** @def canERROR_FORMAT
58 * @brief Alias name for CAN form/format error an RX message
60 #define canERROR_FORMAT 2U
62 /** @def canERROR_ACKNOWLEDGE
63 * @brief Alias name for CAN TX message wasn't acknowledged
65 #define canERROR_ACKNOWLEDGE 3U
67 /** @def canERROR_BIT1
68 * @brief Alias name for CAN TX message sendig recessive level but monitoring dominant
70 #define canERROR_BIT1 4U
72 /** @def canERROR_BIT0
73 * @brief Alias name for CAN TX message sendig dominant level but monitoring recessive
75 #define canERROR_BIT0 5U
78 * @brief Alias name for CAN RX message received wrong CRC
80 #define canERROR_CRC 6U
83 * @brief Alias name for CAN no message has send or received sinced last call of CANGetLastError
85 #define canERROR_NO 7U
87 /** @def canMESSAGE_BOX1
88 * @brief Alias name for CAN message box 1
90 * @note This value should be used for API argument @a messageBox
92 #define canMESSAGE_BOX1 1U
94 /** @def canMESSAGE_BOX2
95 * @brief Alias name for CAN message box 2
97 * @note This value should be used for API argument @a messageBox
99 #define canMESSAGE_BOX2 2U
101 /** @def canMESSAGE_BOX3
102 * @brief Alias name for CAN message box 3
104 * @note This value should be used for API argument @a messageBox
106 #define canMESSAGE_BOX3 3U
108 /** @def canMESSAGE_BOX4
109 * @brief Alias name for CAN message box 4
111 * @note This value should be used for API argument @a messageBox
113 #define canMESSAGE_BOX4 4U
115 /** @def canMESSAGE_BOX5
116 * @brief Alias name for CAN message box 5
118 * @note This value should be used for API argument @a messageBox
120 #define canMESSAGE_BOX5 5U
122 /** @def canMESSAGE_BOX6
123 * @brief Alias name for CAN message box 6
125 * @note This value should be used for API argument @a messageBox
127 #define canMESSAGE_BOX6 6U
129 /** @def canMESSAGE_BOX7
130 * @brief Alias name for CAN message box 7
132 * @note This value should be used for API argument @a messageBox
134 #define canMESSAGE_BOX7 7U
136 /** @def canMESSAGE_BOX8
137 * @brief Alias name for CAN message box 8
139 * @note This value should be used for API argument @a messageBox
141 #define canMESSAGE_BOX8 8U
143 /** @def canMESSAGE_BOX9
144 * @brief Alias name for CAN message box 9
146 * @note This value should be used for API argument @a messageBox
148 #define canMESSAGE_BOX9 9U
150 /** @def canMESSAGE_BOX10
151 * @brief Alias name for CAN message box 10
153 * @note This value should be used for API argument @a messageBox
155 #define canMESSAGE_BOX10 10U
157 /** @def canMESSAGE_BOX11
158 * @brief Alias name for CAN message box 11
160 * @note This value should be used for API argument @a messageBox
162 #define canMESSAGE_BOX11 11U
164 /** @def canMESSAGE_BOX12
165 * @brief Alias name for CAN message box 12
167 * @note This value should be used for API argument @a messageBox
169 #define canMESSAGE_BOX12 12U
171 /** @def canMESSAGE_BOX13
172 * @brief Alias name for CAN message box 13
174 * @note This value should be used for API argument @a messageBox
176 #define canMESSAGE_BOX13 13U
178 /** @def canMESSAGE_BOX14
179 * @brief Alias name for CAN message box 14
181 * @note This value should be used for API argument @a messageBox
183 #define canMESSAGE_BOX14 14U
185 /** @def canMESSAGE_BOX15
186 * @brief Alias name for CAN message box 15
188 * @note This value should be used for API argument @a messageBox
190 #define canMESSAGE_BOX15 15U
192 /** @def canMESSAGE_BOX16
193 * @brief Alias name for CAN message box 16
195 * @note This value should be used for API argument @a messageBox
197 #define canMESSAGE_BOX16 16U
199 /** @def canMESSAGE_BOX17
200 * @brief Alias name for CAN message box 17
202 * @note This value should be used for API argument @a messageBox
204 #define canMESSAGE_BOX17 17U
206 /** @def canMESSAGE_BOX18
207 * @brief Alias name for CAN message box 18
209 * @note This value should be used for API argument @a messageBox
211 #define canMESSAGE_BOX18 18U
213 /** @def canMESSAGE_BOX19
214 * @brief Alias name for CAN message box 19
216 * @note This value should be used for API argument @a messageBox
218 #define canMESSAGE_BOX19 19U
220 /** @def canMESSAGE_BOX20
221 * @brief Alias name for CAN message box 20
223 * @note This value should be used for API argument @a messageBox
225 #define canMESSAGE_BOX20 20U
227 /** @def canMESSAGE_BOX21
228 * @brief Alias name for CAN message box 21
230 * @note This value should be used for API argument @a messageBox
232 #define canMESSAGE_BOX21 21U
234 /** @def canMESSAGE_BOX22
235 * @brief Alias name for CAN message box 22
237 * @note This value should be used for API argument @a messageBox
239 #define canMESSAGE_BOX22 22U
241 /** @def canMESSAGE_BOX23
242 * @brief Alias name for CAN message box 23
244 * @note This value should be used for API argument @a messageBox
246 #define canMESSAGE_BOX23 23U
248 /** @def canMESSAGE_BOX24
249 * @brief Alias name for CAN message box 24
251 * @note This value should be used for API argument @a messageBox
253 #define canMESSAGE_BOX24 24U
255 /** @def canMESSAGE_BOX25
256 * @brief Alias name for CAN message box 25
258 * @note This value should be used for API argument @a messageBox
260 #define canMESSAGE_BOX25 25U
262 /** @def canMESSAGE_BOX26
263 * @brief Alias name for CAN message box 26
265 * @note This value should be used for API argument @a messageBox
267 #define canMESSAGE_BOX26 26U
269 /** @def canMESSAGE_BOX27
270 * @brief Alias name for CAN message box 27
272 * @note This value should be used for API argument @a messageBox
274 #define canMESSAGE_BOX27 27U
276 /** @def canMESSAGE_BOX28
277 * @brief Alias name for CAN message box 28
279 * @note This value should be used for API argument @a messageBox
281 #define canMESSAGE_BOX28 28U
283 /** @def canMESSAGE_BOX29
284 * @brief Alias name for CAN message box 29
286 * @note This value should be used for API argument @a messageBox
288 #define canMESSAGE_BOX29 29U
290 /** @def canMESSAGE_BOX30
291 * @brief Alias name for CAN message box 30
293 * @note This value should be used for API argument @a messageBox
295 #define canMESSAGE_BOX30 30U
297 /** @def canMESSAGE_BOX31
298 * @brief Alias name for CAN message box 31
300 * @note This value should be used for API argument @a messageBox
302 #define canMESSAGE_BOX31 31U
304 /** @def canMESSAGE_BOX32
305 * @brief Alias name for CAN message box 32
307 * @note This value should be used for API argument @a messageBox
309 #define canMESSAGE_BOX32 32U
311 /** @def canMESSAGE_BOX33
312 * @brief Alias name for CAN message box 33
314 * @note This value should be used for API argument @a messageBox
316 #define canMESSAGE_BOX33 33U
318 /** @def canMESSAGE_BOX34
319 * @brief Alias name for CAN message box 34
321 * @note This value should be used for API argument @a messageBox
323 #define canMESSAGE_BOX34 34U
325 /** @def canMESSAGE_BOX35
326 * @brief Alias name for CAN message box 35
328 * @note This value should be used for API argument @a messageBox
330 #define canMESSAGE_BOX35 35U
332 /** @def canMESSAGE_BOX36
333 * @brief Alias name for CAN message box 36
335 * @note This value should be used for API argument @a messageBox
337 #define canMESSAGE_BOX36 36U
339 /** @def canMESSAGE_BOX37
340 * @brief Alias name for CAN message box 37
342 * @note This value should be used for API argument @a messageBox
344 #define canMESSAGE_BOX37 37U
346 /** @def canMESSAGE_BOX38
347 * @brief Alias name for CAN message box 38
349 * @note This value should be used for API argument @a messageBox
351 #define canMESSAGE_BOX38 38U
353 /** @def canMESSAGE_BOX39
354 * @brief Alias name for CAN message box 39
356 * @note This value should be used for API argument @a messageBox
358 #define canMESSAGE_BOX39 39U
360 /** @def canMESSAGE_BOX40
361 * @brief Alias name for CAN message box 40
363 * @note This value should be used for API argument @a messageBox
365 #define canMESSAGE_BOX40 40U
367 /** @def canMESSAGE_BOX41
368 * @brief Alias name for CAN message box 41
370 * @note This value should be used for API argument @a messageBox
372 #define canMESSAGE_BOX41 41U
374 /** @def canMESSAGE_BOX42
375 * @brief Alias name for CAN message box 42
377 * @note This value should be used for API argument @a messageBox
379 #define canMESSAGE_BOX42 42U
381 /** @def canMESSAGE_BOX43
382 * @brief Alias name for CAN message box 43
384 * @note This value should be used for API argument @a messageBox
386 #define canMESSAGE_BOX43 43U
388 /** @def canMESSAGE_BOX44
389 * @brief Alias name for CAN message box 44
391 * @note This value should be used for API argument @a messageBox
393 #define canMESSAGE_BOX44 44U
395 /** @def canMESSAGE_BOX45
396 * @brief Alias name for CAN message box 45
398 * @note This value should be used for API argument @a messageBox
400 #define canMESSAGE_BOX45 45U
402 /** @def canMESSAGE_BOX46
403 * @brief Alias name for CAN message box 46
405 * @note This value should be used for API argument @a messageBox
407 #define canMESSAGE_BOX46 46U
409 /** @def canMESSAGE_BOX47
410 * @brief Alias name for CAN message box 47
412 * @note This value should be used for API argument @a messageBox
414 #define canMESSAGE_BOX47 47U
416 /** @def canMESSAGE_BOX48
417 * @brief Alias name for CAN message box 48
419 * @note This value should be used for API argument @a messageBox
421 #define canMESSAGE_BOX48 48U
423 /** @def canMESSAGE_BOX49
424 * @brief Alias name for CAN message box 49
426 * @note This value should be used for API argument @a messageBox
428 #define canMESSAGE_BOX49 49U
430 /** @def canMESSAGE_BOX50
431 * @brief Alias name for CAN message box 50
433 * @note This value should be used for API argument @a messageBox
435 #define canMESSAGE_BOX50 50U
437 /** @def canMESSAGE_BOX51
438 * @brief Alias name for CAN message box 51
440 * @note This value should be used for API argument @a messageBox
442 #define canMESSAGE_BOX51 51U
444 /** @def canMESSAGE_BOX52
445 * @brief Alias name for CAN message box 52
447 * @note This value should be used for API argument @a messageBox
449 #define canMESSAGE_BOX52 52U
451 /** @def canMESSAGE_BOX53
452 * @brief Alias name for CAN message box 53
454 * @note This value should be used for API argument @a messageBox
456 #define canMESSAGE_BOX53 53U
458 /** @def canMESSAGE_BOX54
459 * @brief Alias name for CAN message box 54
461 * @note This value should be used for API argument @a messageBox
463 #define canMESSAGE_BOX54 54U
465 /** @def canMESSAGE_BOX55
466 * @brief Alias name for CAN message box 55
468 * @note This value should be used for API argument @a messageBox
470 #define canMESSAGE_BOX55 55U
472 /** @def canMESSAGE_BOX56
473 * @brief Alias name for CAN message box 56
475 * @note This value should be used for API argument @a messageBox
477 #define canMESSAGE_BOX56 56U
479 /** @def canMESSAGE_BOX57
480 * @brief Alias name for CAN message box 57
482 * @note This value should be used for API argument @a messageBox
484 #define canMESSAGE_BOX57 57U
486 /** @def canMESSAGE_BOX58
487 * @brief Alias name for CAN message box 58
489 * @note This value should be used for API argument @a messageBox
491 #define canMESSAGE_BOX58 58U
493 /** @def canMESSAGE_BOX59
494 * @brief Alias name for CAN message box 59
496 * @note This value should be used for API argument @a messageBox
498 #define canMESSAGE_BOX59 59U
500 /** @def canMESSAGE_BOX60
501 * @brief Alias name for CAN message box 60
503 * @note This value should be used for API argument @a messageBox
505 #define canMESSAGE_BOX60 60U
507 /** @def canMESSAGE_BOX61
508 * @brief Alias name for CAN message box 61
510 * @note This value should be used for API argument @a messageBox
512 #define canMESSAGE_BOX61 61U
514 /** @def canMESSAGE_BOX62
515 * @brief Alias name for CAN message box 62
517 * @note This value should be used for API argument @a messageBox
519 #define canMESSAGE_BOX62 62U
521 /** @def canMESSAGE_BOX63
522 * @brief Alias name for CAN message box 63
524 * @note This value should be used for API argument @a messageBox
526 #define canMESSAGE_BOX63 63U
528 /** @def canMESSAGE_BOX64
529 * @brief Alias name for CAN message box 64
531 * @note This value should be used for API argument @a messageBox
533 #define canMESSAGE_BOX64 64U
535 /* USER CODE BEGIN (1) */
540 * @brief CAN Register Frame Definition
542 * This type is used to access the CAN Registers.
544 /** @typedef canBASE_t
545 * @brief CAN Register Frame Type Definition
547 * This type is used to access the CAN Registers.
549 typedef volatile struct CANBase
551 uint32_t CTL; /**< 0x0000: Control Register */
552 uint32_t ES; /**< 0x0004: Error and Status Register */
553 uint32_t EERC; /**< 0x0008: Error Counter Register */
554 uint32_t BTR; /**< 0x000C: Bit Timing Register */
555 uint32_t INT; /**< 0x0010: Interrupt Register */
556 uint32_t TEST; /**< 0x0014: Test Register */
557 uint32_t : 32U; /**< 0x0018: Reserved */
558 uint32_t PERR; /**< 0x001C: Parity/SECDED Error Code Register */
559 uint32_t REL; /**< 0x0020: Core Release Register */
560 uint32_t ECCDIAG; /**< 0x0024: ECC Diagnostic Register */
561 uint32_t ECCDIADSTAT; /**< 0x0028: ECC Diagnostic Status Register */
562 uint32_t : 32U; /**< 0x002C: Reserved */
563 uint32_t : 32U; /**< 0x0030: Reserved */
564 uint32_t : 32U; /**< 0x0034: Reserved */
565 uint32_t : 32U; /**< 0x0038: Reserved */
566 uint32_t : 32U; /**< 0x003C: Reserved */
567 uint32_t : 32U; /**< 0x0040: Reserved */
568 uint32_t : 32U; /**< 0x0044: Reserved */
569 uint32_t : 32U; /**< 0x0048: Reserved */
570 uint32_t : 32U; /**< 0x004C: Reserved */
571 uint32_t : 32U; /**< 0x0050: Reserved */
572 uint32_t : 32U; /**< 0x0054: Reserved */
573 uint32_t : 32U; /**< 0x0058: Reserved */
574 uint32_t : 32U; /**< 0x005C: Reserved */
575 uint32_t : 32U; /**< 0x0060: Reserved */
576 uint32_t : 32U; /**< 0x0064: Reserved */
577 uint32_t : 32U; /**< 0x0068: Reserved */
578 uint32_t : 32U; /**< 0x006C: Reserved */
579 uint32_t : 32U; /**< 0x0070: Reserved */
580 uint32_t : 32U; /**< 0x0074: Reserved */
581 uint32_t : 32U; /**< 0x0078: Reserved */
582 uint32_t : 32U; /**< 0x007C: Reserved */
583 uint32_t ABOTR; /**< 0x0080: Auto Bus On Time Register */
584 uint32_t TXRQX; /**< 0x0084: Transmission Request X Register */
585 uint32_t TXRQx[4U]; /**< 0x0088-0x0094: Transmission Request Registers */
586 uint32_t NWDATX; /**< 0x0098: New Data X Register */
587 uint32_t NWDATx[4U]; /**< 0x009C-0x00A8: New Data Registers */
588 uint32_t INTPNDX; /**< 0x00AC: Interrupt Pending X Register */
589 uint32_t INTPNDx[4U]; /**< 0x00B0-0x00BC: Interrupt Pending Registers */
590 uint32_t MSGVALX; /**< 0x00C0: Message Valid X Register */
591 uint32_t MSGVALx[4U]; /**< 0x00C4-0x00D0: Message Valid Registers */
592 uint32_t : 32U; /**< 0x00D4: Reserved */
593 uint32_t INTMUXx[4U]; /**< 0x00D8-0x00E4: Interrupt Multiplexer Registers */
594 uint32_t : 32U; /**< 0x00E8: Reserved */
595 uint32_t : 32U; /**< 0x00EC: Reserved */
596 uint32_t : 32U; /**< 0x00F0: Reserved */
597 uint32_t : 32U; /**< 0x00F4: Reserved */
598 uint32_t : 32U; /**< 0x00F8: Reserved */
599 uint32_t : 32U; /**< 0x00FC: Reserved */
600 #if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1))
601 uint8_t IF1NO; /**< 0x0100: IF1 Command Register, Msg Number */
602 uint8_t IF1STAT; /**< 0x0100: IF1 Command Register, Status */
603 uint8_t IF1CMD; /**< 0x0100: IF1 Command Register, Command */
604 uint32_t : 8U; /**< 0x0100: IF1 Command Register, Reserved */
606 uint32_t : 8U; /**< 0x0100: IF1 Command Register, Reserved */
607 uint8_t IF1CMD; /**< 0x0100: IF1 Command Register, Command */
608 uint8_t IF1STAT; /**< 0x0100: IF1 Command Register, Status */
609 uint8_t IF1NO; /**< 0x0100: IF1 Command Register, Msg Number */
611 uint32_t IF1MSK; /**< 0x0104: IF1 Mask Register */
612 uint32_t IF1ARB; /**< 0x0108: IF1 Arbitration Register */
613 uint32_t IF1MCTL; /**< 0x010C: IF1 Message Control Register */
614 uint8_t IF1DATx[8U]; /**< 0x0110-0x0114: IF1 Data A and B Registers */
615 uint32_t : 32U; /**< 0x0118: Reserved */
616 uint32_t : 32U; /**< 0x011C: Reserved */
617 #if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1))
618 uint8_t IF2NO; /**< 0x0120: IF2 Command Register, Msg No */
619 uint8_t IF2STAT; /**< 0x0120: IF2 Command Register, Status */
620 uint8_t IF2CMD; /**< 0x0120: IF2 Command Register, Command */
621 uint32_t : 8U; /**< 0x0120: IF2 Command Register, Reserved */
623 uint32_t : 8U; /**< 0x0120: IF2 Command Register, Reserved */
624 uint8_t IF2CMD; /**< 0x0120: IF2 Command Register, Command */
625 uint8_t IF2STAT; /**< 0x0120: IF2 Command Register, Status */
626 uint8_t IF2NO; /**< 0x0120: IF2 Command Register, Msg Number */
628 uint32_t IF2MSK; /**< 0x0124: IF2 Mask Register */
629 uint32_t IF2ARB; /**< 0x0128: IF2 Arbitration Register */
630 uint32_t IF2MCTL; /**< 0x012C: IF2 Message Control Register */
631 uint8_t IF2DATx[8U]; /**< 0x0130-0x0134: IF2 Data A and B Registers */
632 uint32_t : 32U; /**< 0x0138: Reserved */
633 uint32_t : 32U; /**< 0x013C: Reserved */
634 uint32_t IF3OBS; /**< 0x0140: IF3 Observation Register */
635 uint32_t IF3MSK; /**< 0x0144: IF3 Mask Register */
636 uint32_t IF3ARB; /**< 0x0148: IF3 Arbitration Register */
637 uint32_t IF3MCTL; /**< 0x014C: IF3 Message Control Register */
638 uint8_t IF3DATx[8U]; /**< 0x0150-0x0154: IF3 Data A and B Registers */
639 uint32_t : 32U; /**< 0x0158: Reserved */
640 uint32_t : 32U; /**< 0x015C: Reserved */
641 uint32_t IF3UEy[4U]; /**< 0x0160-0x016C: IF3 Update Enable Registers */
642 uint32_t : 32U; /**< 0x0170: Reserved */
643 uint32_t : 32U; /**< 0x0174: Reserved */
644 uint32_t : 32U; /**< 0x0178: Reserved */
645 uint32_t : 32U; /**< 0x017C: Reserved */
646 uint32_t : 32U; /**< 0x0180: Reserved */
647 uint32_t : 32U; /**< 0x0184: Reserved */
648 uint32_t : 32U; /**< 0x0188: Reserved */
649 uint32_t : 32U; /**< 0x018C: Reserved */
650 uint32_t : 32U; /**< 0x0190: Reserved */
651 uint32_t : 32U; /**< 0x0194: Reserved */
652 uint32_t : 32U; /**< 0x0198: Reserved */
653 uint32_t : 32U; /**< 0x019C: Reserved */
654 uint32_t : 32U; /**< 0x01A0: Reserved */
655 uint32_t : 32U; /**< 0x01A4: Reserved */
656 uint32_t : 32U; /**< 0x01A8: Reserved */
657 uint32_t : 32U; /**< 0x01AC: Reserved */
658 uint32_t : 32U; /**< 0x01B0: Reserved */
659 uint32_t : 32U; /**< 0x01B4: Reserved */
660 uint32_t : 32U; /**< 0x01B8: Reserved */
661 uint32_t : 32U; /**< 0x01BC: Reserved */
662 uint32_t : 32U; /**< 0x01C0: Reserved */
663 uint32_t : 32U; /**< 0x01C4: Reserved */
664 uint32_t : 32U; /**< 0x01C8: Reserved */
665 uint32_t : 32U; /**< 0x01CC: Reserved */
666 uint32_t : 32U; /**< 0x01D0: Reserved */
667 uint32_t : 32U; /**< 0x01D4: Reserved */
668 uint32_t : 32U; /**< 0x01D8: Reserved */
669 uint32_t : 32U; /**< 0x01DC: Reserved */
670 uint32_t TIOC; /**< 0x01E0: TX IO Control Register */
671 uint32_t RIOC; /**< 0x01E4: RX IO Control Register */
676 * @brief CAN1 Register Frame Pointer
678 * This pointer is used by the CAN driver to access the CAN1 registers.
680 #define canREG1 ((canBASE_t *)0xFFF7DC00U)
683 * @brief CAN2 Register Frame Pointer
685 * This pointer is used by the CAN driver to access the CAN2 registers.
687 #define canREG2 ((canBASE_t *)0xFFF7DE00U)
690 * @brief CAN3 Register Frame Pointer
692 * This pointer is used by the CAN driver to access the CAN3 registers.
694 #define canREG3 ((canBASE_t *)0xFFF7E000U)
697 * @brief CAN1 Mailbox RAM Pointer
699 * This pointer is used by the CAN driver to access the CAN1 RAM.
701 #define canRAM1 (*(unsigned int *)0xFF1E0000U)
704 * @brief CAN2 Mailbox RAM Pointer
706 * This pointer is used by the CAN driver to access the CAN2 RAM.
708 #define canRAM2 (*(unsigned int *)0xFF1C0000U)
711 * @brief CAN3 Mailbox RAM Pointer
713 * This pointer is used by the CAN driver to access the CAN3 RAM.
715 #define canRAM3 (*(unsigned int *)0xFF1A0000U)
718 * @brief CAN1 Mailbox Parity RAM Pointer
720 * This pointer is used by the CAN driver to access the CAN1 Parity RAM
721 * for testing RAM parity error detect logic.
723 #define canPARRAM1 (*(unsigned int *)(0xFF1E0000U + 0x10))
726 * @brief CAN2 Mailbox Pairyt RAM Pointer
728 * This pointer is used by the CAN driver to access the CAN2 Parity RAM
729 * for testing RAM parity error detect logic.
731 #define canPARRAM2 (*(unsigned int *)(0xFF1C0000U + 0x10))
734 * @brief CAN3 Mailbox Parity RAM Pointer
736 * This pointer is used by the CAN driver to access the CAN3 Parity RAM
737 * for testing RAM parity error detect logic.
739 #define canPARRAM3 (*(unsigned int *)(0xFF1A0000U + 0x10))
741 /* USER CODE BEGIN (2) */
745 /* CAN Interface Functions */
748 uint32_t canTransmit(canBASE_t *node, uint32_t messageBox, const uint8_t *data);
749 uint32_t canGetData(canBASE_t *node, uint32_t messageBox, uint8_t * const data);
750 uint32_t canIsTxMessagePending(canBASE_t *node, uint32_t messageBox);
751 uint32_t canIsRxMessageArrived(canBASE_t *node, uint32_t messageBox);
752 uint32_t canIsMessageBoxValid(canBASE_t *node, uint32_t messageBox);
753 uint32_t canGetLastError(canBASE_t *node);
754 uint32_t canGetErrorLevel(canBASE_t *node);
755 void canEnableErrorNotification(canBASE_t *node);
756 void canDisableErrorNotification(canBASE_t *node);
757 void canIoSetDirection(canBASE_t *node,uint32_t TxDir,uint32_t RxDir);
758 void canIoSetPort(canBASE_t *node, uint32_t TxValue, uint32_t RxValue);
759 uint32_t canIoTxGetBit(canBASE_t *node);
760 uint32_t canIoRxGetBit(canBASE_t *node);
762 /** @fn void canErrorNotification(canBASE_t *node, uint32_t notification)
763 * @brief Error notification
764 * @param[in] node Pointer to CAN node:
765 * - canREG1: CAN1 node pointer
766 * - canREG2: CAN2 node pointer
767 * - canREG3: CAN3 node pointer
768 * @param[in] notification Error notification code:
769 * - canLEVEL_WARNING (0x40): When RX- or TX error counter are between 96 and 127
770 * - canLEVEL_BUS_OFF (0x80): When RX- or TX error counter are above 255
772 * @note This function has to be provide by the user.
774 void canErrorNotification(canBASE_t *node, uint32_t notification);
776 /** @fn void canMessageNotification(canBASE_t *node, uint32_t messageBox)
777 * @brief Message notification
778 * @param[in] node Pointer to CAN node:
779 * - canREG1: CAN1 node pointer
780 * - canREG2: CAN2 node pointer
781 * - canREG3: CAN3 node pointer
782 * @param[in] messageBox Message box number of CAN node:
783 * - canMESSAGE_BOX1: CAN message box 1
784 * - canMESSAGE_BOXn: CAN message box n [n: 1-64]
785 * - canMESSAGE_BOX64: CAN message box 64
787 * @note This function has to be provide by the user.
789 void canMessageNotification(canBASE_t *node, uint32_t messageBox);
791 /* USER CODE BEGIN (3) */