]> rtime.felk.cvut.cz Git - arc.git/blobdiff - boards/ti_tms570ls/examples/tms570_hdk_can/config/PduR_PbCfg.c
Added an example of CAN communication for the TMS570LS31x HDK
[arc.git] / boards / ti_tms570ls / examples / tms570_hdk_can / config / PduR_PbCfg.c
diff --git a/boards/ti_tms570ls/examples/tms570_hdk_can/config/PduR_PbCfg.c b/boards/ti_tms570ls/examples/tms570_hdk_can/config/PduR_PbCfg.c
new file mode 100644 (file)
index 0000000..366b4b2
--- /dev/null
@@ -0,0 +1,136 @@
+/*\r
+* Configuration of module: PduR (PduR_PbCfg.c)\r
+*\r
+* Created by:              ArcCore\r
+* Copyright:               \r
+*\r
+* Configured for (MCU):    TMS570\r
+*\r
+* Module vendor:           ArcCore\r
+* Generator version:       3.1.10\r
+*\r
+* Generated by Arctic Studio (http://arccore.com) \r
+*/\r
+\r
+\r
+#include "PduR.h"\r
+\r
+\r
+#if PDUR_CANIF_SUPPORT == STD_ON\r
+#include "CanIf.h"\r
+#endif\r
+#if PDUR_CANTP_SUPPORT == STD_ON\r
+#include "CanTp.h"\r
+#endif\r
+#if PDUR_LINIF_SUPPORT == STD_ON\r
+#include "LinIf.h"\r
+#endif\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+#include "Com.h"\r
+#endif\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+#include "Dcm.h"\r
+#endif\r
+#if PDUR_J1939TP_SUPPORT == STD_ON\r
+#include "J1939Tp.h"\r
+#endif\r
+\r
+\r
+\r
+PduRTpBufferInfo_type PduRTpBuffers[] = {\r
+       {\r
+               .pduInfoPtr = NULL,\r
+               .status = PDUR_BUFFER_FREE,\r
+               .bufferSize = 0\r
+       }\r
+};\r
+\r
+PduRTpBufferInfo_type *PduRTpRouteBufferPtrs[] = {\r
+   NULL\r
+};\r
+\r
+const PduRDestPdu_type PduRDestination_FreqInd_PduRDestination = {\r
+               .DestModule = ARC_PDUR_CANIF,\r
+               .DestPduId = CANIF_PDU_ID_FreqInd,\r
+               .DataProvision = PDUR_NO_PROVISION,\r
+               .TxBufferRef = NULL\r
+};\r
+const PduRDestPdu_type PduRDestination_FreqReq_PduRDestination = {\r
+               .DestModule = ARC_PDUR_COM,\r
+               .DestPduId = COM_PDU_ID_FreqReq,\r
+               .DataProvision = PDUR_NO_PROVISION,\r
+               .TxBufferRef = NULL\r
+};\r
+const PduRDestPdu_type PduRDestination_RX_PDU_PduRDestination = {\r
+               .DestModule = ARC_PDUR_COM,\r
+               .DestPduId = COM_PDU_ID_RX_PDU,\r
+               .DataProvision = PDUR_DIRECT,   // The PDU Router shall call the transmit function in the destination module and not buffer the I-PDU\r
+               .TxBufferRef = NULL\r
+};\r
+const PduRDestPdu_type PduRDestination_TX_PDU_PduRDestination = {\r
+               .DestModule = ARC_PDUR_CANIF,\r
+               .DestPduId = CANIF_PDU_ID_TX_PDU,\r
+               .DataProvision = PDUR_DIRECT,\r
+               .TxBufferRef = NULL\r
+};\r
+\r
+const PduRDestPdu_type * const PduRDestinations_FreqInd[] = {\r
+       &PduRDestination_FreqInd_PduRDestination,\r
+       NULL\r
+};\r
+const PduRDestPdu_type * const PduRDestinations_FreqReq[] = {\r
+       &PduRDestination_FreqReq_PduRDestination,\r
+       NULL\r
+};\r
+const PduRDestPdu_type * const PduRDestinations_RX_PDU[] = {\r
+       &PduRDestination_RX_PDU_PduRDestination,\r
+       NULL\r
+};\r
+const PduRDestPdu_type * const PduRDestinations_TX_PDU[] = {\r
+       &PduRDestination_TX_PDU_PduRDestination,\r
+       NULL\r
+};\r
+\r
+\r
+const PduRRoutingPath_type PduRRoutingPath_FreqInd = {\r
+       .SrcModule = ARC_PDUR_COM,\r
+       .SrcPduId = COM_PDU_ID_FreqInd,\r
+       .SduLength = 0,\r
+       .PduRDestPdus = PduRDestinations_FreqInd\r
+};\r
+const PduRRoutingPath_type PduRRoutingPath_FreqReq = {\r
+       .SrcModule = ARC_PDUR_CANIF,\r
+       .SrcPduId = CANIF_PDU_ID_FreqReq,\r
+       .SduLength = 0,\r
+       .PduRDestPdus = PduRDestinations_FreqReq\r
+};\r
+const PduRRoutingPath_type PduRRoutingPath_RX_PDU = {\r
+       .SrcModule = ARC_PDUR_CANIF,\r
+       .SrcPduId = CANIF_PDU_ID_RX_PDU,\r
+       .SduLength = 8,\r
+       .PduRDestPdus = PduRDestinations_RX_PDU\r
+};\r
+const PduRRoutingPath_type PduRRoutingPath_TX_PDU = {\r
+       .SrcModule = ARC_PDUR_COM,\r
+       .SrcPduId = COM_PDU_ID_TX_PDU,\r
+       .SduLength = 8,\r
+       .PduRDestPdus = PduRDestinations_TX_PDU\r
+};\r
+\r
+\r
+const PduRRoutingPath_type * const PduRRoutingPaths[] = {\r
+       &PduRRoutingPath_FreqInd,\r
+       &PduRRoutingPath_FreqReq,\r
+       &PduRRoutingPath_RX_PDU,\r
+       &PduRRoutingPath_TX_PDU,\r
+       NULL\r
+};\r
+\r
+\r
+PduR_PBConfigType PduR_Config = {\r
+       .PduRConfigurationId = 0,\r
+       .RoutingPaths = PduRRoutingPaths,\r
+       .TpBuffers = PduRTpBuffers,\r
+       .TpRouteBuffers = PduRTpRouteBufferPtrs,\r
+       .NRoutingPaths = 4\r
+};\r