AM263Px MCU+ SDK: canfd.h Source File

| AM263Px MCU+ SDK 26.00.00 |

canfd.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2024 Texas Instruments Incorporated
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
90 #ifndef CANFD__H_
91 #define CANFD__H_
92
93 #ifdef __cplusplus
94 extern "C" {
95 #endif
96
97 #include <stdint.h>
98 #include <stddef.h>
99 #include <stdbool.h>
100 #include <drivers/mcan/v0/mcan.h>
101 #include <drivers/hw_include/cslr_soc.h>
102 #include <kernel/dpl/SemaphoreP.h>
103 #include <kernel/dpl/HwiP.h>
104 #include <drivers/mcan/v0/dma/canfd_dma.h>
105
107 typedef struct CANFD_Config_s *CANFD_Handle;
108
110 extern uint32_t gCANFDConfigNum;
111
118 #define MCAN_STATUS_SUCCESS ((int32_t)0)
119
123 #define MCAN_STATUS_FAILURE ((int32_t)-1)
124
145 #define CANFD_TRANSFER_MODE_BLOCKING (0U)
146
150 #define CANFD_TRANSFER_MODE_CALLBACK (1U)
151
161 #define CANFD_OPER_MODE_POLLED (0U)
162 #define CANFD_OPER_MODE_INTERRUPT (1U)
163 #define CANFD_OPER_MODE_DMA (2U)
164
174 #define MCAN_MSG_RAM_STD_ELEM_SIZE (1U)
175
177 #define MCAN_MSG_RAM_EXT_ELEM_SIZE (2U)
178
180 #define MCAN_MSG_HEADER_SIZE (8U)
181
183 #define MCAN_FRAME_TYPE_FD (1U)
184
187 #define MCAN_MSG_RAM_TX_RX_ELEM_SIZE (18U)
188
190 #define XTD_MSGID_MASK (0x1fffffffU)
191 #define STD_MSGID_MASK (0x7ffU)
192 #define STD_MSGID_SHIFT (18U)
193
195 #define MCAN_MAX_PAYLOAD_BYTES (64U)
196
198 #define MCAN_MAX_RX_BUFFERS (64U)
199
201 #define MCAN_MAX_TX_BUFFERS (32U)
202
204 #define CANFD_UTILS_ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
205
207 #define CANFD_UTILS_GETARRAYINDEX(member, array) (member - &array[0])
208
210 #define CANFD_UTILS_ARRAYISMEMBER(member, array) \
211 (((((uint32)member - (uint32) & array[0]) % sizeof(array[0])) == 0) \
212 && (member >= &array[0]) \
213 && (CANFD_UTILS_GETARRAYINDEX(member, array) < CANFD_UTILS_ARRAYSIZE(array)))
214
218 #define MCAN_INTR_MASK ((uint32_t)MCAN_INTR_SRC_RX_FIFO0_NEW_MSG | \
219 (uint32_t)MCAN_INTR_SRC_RX_FIFO0_MSG_LOST | \
220 (uint32_t)MCAN_INTR_SRC_RX_FIFO1_NEW_MSG | \
221 (uint32_t)MCAN_INTR_SRC_TRANS_COMPLETE | \
222 (uint32_t)MCAN_INTR_SRC_TRANS_CANCEL_FINISH | \
223 (uint32_t)MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG | \
224 (uint32_t)MCAN_INTR_SRC_PROTOCOL_ERR_ARB | \
225 (uint32_t)MCAN_INTR_SRC_PROTOCOL_ERR_DATA | \
226 (uint32_t)MCAN_INTR_SRC_RX_FIFO1_MSG_LOST | \
227 (uint32_t)MCAN_INTR_SRC_BUS_OFF_STATUS)
228
230 #define CANFD_DMA_TX_COMPLETION_INTERMEDIATE (1U)
231
232 #define CANFD_DMA_TX_COMPLETION_FINAL (2U)
233
234 #define CANFD_DMA_RX_COMPLETION_INTERMEDIATE (1U)
235
236 #define CANFD_DMA_RX_COMPLETION_FINAL (2U)
237
239 #define CANFD_MAX_DLC_MAPPING (16U)
240
252 #define CANFD_DRIVER_STATE_UNINIT (0U)
253
254 #define CANFD_DRIVER_STATE_STARTED (1U)
255
256 #define CANFD_DRIVER_STATE_STOPPED (2U)
257
258 #define CCANFD_DRIVER_STATE_SLEEP (3U)
259
267 typedef enum CANFD_MCANElemSize_t
268 {
270 CANFD_MCANElemSize_8BYTES = 0U,
271
273 CANFD_MCANElemSize_12BYTES = 1U,
274
276 CANFD_MCANElemSize_16BYTES = 2U,
277
279 CANFD_MCANElemSize_20BYTES = 3U,
280
282 CANFD_MCANElemSize_24BYTES = 4U,
283
285 CANFD_MCANElemSize_32BYTES = 5U,
286
288 CANFD_MCANElemSize_48BYTES = 6U,
289
291 CANFD_MCANElemSize_64BYTES = 7U
292 }CANFD_MCANElemSize;
293
301 typedef enum CANFD_MCANOperationMode_t
302 {
304 CANFD_MCANOperationMode_NORMAL = 0U,
305
307 CANFD_MCANOperationMode_SW_INIT = 1U
308 }CANFD_MCANOperationMode;
309
317 typedef enum CANFD_Direction_t
318 {
320 CANFD_Direction_RX,
321
323 CANFD_Direction_TX
324 } CANFD_Direction;
325
333 typedef enum CANFD_MCANXidType_t
334 {
336 CANFD_MCANXidType_11_BIT,
337
339 CANFD_MCANXidType_29_BIT
340 } CANFD_MCANXidType;
341
348 typedef enum CANFD_MCANFrameType_t
349 {
351 CANFD_MCANFrameType_CLASSIC,
352
354 CANFD_MCANFrameType_FD
355 } CANFD_MCANFrameType;
356
363 typedef enum CANFD_MCANTimeOutSelect_t
364 {
366 CANFD_MCANTimeOutSelect_CONT = 0U,
367
369 CANFD_MCANTimeOutSelect_TX_EVENT_FIFO = 1U,
370
372 CANFD_MCANTimeOutSelect_RX_FIFO0 = 2U,
373
375 CANFD_MCANTimeOutSelect_RX_FIFO1 = 3U
376 }CANFD_MCANTimeOutSelect;
377
386 typedef uint32_t CANFD_MCANECCErrType;
387
388 #define CANFD_MCAN_ECC_ERR_TYPE_SEC (0U)
389
390 #define CANFD_MCAN_ECC_ERR_TYPE_DED (1U)
391
400 typedef enum CANFD_MCANLoopBackMode_t
401 {
403 CANFD_MCANLoopBackMode_INTERNAL = 0U,
404
409 CANFD_MCANLoopBackMode_EXTERNAL = 1U
410 }CANFD_MCANLoopBackMode;
411
419 typedef enum CANFD_MCANCommState_t
420 {
422 CANFD_MCANCommState_SYNCHRONIZING = 0U,
423
425 CANFD_MCANCommState_IDLE = 1U,
426
428 CANFD_MCANCommState_RECEIVER = 2U,
429
431 CANFD_MCANCommState_TRANSMITTER = 3U
432 }CANFD_MCANCommState;
433
440 typedef enum CANFD_MCANErrCode_t
441 {
445 CANFD_MCANErrCode_NO_ERROR = 0U,
446
450 CANFD_MCANErrCode_STUFF_ERROR = 1U,
451
453 CANFD_MCANErrCode_FORM_ERROR = 2U,
454
456 CANFD_MCANErrCode_ACK_ERROR = 3U,
457
463 CANFD_MCANErrCode_BIT1_ERROR = 4U,
464
474 CANFD_MCANErrCode_BIT0_ERROR = 5U,
475
480 CANFD_MCANErrCode_CRC_ERROR = 6U,
481
486 CANFD_MCANErrCode_NO_CHANGE = 7U
487 }CANFD_MCANErrCode;
488
496 typedef enum CANFD_Reason_t
497 {
502 CANFD_Reason_RX = 0x1,
503
507 CANFD_Reason_TX_COMPLETION = 0x2,
508
512 CANFD_Reason_TX_CANCELED = 0x3,
513
517 CANFD_Reason_ECC_ERROR = 0x4,
518
522 CANFD_Reason_BUSOFF = 0x5,
523
527 CANFD_Reason_PROTOCOL_ERR_DATA_PHASE = 0x6,
528
532 CANFD_Reason_PROTOCOL_ERR_ARB_PHASE = 0x7,
533
537 CANFD_Reason_SRC_RX_FIFO0_MSG_LOST = 0x8,
538
542 CANFD_Reason_SRC_RX_FIFO1_MSG_LOST = 0x9
543 }CANFD_Reason;
544
554 typedef enum CANFD_Option_t
555 {
562 CANFD_Option_MCAN_ERROR_COUNTER,
563
570 CANFD_Option_MCAN_PROTOCOL_STATUS,
571
581 CANFD_Option_MCAN_MSG_OBJECT_STATS,
582
589 CANFD_Option_MCAN_MODE,
590
598 CANFD_Option_MCAN_LOOPBACK,
599
609 CANFD_Option_MCAN_POWER_DOWN
610 } CANFD_Option;
611
618 typedef struct CANFD_MCANLoopbackCfgParams_t
619 {
625 uint32_t enable;
626
628 CANFD_MCANLoopBackMode mode;
629 }CANFD_MCANLoopbackCfgParams;
630
639 typedef struct CANFD_MCANBitTimingParams_t
640 {
642 uint32_t nomBrp;
643
645 uint32_t nomPropSeg;
646
648 uint32_t nomPseg1;
649
651 uint32_t nomPseg2;
652
654 uint32_t nomSjw;
655
657 uint32_t dataBrp;
658
660 uint32_t dataPropSeg;
661
663 uint32_t dataPseg1;
664
666 uint32_t dataPseg2;
667
669 uint32_t dataSjw;
670 }CANFD_MCANBitTimingParams;
671
678 typedef struct CANFD_MCANTdcConfig_t
679 {
683 uint32_t tdcf;
684
688 uint32_t tdco;
689 }CANFD_MCANTdcConfig;
690
697 typedef struct CANFD_MCANGlobalFiltConfig_t
698 {
703 uint32_t rrfe;
704
709 uint32_t rrfs;
710
716 uint32_t anfe;
717
723 uint32_t anfs;
724 }CANFD_MCANGlobalFiltConfig;
725
738 typedef struct CANFD_MCANMsgRAMCfgParams_t
739 {
745 uint32_t lss;
746
752 uint32_t lse;
753
759 uint32_t txBufNum;
760
766 uint32_t txFIFOSize;
767
772 uint32_t txBufMode;
773
779 uint32_t txEventFIFOSize;
780
786 uint32_t txEventFIFOWaterMark;
787
793 uint32_t rxFIFO0size;
794
800 uint32_t rxFIFO0waterMark;
801
806 uint32_t rxFIFO0OpMode;
807
813 uint32_t rxFIFO1size;
814
820 uint32_t rxFIFO1waterMark;
821
826 uint32_t rxFIFO1OpMode;
827 }CANFD_MCANMsgRAMCfgParams;
828
835 typedef struct CANFD_MCANECCConfigParams_t
836 {
841 uint32_t enable;
842
847 uint32_t enableChk;
848
853 uint32_t enableRdModWr;
854 }CANFD_MCANECCConfigParams;
855
862 typedef struct CANFD_MCANErrCntStatus_t
863 {
865 uint32_t transErrLogCnt;
866
868 uint32_t recErrCnt;
869
874 uint32_t rpStatus;
875
877 uint32_t canErrLogCnt;
878 }CANFD_MCANErrCntStatus;
879
886 typedef struct CANFD_MCANProtocolStatus_t
887 {
891 uint32_t lastErrCode;
892
896 uint32_t act;
897
902 uint32_t errPassive;
903
909 uint32_t warningStatus;
910
915 uint32_t busOffStatus;
916
920 uint32_t dlec;
921
926 uint32_t resi;
927
932 uint32_t rbrs;
933
939 uint32_t rfdf;
940
945 uint32_t pxe;
946
948 uint32_t tdcv;
949 }CANFD_MCANProtocolStatus;
950
957 typedef struct CANFD_MCANECCErrForceParams_t
958 {
962 uint32_t errType;
963
965 uint32_t rowNum;
966
970 uint32_t bit1;
971
973 uint32_t bit2;
974
978 uint32_t errOnce;
979
981 uint32_t errForce;
982 }CANFD_MCANECCErrForceParams;
983
991 typedef struct CANFD_MCANECCErrStatus_t
992 {
997 uint32_t secErr;
998
1003 uint32_t dedErr;
1004
1008 uint32_t row;
1009
1012 uint32_t bit1;
1013
1017 uint32_t bit2;
1018 }CANFD_MCANECCErrStatus;
1019
1027 typedef union CANFD_ErrStatusResp_t
1028 {
1030 CANFD_MCANECCErrStatus eccErrStatus;
1031
1033 CANFD_MCANProtocolStatus protocolStatus;
1034 } CANFD_ErrStatusResp;
1035
1036
1044 typedef struct CANFD_Attrs_s
1045 {
1046 /* Peripheral base address */
1047 uint32_t baseAddr;
1048
1050 uint32_t intrNum0;
1051
1053 uint32_t intrNum1;
1054
1056 uint32_t operMode;
1057
1059 uint8_t intrPriority;
1060
1062 uint32_t OptionTLVtype;
1063
1064 /* MCAN Loopback parameters. */
1065 CANFD_MCANLoopbackCfgParams CANFDMcanloopbackParams;
1066
1067 /* parameters for bit timing calculation. */
1068 CANFD_MCANBitTimingParams CANFDMcanBitTimingParams;
1069
1071 uint32_t txMemType;
1072
1074 uint32_t rxMemType;
1075
1081 void *filterConfig;
1082 } CANFD_Attrs;
1083
1094 typedef struct CANFD_OptionTLV_t
1095 {
1099 CANFD_Option type;
1100
1104 int32_t length;
1105
1109 void* value;
1110 }CANFD_OptionTLV;
1111
1119 typedef void (*CANFD_TransferCallbackFxn) (void *args, CANFD_Reason reason);
1120
1129 typedef void (*CANFD_ErrorCallbackFxn) (void *args, CANFD_Reason reason,
1130 CANFD_ErrStatusResp* errStatusResp);
1131
1132
1141 typedef struct CANFD_OpenParams_t
1142 {
1145 uint32_t transferMode;
1146
1148 CANFD_TransferCallbackFxn transferCallbackFxn;
1149
1151 CANFD_ErrorCallbackFxn errorCallbackFxn;
1152
1157 uint32_t fdMode;
1158
1164 uint32_t brsEnable;
1165
1170 uint32_t txpEnable;
1171
1177 uint32_t efbi;
1178
1183 uint32_t pxhddisable;
1184
1190 uint32_t darEnable;
1191
1196 uint32_t wkupReqEnable;
1197
1202 uint32_t autoWkupEnable;
1203
1208 uint32_t emulationEnable;
1209
1214 uint32_t emulationFAck;
1215
1220 uint32_t clkStopFAck;
1221
1225 uint32_t wdcPreload;
1226
1231 uint32_t tdcEnable;
1232
1236 CANFD_MCANTdcConfig tdcConfig;
1237
1242 uint32_t monEnable;
1243
1249 uint32_t asmEnable;
1250
1254 uint32_t tsPrescalar;
1255
1262 uint32_t tsSelect;
1263
1267 CANFD_MCANTimeOutSelect timeoutSelect;
1268
1274 uint32_t timeoutPreload;
1275
1280 uint32_t timeoutCntEnable;
1281
1285 CANFD_MCANGlobalFiltConfig filterConfig;
1286
1290 CANFD_MCANMsgRAMCfgParams msgRAMConfig;
1291
1295 CANFD_MCANECCConfigParams eccConfig;
1296
1299 uint32_t errInterruptEnable;
1300
1303 uint32_t dataInterruptEnable;
1304 }CANFD_OpenParams;
1305
1317 typedef struct CANFD_Object_t
1318 {
1322 CANFD_Handle handle;
1323
1327 uint32_t regBaseAddress;
1328
1332 uint32_t state;
1333
1337 CANFD_OpenParams *openParams;
1338
1342 uint8_t mcanDataSize[CANFD_MAX_DLC_MAPPING];
1343
1347 struct CANFD_MessageObject_t* msgObjectHandle[MCAN_MAX_MSG_OBJECTS];
1348
1352 struct CANFD_MessageObject_t* txMapping[MCAN_MAX_TX_MSG_OBJECTS];
1353
1357 struct CANFD_MessageObject_t* rxMapping[MCAN_MAX_RX_MSG_OBJECTS];
1358
1362 uint32_t errStatusInterrupts;
1363
1367 uint32_t interrupts;
1368
1372 uint32_t eccInterrupts;
1373
1377 uint32_t busOffInterrupts;
1378
1382 uint32_t protoDataErrInterrupts;
1383
1387 uint32_t protoArbErrInterrupts;
1388
1392 uint8_t txStatus[MCAN_MAX_TX_MSG_OBJECTS];
1393
1397 uint32_t useFifoNum;
1398
1402 MCAN_RxBufElement rxBuffElem;
1403
1407 CANFD_DmaHandle canfdDmaHandle;
1408
1412 CANFD_DmaChConfig canfdDmaChCfg;
1413
1417 void* args;
1418
1421 void *readTransferSem;
1422
1425 SemaphoreP_Object readTransferSemObj;
1426
1429 void *writeTransferSem;
1430
1433 SemaphoreP_Object writeTransferSemObj;
1434
1436 void *hwiHandle;
1437
1439 HwiP_Object hwiObj0;
1440
1442 HwiP_Object hwiObj1;
1443
1444 /* Revision ID and Core Release Info */
1445 MCAN_RevisionId revId;
1446
1447 }CANFD_Object;
1448
1461 typedef struct CANFD_Config_s
1462 {
1463 CANFD_Attrs *attrs;
1465 CANFD_Object *object;
1467 } CANFD_Config;
1468
1476 typedef struct CANFD_DmaMsgConfig_s
1477 {
1481 uint32_t dataLengthPerMsg;
1485 uint32_t numMsgs;
1489 const void *data;
1493 uint32_t currentMsgNum;
1494 }CANFD_DmaMsgConfig;
1495
1508 typedef struct CANFD_DmaRxBuf_s
1509 {
1510 /* Header word 1 in Rx buffer in message ram */
1511 uint32_t header1;
1512 /* Header word 2 in Rx buffer in message ram */
1513 uint32_t header2;
1514 /* Data Bytes Rx buffer in message ram */
1515 uint8_t data[MCAN_MAX_RX_BUFFERS];
1516 }CANFD_DmaRxBuf;
1517
1528 typedef struct CANFD_MessageObject_t
1529 {
1534 uint32_t startMsgId;
1535
1540 uint32_t endMsgId;
1541
1545 CANFD_Config* canfdHandle;
1546
1550 CANFD_Direction direction;
1551
1555 CANFD_MCANXidType msgIdType;
1556
1560 uint32_t messageObjNum;
1561
1566 uint32_t dataLength;
1567
1571 uint32_t txElement;
1572
1576 uint32_t rxElement;
1577
1582 MCAN_MemType txMemType;
1583
1588 MCAN_MemType rxMemType;
1589
1593 uint32_t rxFifoNum;
1594
1598 uint32_t interruptsRxed;
1599
1603 uint32_t messageProcessed;
1604
1608 uint32_t dmaEventNo;
1612 CANFD_DmaMsgConfig dmaMsgConfig;
1613
1617 void *args;
1618
1624 void *filterConfig;
1625 }CANFD_MessageObject;
1626
1633 typedef CANFD_MessageObject* CANFD_MsgObjHandle;
1634
1641 typedef struct CANFD_MCANMsgObjectStats_t
1642 {
1644 CANFD_MsgObjHandle handle;
1645
1647 uint32_t direction;
1648
1653 uint32_t startMsgIdentifier;
1654
1659 uint32_t endMsgIdentifier;
1660
1662 uint32_t interruptsRxed;
1663
1665 uint32_t messageProcessed;
1666 } CANFD_MCANMsgObjectStats;
1667
1681 void CANFD_init(void);
1682
1686 void CANFD_deinit(void);
1687
1700 CANFD_Handle CANFD_open(uint32_t index, CANFD_OpenParams *openPrms);
1701
1710 void CANFD_close(CANFD_Handle handle);
1711
1724 int32_t CANFD_configBitTime(CANFD_Handle handle, const CANFD_MCANBitTimingParams* bitTimeParams);
1725
1744 int32_t CANFD_createMsgObject(CANFD_Handle handle,
1745 CANFD_MessageObject* ptrCanMsgObj);
1746
1763 int32_t CANFD_createRxRangeMsgObject(CANFD_Handle handle,
1764 CANFD_MessageObject* ptrCanMsgObj);
1765
1776 int32_t CANFD_deleteMsgObject(CANFD_MsgObjHandle handle);
1777
1796 int32_t CANFD_write(CANFD_MsgObjHandle handle, uint32_t id,
1797 CANFD_MCANFrameType frameType, uint32_t numMsgs,
1798 const uint8_t* data);
1799
1810 int32_t CANFD_writeCancel(CANFD_MsgObjHandle handle);
1811
1835 int32_t CANFD_writeDma(CANFD_MsgObjHandle handle, uint32_t id,
1836 CANFD_MCANFrameType frameType,
1837 uint32_t numMsgs, const void* data);
1838
1852 int32_t CANFD_writeDmaTriggerNext(CANFD_MsgObjHandle handle);
1853
1854 uint32_t CANFD_getFilterEventConfig(uint32_t eventNum);
1855
1872 int32_t CANFD_read(CANFD_MsgObjHandle rxMsgHandle, uint32_t numMsgs, uint8_t* data);
1873
1891 int32_t CANFD_readDmaConfig(CANFD_MsgObjHandle handle, const void* data, uint32_t numMsgs);
1892
1904 int32_t CANFD_getOptions(CANFD_Handle handle, const CANFD_OptionTLV* ptrOptInfo);
1905
1916 int32_t CANFD_setOptions(CANFD_Handle handle, const CANFD_OptionTLV* ptrOptInfo);
1917
1921 void CANFD_int0Isr (void *args);
1922
1926 void CANFD_int1Isr (void *args);
1927
1940 void CANFD_transferCallBack(void *args, CANFD_Reason reason);
1941
1956 void CANFD_errStatusCallBack(CANFD_Handle handle, CANFD_Reason reason,
1957 CANFD_ErrStatusResp* errStatusResp);
1958
1970 int32_t CANFD_dmaOpen(CANFD_Handle canfdHandle, CANFD_DmaChConfig dmaChCfg);
1971
1979 int32_t CANFD_dmaClose(CANFD_Handle canfdHandle);
1980
1990 int32_t CANFD_createDmaTxMsgObject(const CANFD_Object *ptrCanFdObj,
1991 CANFD_MessageObject* ptrCanMsgObj);
1992
2002 int32_t CANFD_deleteDmaTxMsgObject(const CANFD_Object *ptrCanFdObj,
2003 const CANFD_MessageObject* ptrCanMsgObj);
2004
2016 int32_t CANFD_configureDmaTx(const CANFD_Object *ptrCanFdObj,
2017 CANFD_MessageObject* ptrCanMsgObj, uint32_t dataLengthPerMsg,
2018 uint32_t numMsgs, const void* data);
2019
2028 int32_t CANFD_cancelDmaTx(const CANFD_Object *ptrCanFdObj,
2029 const CANFD_MessageObject* ptrCanMsgObj);
2030
2044 void CANFD_dmaTxCompletionCallback(CANFD_MessageObject* ptrCanMsgObj,
2045 const void *data, uint32_t completionType);
2046
2056 int32_t CANFD_createDmaRxMsgObject(const CANFD_Object *ptrCanFdObj,
2057 CANFD_MessageObject* ptrCanMsgObj);
2058
2068 int32_t CANFD_deleteDmaRxMsgObject(const CANFD_Object *ptrCanFdObj,
2069 const CANFD_MessageObject* ptrCanMsgObj);
2070
2081 int32_t CANFD_configureDmaRx(const CANFD_Object *ptrCanFdObj,
2082 CANFD_MessageObject* ptrCanMsgObj,
2083 uint32_t dataLengthPerMsg, uint32_t numMsgs,
2084 const void* data);
2085
2099 void CANFD_dmaRxCompletionCallback(CANFD_MessageObject* ptrCanMsgObj, const void *data,
2100 uint32_t completionType);
2101
2102
2109 int32_t CANFD_isDataSizeValid(uint32_t dataSize);
2110
2111 /* ========================================================================== */
2112 /* Advance Functions */
2113 /* ========================================================================== */
2114
2122 int32_t CANFD_getEndianVal(CANFD_Handle canfdHandle);
2123
2130 void CANFD_getRevisionId(CANFD_Handle canfdHandle);
2131
2141 void CANFD_addClockStopRequest(CANFD_Handle canfdHandle, uint32_t enable);
2142
2152 uint32_t CANFD_clockStopReq(CANFD_Handle canfdHandle);
2153
2163 uint32_t CANFD_getClkStopAck(CANFD_Handle canfdHandle);
2164
2173 uint32_t CANFD_getRxPinState(CANFD_Handle canfdHandle);
2174
2186 void CANFD_setTxPinState(CANFD_Handle canfdHandle, uint32_t state);
2187
2198 uint32_t CANFD_getTxPinState(CANFD_Handle canfdHandle);
2199
2205 void CANFD_getBitTime(CANFD_Handle canfdHandle);
2206
2214 uint32_t CANFD_getTSCounterVal(CANFD_Handle canfdHandle);
2215
2222 void CANFD_resetTSCounter(CANFD_Handle canfdHandle);
2223
2226 #ifdef __cplusplus
2227 }
2228 #endif
2229
2230 #endif /* #ifndef CANFD__H_ */
2231
CANFD_ErrStatusResp::eccErrStatus
CANFD_MCANECCErrStatus eccErrStatus
Definition: canfd.h:1030
CANFD_dmaClose
int32_t CANFD_dmaClose(CANFD_Handle canfdHandle)
API to close an CANFD DMA channel.
CANFD_MCANTdcConfig::tdco
uint32_t tdco
Definition: canfd.h:688
CANFD_Object::handle
CANFD_Handle handle
Instance handle to which this object belongs.
Definition: canfd.h:1322
CANFD_MCANECCErrForceParams::errType
uint32_t errType
Definition: canfd.h:962
CANFD_MCANMsgRAMCfgParams::txBufMode
uint32_t txBufMode
Definition: canfd.h:772
CANFD_MCANMsgRAMCfgParams::txEventFIFOWaterMark
uint32_t txEventFIFOWaterMark
Definition: canfd.h:786
CANFD_MCANElemSize_64BYTES
@ CANFD_MCANElemSize_64BYTES
Definition: canfd.h:291
CANFD_MCANProtocolStatus::warningStatus
uint32_t warningStatus
Definition: canfd.h:909
CANFD_MCANTimeOutSelect_RX_FIFO0
@ CANFD_MCANTimeOutSelect_RX_FIFO0
Definition: canfd.h:372
CANFD_configureDmaTx
int32_t CANFD_configureDmaTx(const CANFD_Object *ptrCanFdObj, CANFD_MessageObject *ptrCanMsgObj, uint32_t dataLengthPerMsg, uint32_t numMsgs, const void *data)
API to enable dma event transfer for the Tx. Called from the API CANFD_writeDma.
CANFD_Attrs::rxMemType
uint32_t rxMemType
Definition: canfd.h:1074
CANFD_MCANProtocolStatus::tdcv
uint32_t tdcv
Definition: canfd.h:948
CANFD_MCANGlobalFiltConfig::rrfe
uint32_t rrfe
Definition: canfd.h:703
CANFD_MCANCommState_TRANSMITTER
@ CANFD_MCANCommState_TRANSMITTER
Definition: canfd.h:431
CANFD_MCANProtocolStatus::rbrs
uint32_t rbrs
Definition: canfd.h:932
args
void * args
Definition: hsmclient_msg.h:4
CANFD_getClkStopAck
uint32_t CANFD_getClkStopAck(CANFD_Handle canfdHandle)
This API will return clock stop acknowledgement for MCAN module.
CANFD_OptionTLV
Definition: canfd.h:1095
CANFD_MCANProtocolStatus::busOffStatus
uint32_t busOffStatus
Definition: canfd.h:915
CANFD_Config::object
CANFD_Object * object
Definition: canfd.h:1465
CANFD_deinit
void CANFD_deinit(void)
This function de-initializes each driver instance object and delete a driver lock.
CANFD_Object::hwiObj0
HwiP_Object hwiObj0
Definition: canfd.h:1439
CANFD_MCANBitTimingParams::dataPseg2
uint32_t dataPseg2
Definition: canfd.h:666
CANFD_setTxPinState
void CANFD_setTxPinState(CANFD_Handle canfdHandle, uint32_t state)
This API will set Tx pin state of MCAN module.
CANFD_writeCancel
int32_t CANFD_writeCancel(CANFD_MsgObjHandle handle)
Function used by the application to cancel a pending data transmit.
CANFD_MCANBitTimingParams::dataSjw
uint32_t dataSjw
Definition: canfd.h:669
CANFD_Object::args
void * args
Pointer to be used by application to store miscellaneous data.
Definition: canfd.h:1417
CANFD_MCANErrCode_STUFF_ERROR
@ CANFD_MCANErrCode_STUFF_ERROR
Definition: canfd.h:450
CANFD_dmaOpen
int32_t CANFD_dmaOpen(CANFD_Handle canfdHandle, CANFD_DmaChConfig dmaChCfg)
API to open an CANFD DMA channel.
CANFD_MCANProtocolStatus::errPassive
uint32_t errPassive
Definition: canfd.h:902
CANFD_OpenParams::timeoutPreload
uint32_t timeoutPreload
Definition: canfd.h:1274
CANFD_OpenParams
Definition: canfd.h:1142
CANFD_MCANErrCode
CANFD_MCANErrCode
Definition: canfd.h:441
CANFD_MCANElemSize
CANFD_MCANElemSize
Definition: canfd.h:268
CANFD_errStatusCallBack
void CANFD_errStatusCallBack(CANFD_Handle handle, CANFD_Reason reason, CANFD_ErrStatusResp *errStatusResp)
Application specified callback function which is invoked by the CANFD driver on error or status chang...
CANFD_getEndianVal
int32_t CANFD_getEndianVal(CANFD_Handle canfdHandle)
This function return endianness value of MCAN module.
CANFD_MCANErrCntStatus
Definition: canfd.h:863
CANFD_DmaMsgConfig::currentMsgNum
uint32_t currentMsgNum
Used by driver to store current message count out of the numMsgs already processed.
Definition: canfd.h:1493
CANFD_MCANProtocolStatus::act
uint32_t act
Definition: canfd.h:896
CANFD_MCANErrCntStatus::transErrLogCnt
uint32_t transErrLogCnt
Definition: canfd.h:865
MCAN_RxBufElement
Structure for MCAN Rx Buffer element.
Definition: mcan.h:1491
CANFD_Option_MCAN_MSG_OBJECT_STATS
@ CANFD_Option_MCAN_MSG_OBJECT_STATS
Definition: canfd.h:581
CANFD_configBitTime
int32_t CANFD_configBitTime(CANFD_Handle handle, const CANFD_MCANBitTimingParams *bitTimeParams)
Function configures the bit time parameters for the CANFD module.
CANFD_MCANMsgObjectStats::endMsgIdentifier
uint32_t endMsgIdentifier
Definition: canfd.h:1659
CANFD_MCANLoopbackCfgParams
Definition: canfd.h:619
CANFD_OpenParams::asmEnable
uint32_t asmEnable
Definition: canfd.h:1249
CANFD_deleteDmaRxMsgObject
int32_t CANFD_deleteDmaRxMsgObject(const CANFD_Object *ptrCanFdObj, const CANFD_MessageObject *ptrCanMsgObj)
API to delete dma configuration for the Rx message object. Called from the CANFD_deleteMsgObject.
CANFD_MCANElemSize_32BYTES
@ CANFD_MCANElemSize_32BYTES
Definition: canfd.h:285
CANFD_Option_MCAN_LOOPBACK
@ CANFD_Option_MCAN_LOOPBACK
Definition: canfd.h:598
CANFD_MCANBitTimingParams::nomSjw
uint32_t nomSjw
Definition: canfd.h:654
CANFD_Object::interrupts
uint32_t interrupts
Number of interrupts received for message Tx or Rx.
Definition: canfd.h:1367
CANFD_Reason_BUSOFF
@ CANFD_Reason_BUSOFF
Bus Off condition detected.
Definition: canfd.h:522
CANFD_MCANProtocolStatus::dlec
uint32_t dlec
Definition: canfd.h:920
CANFD_OpenParams::darEnable
uint32_t darEnable
Definition: canfd.h:1190
CANFD_MCANTimeOutSelect_TX_EVENT_FIFO
@ CANFD_MCANTimeOutSelect_TX_EVENT_FIFO
Definition: canfd.h:369
CANFD_Reason_PROTOCOL_ERR_DATA_PHASE
@ CANFD_Reason_PROTOCOL_ERR_DATA_PHASE
Protocol error in data phase detected.
Definition: canfd.h:527
gCANFDConfigNum
uint32_t gCANFDConfigNum
Externally defined driver configuration array size.
CANFD_OpenParams::brsEnable
uint32_t brsEnable
Definition: canfd.h:1164
CANFD_MCANECCConfigParams::enableChk
uint32_t enableChk
Definition: canfd.h:847
CANFD_MCANBitTimingParams
Definition: canfd.h:640
CANFD_MessageObject::dmaEventNo
uint32_t dmaEventNo
Dma Event number allocated for this message object.
Definition: canfd.h:1608
CANFD_Option_MCAN_POWER_DOWN
@ CANFD_Option_MCAN_POWER_DOWN
Definition: canfd.h:609
CANFD_MCANTimeOutSelect_RX_FIFO1
@ CANFD_MCANTimeOutSelect_RX_FIFO1
Definition: canfd.h:375
CANFD_OpenParams::timeoutCntEnable
uint32_t timeoutCntEnable
Definition: canfd.h:1280
CANFD_DmaMsgConfig::data
const void * data
pointer to the data buffer. This should a 2d array of uint8[numMsgs][dataLengthPerMsg]
Definition: canfd.h:1489
CANFD_Object::protoArbErrInterrupts
uint32_t protoArbErrInterrupts
Number of Protocol error in arbitration phase interrupts received.
Definition: canfd.h:1387
CANFD_MCANCommState
CANFD_MCANCommState
Definition: canfd.h:420
CANFD_MCANLoopBackMode
CANFD_MCANLoopBackMode
Definition: canfd.h:401
CANFD_OpenParams::tsPrescalar
uint32_t tsPrescalar
Definition: canfd.h:1254
CANFD_Object::canfdDmaHandle
CANFD_DmaHandle canfdDmaHandle
Dma driver handle.
Definition: canfd.h:1407
CANFD_MCANECCErrForceParams
Definition: canfd.h:958
CANFD_OpenParams::transferCallbackFxn
CANFD_TransferCallbackFxn transferCallbackFxn
Definition: canfd.h:1148
CANFD_MCANFrameType
CANFD_MCANFrameType
Definition: canfd.h:349
CANFD_Object::protoDataErrInterrupts
uint32_t protoDataErrInterrupts
Number of Protocol error in data phase interrupts received.
Definition: canfd.h:1382
CANFD_OpenParams::emulationEnable
uint32_t emulationEnable
Definition: canfd.h:1208
CANFD_MessageObject::msgIdType
CANFD_MCANXidType msgIdType
Message object type.
Definition: canfd.h:1555
CANFD_Reason_ECC_ERROR
@ CANFD_Reason_ECC_ERROR
Data has been succesfully transmitted.
Definition: canfd.h:517
CANFD_Object::readTransferSem
void * readTransferSem
Definition: canfd.h:1421
CANFD_MCANGlobalFiltConfig::rrfs
uint32_t rrfs
Definition: canfd.h:709
CANFD_transferCallBack
void CANFD_transferCallBack(void *args, CANFD_Reason reason)
Application specified callback function which is invoked by the CANFD driver once transmit is complet...
CANFD_Object::canfdDmaChCfg
CANFD_DmaChConfig canfdDmaChCfg
Pointer to Dma channel configuration.
Definition: canfd.h:1412
MCAN_MAX_MSG_OBJECTS
#define MCAN_MAX_MSG_OBJECTS
Maximum number of message objects that can be supported by CANFD.
Definition: mcan.h:393
CANFD_MCANBitTimingParams::nomPseg2
uint32_t nomPseg2
Definition: canfd.h:651
CANFD_MCANMsgObjectStats
Definition: canfd.h:1642
CANFD_Object::busOffInterrupts
uint32_t busOffInterrupts
Number of Bus-Off interrupts received.
Definition: canfd.h:1377
CANFD_Object::writeTransferSem
void * writeTransferSem
Definition: canfd.h:1429
CANFD_MCANFrameType_CLASSIC
@ CANFD_MCANFrameType_CLASSIC
Definition: canfd.h:351
CANFD_MCANMsgObjectStats::handle
CANFD_MsgObjHandle handle
Definition: canfd.h:1644
CANFD_MCANCommState_SYNCHRONIZING
@ CANFD_MCANCommState_SYNCHRONIZING
Definition: canfd.h:422
CANFD_Reason_SRC_RX_FIFO1_MSG_LOST
@ CANFD_Reason_SRC_RX_FIFO1_MSG_LOST
Rx FIFO 1 Message Lost.
Definition: canfd.h:542
CANFD_ErrStatusResp
Definition: canfd.h:1028
MCAN_MAX_RX_MSG_OBJECTS
#define MCAN_MAX_RX_MSG_OBJECTS
Maximum number of Rx message objects that can be supported by CANFD.
Definition: mcan.h:388
CANFD_cancelDmaTx
int32_t CANFD_cancelDmaTx(const CANFD_Object *ptrCanFdObj, const CANFD_MessageObject *ptrCanMsgObj)
API to disbale dma event transfer for the Tx to cancel the transfer.
CANFD_MessageObject::dataLength
uint32_t dataLength
Data Length used by application for transmission and reception. Valid values: 1 to 64 bytes.
Definition: canfd.h:1566
SemaphoreP.h
CANFD_dmaTxCompletionCallback
void CANFD_dmaTxCompletionCallback(CANFD_MessageObject *ptrCanMsgObj, const void *data, uint32_t completionType)
Callback function for the Tx completion. This is called for each message in the array of msgs provide...
CANFD_read
int32_t CANFD_read(CANFD_MsgObjHandle rxMsgHandle, uint32_t numMsgs, uint8_t *data)
Function is used by the application to get the CAN message from message RAM using a receive message o...
CANFD_MessageObject::endMsgId
uint32_t endMsgId
Ending range of the Message Id to which the configuration belongs For Tx and single Message Id object...
Definition: canfd.h:1540
CANFD_TransferCallbackFxn
void(* CANFD_TransferCallbackFxn)(void *args, CANFD_Reason reason)
The definition of a callback function used by the CANFD driver when used in CANFD_TRANSFER_MODE_CALLB...
Definition: canfd.h:1119
CANFD_MCANECCErrForceParams::bit1
uint32_t bit1
Definition: canfd.h:970
CANFD_MCANErrCode_NO_CHANGE
@ CANFD_MCANErrCode_NO_CHANGE
Definition: canfd.h:486
CANFD_MCANProtocolStatus::resi
uint32_t resi
Definition: canfd.h:926
CANFD_Handle
struct CANFD_Config_s * CANFD_Handle
A handle that is returned from a CANFD_open() call.
Definition: canfd.h:107
CANFD_Config
Definition: canfd.h:1462
CANFD_createDmaRxMsgObject
int32_t CANFD_createDmaRxMsgObject(const CANFD_Object *ptrCanFdObj, CANFD_MessageObject *ptrCanMsgObj)
API to configure dma for the Rx message object. Called from the CANFD_createMsgObject.
CANFD_OpenParams::dataInterruptEnable
uint32_t dataInterruptEnable
Definition: canfd.h:1303
CANFD_MCANElemSize_16BYTES
@ CANFD_MCANElemSize_16BYTES
Definition: canfd.h:276
CANFD_Option_MCAN_MODE
@ CANFD_Option_MCAN_MODE
Definition: canfd.h:589
CANFD_MsgObjHandle
CANFD_MessageObject * CANFD_MsgObjHandle
Definition: canfd.h:1633
CANFD_Object::hwiHandle
void * hwiHandle
Definition: canfd.h:1436
CANFD_MCANErrCntStatus::canErrLogCnt
uint32_t canErrLogCnt
Definition: canfd.h:877
CANFD_Object::revId
MCAN_RevisionId revId
Definition: canfd.h:1445
CANFD_resetTSCounter
void CANFD_resetTSCounter(CANFD_Handle canfdHandle)
This API will reset timestamp counter value.
CANFD_ErrStatusResp::protocolStatus
CANFD_MCANProtocolStatus protocolStatus
Definition: canfd.h:1033
CANFD_MCANErrCode_BIT1_ERROR
@ CANFD_MCANErrCode_BIT1_ERROR
Definition: canfd.h:463
CANFD_MCANXidType_29_BIT
@ CANFD_MCANXidType_29_BIT
Definition: canfd.h:339
CANFD_Attrs::operMode
uint32_t operMode
Definition: canfd.h:1056
CANFD_MessageObject::dmaMsgConfig
CANFD_DmaMsgConfig dmaMsgConfig
Dma message configuration.
Definition: canfd.h:1612
CANFD_Direction_TX
@ CANFD_Direction_TX
Definition: canfd.h:323
CANFD_Reason_RX
@ CANFD_Reason_RX
Data has been received and the application is required to read and process the data.
Definition: canfd.h:502
CANFD_OptionTLV::value
void * value
Option Value.
Definition: canfd.h:1109
CANFD_MCANECCConfigParams::enable
uint32_t enable
Definition: canfd.h:841
CANFD_dmaRxCompletionCallback
void CANFD_dmaRxCompletionCallback(CANFD_MessageObject *ptrCanMsgObj, const void *data, uint32_t completionType)
Callback function for the Rx completion. This is called for each message in the array of msgs provide...
CANFD_MessageObject::startMsgId
uint32_t startMsgId
Starting range of the Message Id to which the configuration belongs. For Tx and single Message Id obj...
Definition: canfd.h:1534
CANFD_init
void CANFD_init(void)
This function initializes each driver instance object and create a driver lock.
CANFD_MessageObject::txElement
uint32_t txElement
Tx buffer number used to send data.
Definition: canfd.h:1571
CANFD_MCANECCConfigParams::enableRdModWr
uint32_t enableRdModWr
Definition: canfd.h:853
CANFD_close
void CANFD_close(CANFD_Handle handle)
Function to close a CANFD peripheral specified by the CANFD handle.
CANFD_MCANMsgRAMCfgParams::rxFIFO1size
uint32_t rxFIFO1size
Definition: canfd.h:813
CANFD_MessageObject::messageObjNum
uint32_t messageObjNum
Allocated message object number.
Definition: canfd.h:1560
CANFD_isDataSizeValid
int32_t CANFD_isDataSizeValid(uint32_t dataSize)
Function to validate the data Size.
CANFD_Object::openParams
CANFD_OpenParams * openParams
CANFD driver init parameters.
Definition: canfd.h:1337
CANFD_getRxPinState
uint32_t CANFD_getRxPinState(CANFD_Handle canfdHandle)
This API will return Rx pin state of MCAN module.
CANFD_Attrs::CANFDMcanloopbackParams
CANFD_MCANLoopbackCfgParams CANFDMcanloopbackParams
Definition: canfd.h:1065
CANFD_MessageObject
Definition: canfd.h:1529
CANFD_OpenParams::txpEnable
uint32_t txpEnable
Definition: canfd.h:1170
CANFD_Attrs::intrPriority
uint8_t intrPriority
Definition: canfd.h:1059
CANFD_Reason_TX_COMPLETION
@ CANFD_Reason_TX_COMPLETION
Data has been succesfully transmitted.
Definition: canfd.h:507
CANFD_ErrorCallbackFxn
void(* CANFD_ErrorCallbackFxn)(void *args, CANFD_Reason reason, CANFD_ErrStatusResp *errStatusResp)
The definition of a callback function used by the CANFD driver when used in CANFD_TRANSFER_MODE_CALLB...
Definition: canfd.h:1129
CANFD_MCANECCErrType
uint32_t CANFD_MCANECCErrType
This enumeration defines the MCAN ECC Error Types.
Definition: canfd.h:386
CANFD_Attrs::OptionTLVtype
uint32_t OptionTLVtype
Definition: canfd.h:1062
CANFD_MCANECCErrStatus::row
uint32_t row
Definition: canfd.h:1008
CANFD_DmaRxBuf
Definition: canfd.h:1509
CANFD_MCANElemSize_20BYTES
@ CANFD_MCANElemSize_20BYTES
Definition: canfd.h:279
CANFD_MCANErrCode_BIT0_ERROR
@ CANFD_MCANErrCode_BIT0_ERROR
Definition: canfd.h:474
CANFD_MCANTimeOutSelect_CONT
@ CANFD_MCANTimeOutSelect_CONT
Definition: canfd.h:366
CANFD_MCANElemSize_8BYTES
@ CANFD_MCANElemSize_8BYTES
Definition: canfd.h:270
CANFD_MCANElemSize_24BYTES
@ CANFD_MCANElemSize_24BYTES
Definition: canfd.h:282
CANFD_MCANBitTimingParams::dataPseg1
uint32_t dataPseg1
Definition: canfd.h:663
CANFD_Attrs::intrNum0
uint32_t intrNum0
Definition: canfd.h:1050
CANFD_MCANGlobalFiltConfig::anfs
uint32_t anfs
Definition: canfd.h:723
CANFD_MCANProtocolStatus
Definition: canfd.h:887
CANFD_Attrs::CANFDMcanBitTimingParams
CANFD_MCANBitTimingParams CANFDMcanBitTimingParams
Definition: canfd.h:1068
CANFD_MCANLoopbackCfgParams::mode
CANFD_MCANLoopBackMode mode
Definition: canfd.h:628
CANFD_MCANErrCntStatus::rpStatus
uint32_t rpStatus
Definition: canfd.h:874
CANFD_MCANMsgRAMCfgParams::txBufNum
uint32_t txBufNum
Definition: canfd.h:759
CANFD_MCANOperationMode_SW_INIT
@ CANFD_MCANOperationMode_SW_INIT
Definition: canfd.h:307
HwiP.h
CANFD_MCANFrameType_FD
@ CANFD_MCANFrameType_FD
Definition: canfd.h:354
CANFD_OptionTLV::type
CANFD_Option type
Option Name.
Definition: canfd.h:1099
CANFD_createMsgObject
int32_t CANFD_createMsgObject(CANFD_Handle handle, CANFD_MessageObject *ptrCanMsgObj)
Function configures the receive or transmit message object. It also enables Tx completion and Tx canc...
CANFD_createDmaTxMsgObject
int32_t CANFD_createDmaTxMsgObject(const CANFD_Object *ptrCanFdObj, CANFD_MessageObject *ptrCanMsgObj)
API to configure dma for the Tx message object. Called from the API CANFD_createMsgObject.
MCAN_MAX_TX_MSG_OBJECTS
#define MCAN_MAX_TX_MSG_OBJECTS
Maximum number of Tx message objects that can be supported by CANFD.
Definition: mcan.h:383
CANFD_MessageObject::interruptsRxed
uint32_t interruptsRxed
Number of interrupts received.
Definition: canfd.h:1598
CANFD_Object::readTransferSemObj
SemaphoreP_Object readTransferSemObj
Definition: canfd.h:1425
CANFD_open
CANFD_Handle CANFD_open(uint32_t index, CANFD_OpenParams *openPrms)
This function opens a given CANFD peripheral.
CANFD_Option_MCAN_ERROR_COUNTER
@ CANFD_Option_MCAN_ERROR_COUNTER
Definition: canfd.h:562
CANFD_OpenParams::tdcEnable
uint32_t tdcEnable
Definition: canfd.h:1231
CANFD_MCANLoopBackMode_INTERNAL
@ CANFD_MCANLoopBackMode_INTERNAL
Definition: canfd.h:403
CANFD_MCANECCErrForceParams::errOnce
uint32_t errOnce
Definition: canfd.h:978
CANFD_MCANProtocolStatus::rfdf
uint32_t rfdf
Definition: canfd.h:939
CANFD_OpenParams::efbi
uint32_t efbi
Definition: canfd.h:1177
CANFD_OpenParams::clkStopFAck
uint32_t clkStopFAck
Definition: canfd.h:1220
MCAN_MAX_RX_BUFFERS
#define MCAN_MAX_RX_BUFFERS
Maximum number of Rx buffers.
Definition: canfd.h:198
CANFD_getBitTime
void CANFD_getBitTime(CANFD_Handle canfdHandle)
This API will get the configured bit timings for MCAN module.
CANFD_OpenParams::errorCallbackFxn
CANFD_ErrorCallbackFxn errorCallbackFxn
Definition: canfd.h:1151
CANFD_MCANLoopBackMode_EXTERNAL
@ CANFD_MCANLoopBackMode_EXTERNAL
Definition: canfd.h:409
CANFD_getFilterEventConfig
uint32_t CANFD_getFilterEventConfig(uint32_t eventNum)
CANFD_MCANErrCode_FORM_ERROR
@ CANFD_MCANErrCode_FORM_ERROR
Definition: canfd.h:453
CANFD_OpenParams::pxhddisable
uint32_t pxhddisable
Definition: canfd.h:1183
CANFD_addClockStopRequest
void CANFD_addClockStopRequest(CANFD_Handle canfdHandle, uint32_t enable)
This API add clock stop request for MCAN module to put it in power down mode.
CANFD_MCANXidType
CANFD_MCANXidType
Definition: canfd.h:334
CANFD_MCANErrCode_CRC_ERROR
@ CANFD_MCANErrCode_CRC_ERROR
Definition: canfd.h:480
CANFD_MCANElemSize_12BYTES
@ CANFD_MCANElemSize_12BYTES
Definition: canfd.h:273
CANFD_MCANECCErrStatus::dedErr
uint32_t dedErr
Definition: canfd.h:1003
CANFD_MCANMsgRAMCfgParams::rxFIFO1OpMode
uint32_t rxFIFO1OpMode
Definition: canfd.h:826
CANFD_MCANTdcConfig::tdcf
uint32_t tdcf
Definition: canfd.h:683
CANFD_MCANXidType_11_BIT
@ CANFD_MCANXidType_11_BIT
Definition: canfd.h:336
CANFD_deleteDmaTxMsgObject
int32_t CANFD_deleteDmaTxMsgObject(const CANFD_Object *ptrCanFdObj, const CANFD_MessageObject *ptrCanMsgObj)
API to delete dma configuration for the Tx message object. Called from the API CANFD_deleteMsgObject.
CANFD_MessageObject::rxMemType
MCAN_MemType rxMemType
Part of message ram to accessed by this message object. Refer enum MCAN_MemType.
Definition: canfd.h:1588
MCAN_MemType
uint32_t MCAN_MemType
Enum to represent the MCAN Message RAM type.
Definition: mcan.h:451
CANFD_MCANMsgRAMCfgParams::lss
uint32_t lss
Definition: canfd.h:745
CANFD_configureDmaRx
int32_t CANFD_configureDmaRx(const CANFD_Object *ptrCanFdObj, CANFD_MessageObject *ptrCanMsgObj, uint32_t dataLengthPerMsg, uint32_t numMsgs, const void *data)
API to enable dma event transfer for the Rx. Called from the API CANFD_readDma.
CANFD_MCANErrCode_ACK_ERROR
@ CANFD_MCANErrCode_ACK_ERROR
Definition: canfd.h:456
CANFD_MCANMsgObjectStats::startMsgIdentifier
uint32_t startMsgIdentifier
Definition: canfd.h:1653
MCAN_RevisionId
Structure for accessing Revision ID and Core Release Info. of MCAN module.
Definition: mcan.h:1288
CANFD_int1Isr
void CANFD_int1Isr(void *args)
The function is the registered interrupt 1 ISR for the CANFD Driver.
CANFD_MCANCommState_IDLE
@ CANFD_MCANCommState_IDLE
Definition: canfd.h:425
CANFD_OpenParams::fdMode
uint32_t fdMode
Definition: canfd.h:1157
CANFD_OpenParams::transferMode
uint32_t transferMode
Definition: canfd.h:1145
CANFD_MCANMsgRAMCfgParams::lse
uint32_t lse
Definition: canfd.h:752
CANFD_MCANECCErrStatus
Definition: canfd.h:992
CANFD_writeDmaTriggerNext
int32_t CANFD_writeDmaTriggerNext(CANFD_MsgObjHandle handle)
Function used by the application to start transmission of next msg in dma mode. Transfer should be in...
CANFD_Object::hwiObj1
HwiP_Object hwiObj1
Definition: canfd.h:1442
CANFD_OpenParams::tdcConfig
CANFD_MCANTdcConfig tdcConfig
Definition: canfd.h:1236
CANFD_deleteMsgObject
int32_t CANFD_deleteMsgObject(CANFD_MsgObjHandle handle)
Function deletes a message object.
CANFD_MCANBitTimingParams::dataPropSeg
uint32_t dataPropSeg
Definition: canfd.h:660
CANFD_DmaMsgConfig::numMsgs
uint32_t numMsgs
Number of messages.
Definition: canfd.h:1485
CANFD_OpenParams::filterConfig
CANFD_MCANGlobalFiltConfig filterConfig
Definition: canfd.h:1285
CANFD_Object::useFifoNum
uint32_t useFifoNum
Flag to toggle the usage of FIFO 0 and FIFO 1. Valid values are 0 and 1.
Definition: canfd.h:1397
CANFD_Attrs::filterConfig
void * filterConfig
void pointer to MCAN_ExtMsgIDFilterElement or MCAN_StdMsgIDFilterElement structure....
Definition: canfd.h:1081
CANFD_MCANMsgRAMCfgParams::txFIFOSize
uint32_t txFIFOSize
Definition: canfd.h:766
CANFD_DmaRxBuf::header1
uint32_t header1
Definition: canfd.h:1511
CANFD_OpenParams::msgRAMConfig
CANFD_MCANMsgRAMCfgParams msgRAMConfig
Definition: canfd.h:1290
CANFD_Reason_SRC_RX_FIFO0_MSG_LOST
@ CANFD_Reason_SRC_RX_FIFO0_MSG_LOST
Rx FIFO 0 Message Lost.
Definition: canfd.h:537
CANFD_MCANErrCntStatus::recErrCnt
uint32_t recErrCnt
Definition: canfd.h:868
CANFD_getTxPinState
uint32_t CANFD_getTxPinState(CANFD_Handle canfdHandle)
This API will return Tx pin state of MCAN module.
HwiP_Object
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:142
CANFD_int0Isr
void CANFD_int0Isr(void *args)
The function is the registered interrupt 0 ISR for the CANFD Driver.
CANFD_OpenParams::autoWkupEnable
uint32_t autoWkupEnable
Definition: canfd.h:1202
CANFD_Direction
CANFD_Direction
Definition: canfd.h:318
CANFD_MCANBitTimingParams::nomPropSeg
uint32_t nomPropSeg
Definition: canfd.h:645
CANFD_MCANMsgRAMCfgParams::rxFIFO0OpMode
uint32_t rxFIFO0OpMode
Definition: canfd.h:806
CANFD_DmaMsgConfig
Definition: canfd.h:1477
CANFD_Option_MCAN_PROTOCOL_STATUS
@ CANFD_Option_MCAN_PROTOCOL_STATUS
Definition: canfd.h:570
CANFD_MCANGlobalFiltConfig::anfe
uint32_t anfe
Definition: canfd.h:716
CANFD_MCANECCErrForceParams::errForce
uint32_t errForce
Definition: canfd.h:981
CANFD_OpenParams::monEnable
uint32_t monEnable
Definition: canfd.h:1242
CANFD_MCANMsgRAMCfgParams
Definition: canfd.h:739
CANFD_Object
Definition: canfd.h:1318
CANFD_MCANECCErrStatus::bit2
uint32_t bit2
Definition: canfd.h:1017
CANFD_MCANErrCode_NO_ERROR
@ CANFD_MCANErrCode_NO_ERROR
Definition: canfd.h:445
CANFD_MAX_DLC_MAPPING
#define CANFD_MAX_DLC_MAPPING
Maximum data to DLC mapping supported. Refer MCAN_DataLengthSize.
Definition: canfd.h:239
CANFD_Reason_PROTOCOL_ERR_ARB_PHASE
@ CANFD_Reason_PROTOCOL_ERR_ARB_PHASE
Protocol error in arbitration phase detected.
Definition: canfd.h:532
CANFD_MCANOperationMode
CANFD_MCANOperationMode
Definition: canfd.h:302
CANFD_MCANProtocolStatus::lastErrCode
uint32_t lastErrCode
Definition: canfd.h:891
CANFD_MCANBitTimingParams::nomPseg1
uint32_t nomPseg1
Definition: canfd.h:648
CANFD_MCANTimeOutSelect
CANFD_MCANTimeOutSelect
Definition: canfd.h:364
CANFD_Attrs
Definition: canfd.h:1045
CANFD_Direction_RX
@ CANFD_Direction_RX
Definition: canfd.h:320
CANFD_OpenParams::timeoutSelect
CANFD_MCANTimeOutSelect timeoutSelect
Definition: canfd.h:1267
CANFD_OpenParams::eccConfig
CANFD_MCANECCConfigParams eccConfig
Definition: canfd.h:1295
CANFD_MCANCommState_RECEIVER
@ CANFD_MCANCommState_RECEIVER
Definition: canfd.h:428
CANFD_Object::rxBuffElem
MCAN_RxBufElement rxBuffElem
Buffer used to read message RAM.
Definition: canfd.h:1402
CANFD_Object::regBaseAddress
uint32_t regBaseAddress
Base address of the register address space to be used.
Definition: canfd.h:1327
CANFD_DmaRxBuf::header2
uint32_t header2
Definition: canfd.h:1513
CANFD_MCANMsgRAMCfgParams::txEventFIFOSize
uint32_t txEventFIFOSize
Definition: canfd.h:779
CANFD_MCANMsgRAMCfgParams::rxFIFO0waterMark
uint32_t rxFIFO0waterMark
Definition: canfd.h:800
CANFD_OpenParams::wdcPreload
uint32_t wdcPreload
Definition: canfd.h:1225
CANFD_MCANOperationMode_NORMAL
@ CANFD_MCANOperationMode_NORMAL
Definition: canfd.h:304
CANFD_MCANECCErrForceParams::bit2
uint32_t bit2
Definition: canfd.h:973
CANFD_OptionTLV::length
int32_t length
Option Length.
Definition: canfd.h:1104
CANFD_Attrs::intrNum1
uint32_t intrNum1
Definition: canfd.h:1053
CANFD_getOptions
int32_t CANFD_getOptions(CANFD_Handle handle, const CANFD_OptionTLV *ptrOptInfo)
Function is used by the application to get the error and status information from the driver.
CANFD_OpenParams::wkupReqEnable
uint32_t wkupReqEnable
Definition: canfd.h:1196
CANFD_setOptions
int32_t CANFD_setOptions(CANFD_Handle handle, const CANFD_OptionTLV *ptrOptInfo)
Function is used by the application to configure the driver options.
CANFD_MCANTdcConfig
Definition: canfd.h:679
CANFD_MessageObject::rxElement
uint32_t rxElement
Rx buffer number used to receive data.
Definition: canfd.h:1576
CANFD_MessageObject::direction
CANFD_Direction direction
Message object direction.
Definition: canfd.h:1550
CANFD_Object::errStatusInterrupts
uint32_t errStatusInterrupts
Number of error and status interrupts received.
Definition: canfd.h:1362
CANFD_Reason_TX_CANCELED
@ CANFD_Reason_TX_CANCELED
Data transmission is succesfully canceled.
Definition: canfd.h:512
CANFD_MCANECCErrStatus::bit1
uint32_t bit1
Definition: canfd.h:1012
CANFD_getRevisionId
void CANFD_getRevisionId(CANFD_Handle canfdHandle)
This API is used get the MCAN revision ID.
CANFD_MCANBitTimingParams::nomBrp
uint32_t nomBrp
Definition: canfd.h:642
CANFD_write
int32_t CANFD_write(CANFD_MsgObjHandle handle, uint32_t id, CANFD_MCANFrameType frameType, uint32_t numMsgs, const uint8_t *data)
Function used by the application to transmit data.
CANFD_MCANECCErrForceParams::rowNum
uint32_t rowNum
Definition: canfd.h:965
CANFD_MCANMsgObjectStats::interruptsRxed
uint32_t interruptsRxed
Definition: canfd.h:1662
CANFD_Object::writeTransferSemObj
SemaphoreP_Object writeTransferSemObj
Definition: canfd.h:1433
CANFD_Reason
CANFD_Reason
Definition: canfd.h:497
CANFD_Attrs::txMemType
uint32_t txMemType
Definition: canfd.h:1071
mcan.h
This file contains the prototypes of the APIs present in the device abstraction layer file of MCAN....
CANFD_MCANMsgRAMCfgParams::rxFIFO1waterMark
uint32_t rxFIFO1waterMark
Definition: canfd.h:820
CANFD_Config::attrs
CANFD_Attrs * attrs
Definition: canfd.h:1463
CANFD_MCANProtocolStatus::pxe
uint32_t pxe
Definition: canfd.h:945
CANFD_Object::eccInterrupts
uint32_t eccInterrupts
Number of ECC interrupts received.
Definition: canfd.h:1372
CANFD_MCANECCConfigParams
Definition: canfd.h:836
CANFD_MessageObject::filterConfig
void * filterConfig
void pointer to MCAN_ExtMsgIDFilterElement or MCAN_StdMsgIDFilterElement structure....
Definition: canfd.h:1624
CANFD_MCANECCErrStatus::secErr
uint32_t secErr
Definition: canfd.h:997
CANFD_Option
CANFD_Option
Definition: canfd.h:555
CANFD_MCANBitTimingParams::dataBrp
uint32_t dataBrp
Definition: canfd.h:657
CANFD_readDmaConfig
int32_t CANFD_readDmaConfig(CANFD_MsgObjHandle handle, const void *data, uint32_t numMsgs)
Function is used by the application to configure reading the received msgs from message ram....
CANFD_MCANMsgObjectStats::direction
uint32_t direction
Definition: canfd.h:1647
CANFD_OpenParams::emulationFAck
uint32_t emulationFAck
Definition: canfd.h:1214
CANFD_MCANElemSize_48BYTES
@ CANFD_MCANElemSize_48BYTES
Definition: canfd.h:288
CANFD_OpenParams::tsSelect
uint32_t tsSelect
Definition: canfd.h:1262
CANFD_MessageObject::args
void * args
Pointer to be used by application to store rx buffer.
Definition: canfd.h:1617
CANFD_Object::state
uint32_t state
CANFD driver internal state.
Definition: canfd.h:1332
CANFD_OpenParams::errInterruptEnable
uint32_t errInterruptEnable
Definition: canfd.h:1299
CANFD_MCANMsgObjectStats::messageProcessed
uint32_t messageProcessed
Definition: canfd.h:1665
CANFD_MCANMsgRAMCfgParams::rxFIFO0size
uint32_t rxFIFO0size
Definition: canfd.h:793
CANFD_MCANGlobalFiltConfig
Definition: canfd.h:698
CANFD_MessageObject::txMemType
MCAN_MemType txMemType
Part of message ram to accessed by this message object. Refer enum MCAN_MemType.
Definition: canfd.h:1582
CANFD_getTSCounterVal
uint32_t CANFD_getTSCounterVal(CANFD_Handle canfdHandle)
This API will return current timestamp counter value.
CANFD_clockStopReq
uint32_t CANFD_clockStopReq(CANFD_Handle canfdHandle)
This API get clock stop acknowledgement for MCAN module. It return whether MCAN is power down mode or...
CANFD_Attrs::baseAddr
uint32_t baseAddr
Definition: canfd.h:1047
CANFD_MessageObject::rxFifoNum
uint32_t rxFifoNum
FIFO Num (MCAN_RX_FIFO_NUM_0/MCAN_RX_FIFO_NUM_1).
Definition: canfd.h:1593
CANFD_writeDma
int32_t CANFD_writeDma(CANFD_MsgObjHandle handle, uint32_t id, CANFD_MCANFrameType frameType, uint32_t numMsgs, const void *data)
Function used by the application to initiate transmit data in dma mode. DMA mode is recommended to be...
CANFD_MessageObject::canfdHandle
CANFD_Config * canfdHandle
Pointer to the CANFD driver object.
Definition: canfd.h:1545
CANFD_MCANLoopbackCfgParams::enable
uint32_t enable
Definition: canfd.h:625
CANFD_DmaMsgConfig::dataLengthPerMsg
uint32_t dataLengthPerMsg
data length in Bytes for every message.
Definition: canfd.h:1481
CANFD_MessageObject::messageProcessed
uint32_t messageProcessed
Number of messages processed.
Definition: canfd.h:1603
CANFD_createRxRangeMsgObject
int32_t CANFD_createRxRangeMsgObject(CANFD_Handle handle, CANFD_MessageObject *ptrCanMsgObj)
Function configures a receive message objects for a range of message identifiers. It also enables Rx ...