1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
26 // Imported structs from Can_Lcfg.c
\r
27 extern const Can_ControllerConfigType CanControllerConfigData[];
\r
28 extern const Can_ConfigSetType CanConfigSetData;
\r
31 // Container that gets slamed into CanIf_InitController()
\r
32 // Inits ALL controllers
\r
33 // Multiplicity 1..*
\r
34 const CanIf_ControllerConfigType CanIfControllerConfig[] =
\r
36 { // This is the ConfigurationIndex in CanIf_InitController()
\r
37 .WakeupSupport = CANIF_WAKEUP_SUPPORT_NO_WAKEUP,
\r
38 .CanIfControllerIdRef = CAN_CTRL_A,
\r
39 .CanIfDriverNameRef = "FLEXCAN", // Not used
\r
40 .CanIfInitControllerRef = &CanControllerConfigData[0],
\r
43 .WakeupSupport = CANIF_WAKEUP_SUPPORT_NO_WAKEUP,
\r
44 .CanIfControllerIdRef = CAN_CTRL_C,
\r
45 .CanIfDriverNameRef = "FLEXCAN", // Not used
\r
46 .CanIfInitControllerRef = &CanControllerConfigData[1],
\r
50 // Function callbacks for higher layers
\r
51 const CanIf_DispatchConfigType CanIfDispatchConfig =
\r
53 .CanIfBusOffNotification = NULL,
\r
54 .CanIfWakeUpNotification = NULL, // Not used
\r
55 .CanIfWakeupValidNotification = NULL, // Not used
\r
56 .CanIfErrorNotificaton = NULL,
\r
59 //-------------------------------------------------------------------
\r
60 const CanIf_HthConfigType CanIfHthConfigData[] =
\r
63 .CanIfHthType = CAN_ECORE_HANDLE_TYPE_BASIC,
\r
64 .CanIfCanControllerIdRef = CAN_CTRL_A,
\r
65 .CanIfHthIdSymRef = CAN_HTH_A_1, // Ref to the HTH
\r
69 .CanIfHthType = CAN_ECORE_HANDLE_TYPE_BASIC,
\r
70 .CanIfCanControllerIdRef = CAN_CTRL_C,
\r
71 .CanIfHthIdSymRef = CAN_HTH_C_1, // Ref to the HTH
\r
76 //-------------------------------------------------------------------
\r
77 const CanIf_HrhConfigType CanIfHrhConfigData[] =
\r
80 .CanIfHrhType = CAN_ECORE_HANDLE_TYPE_BASIC,
\r
81 .CanIfSoftwareFilterHrh = TRUE, // Disable software filtering
\r
82 .CanIfCanControllerHrhIdRef = CAN_CTRL_A,
\r
83 .CanIfHrhIdSymRef = CAN_HRH_A_1, // Ref to the HRH
\r
87 .CanIfHrhType = CAN_ECORE_HANDLE_TYPE_BASIC,
\r
88 .CanIfSoftwareFilterHrh = TRUE, // Disable software filtering
\r
89 .CanIfCanControllerHrhIdRef = CAN_CTRL_C,
\r
90 .CanIfHrhIdSymRef = CAN_HRH_C_1, // Ref to the HRH
\r
94 //-------------------------------------------------------------------
\r
99 const CanIf_TxPduConfigType CanIfTxPduConfigData[] =
\r
102 .CanIfTxPduId = PDU_MSG_HARDWARE_TEST_ENGINE_STATUS, //PDU_MSG_TX789,
\r
103 .CanIfCanTxPduIdCanId = 0x0000000,
\r
104 .CanIfCanTxPduIdDlc = 8,
\r
105 .CanIfCanTxPduType = CANIF_PDU_TYPE_STATIC,
\r
106 #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON )
\r
107 .CanIfReadTxPduNotifyStatus = FALSE,
\r
109 .CanIfTxPduIdCanIdType = CANIF_CAN_ID_TYPE_29,
\r
110 .CanIfUserTxConfirmation = PduR_CanIfTxConfirmation, //NULL,
\r
111 .CanIfCanTxPduHthRef = &CanIfHthConfigData[0], // Send on controller A,
\r
115 .CanIfTxPduId = PDU_MSG_TX987,
\r
116 .CanIfCanTxPduIdCanId = 0x0000100,
\r
117 .CanIfCanTxPduIdDlc = 8,
\r
118 .CanIfCanTxPduType = CANIF_PDU_TYPE_DYNAMIC,
\r
119 #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON )
\r
120 .CanIfReadTxPduNotifyStatus = FALSE,
\r
122 .CanIfTxPduIdCanIdType = CANIF_CAN_ID_TYPE_29,
\r
123 .CanIfUserTxConfirmation = NULL,
\r
124 .CanIfCanTxPduHthRef = &CanIfHthConfigData[1], // Send on controller C,
\r
129 .CanIfTxPduId = 2, //PDU_MSG_TX789,
\r
130 .CanIfCanTxPduIdCanId = 0x0000200,
\r
131 .CanIfCanTxPduIdDlc = 8,
\r
132 .CanIfCanTxPduType = CANIF_PDU_TYPE_STATIC,
\r
133 #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON )
\r
134 .CanIfReadTxPduNotifyStatus = FALSE,
\r
136 .CanIfTxPduIdCanIdType = CANIF_CAN_ID_TYPE_29,
\r
137 .CanIfUserTxConfirmation = PduR_CanIfTxConfirmation, // NULL
\r
138 .CanIfCanTxPduHthRef = &CanIfHthConfigData[0], // Send on controller A,
\r
142 //-------------------------------------------------------------------
\r
147 const CanIf_RxPduConfigType CanIfRxPduConfigData[] =
\r
150 .CanIfCanRxPduId = PDU_MSG_HARDWARE_TEST_ENGINE_CONTROL, //PDU_MSG_RX234,
\r
151 .CanIfCanRxPduCanId = 1, // CAN ID
\r
152 .CanIfCanRxPduDlc = 8, //DLC
\r
153 #if ( CANIF_CANPDUID_READDATA_API == STD_ON )
\r
154 .CanIfReadRxPduData = FALSE, // no buffering
\r
156 #if ( CANIF_READRXPDU_NOTIF_STATUS_API == STD_ON )
\r
157 .CanIfReadRxPduNotifyStatus = FALSE, // No indication
\r
159 .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_29,
\r
160 .CanIfRxUserType = CANIF_USER_TYPE_CAN_PDUR, // CANIF_USER_TYPE_CAN_SPECIAL, // Changed by Mattias to test PDU router and Com layer.
\r
161 .CanIfUserRxIndication = NULL, // No indication
\r
162 .CanIfCanRxPduHrhRef = &CanIfHrhConfigData[0], // Received on controller A
\r
163 .PduIdRef = NULL, // Could be used by upper layers
\r
164 .CanIfSoftwareFilterType = CANIF_SOFTFILTER_TYPE_MASK, // Not enabled in HRH
\r
165 .CanIfCanRxPduCanIdMask = 0xFFF,
\r
168 .CanIfCanRxPduId = PDU_MSG_HARDWARE_TEST_ROUTED_MSG, //PDU_MSG_RX123,
\r
169 .CanIfCanRxPduCanId = 0x02, // CAN ID
\r
170 .CanIfCanRxPduDlc = 8, //DLC
\r
171 #if ( CANIF_CANPDUID_READDATA_API == STD_ON )
\r
172 .CanIfReadRxPduData = FALSE, // no buffering
\r
174 #if ( CANIF_READRXPDU_NOTIF_STATUS_API == STD_ON )
\r
175 .CanIfReadRxPduNotifyStatus = FALSE, // No indication
\r
177 .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_29, //
\r
178 .CanIfRxUserType = CANIF_USER_TYPE_CAN_PDUR, // CANIF_USER_TYPE_CAN_SPECIAL,
\r
179 .CanIfUserRxIndication = NULL, // No indication
\r
180 .CanIfCanRxPduHrhRef = &CanIfHrhConfigData[0], //&CanIfHrhConfigData[1], // Received on controller C
\r
181 .PduIdRef = NULL, //
\r
182 .CanIfSoftwareFilterType = CANIF_SOFTFILTER_TYPE_MASK, // Not enabled in HRH
\r
183 .CanIfCanRxPduCanIdMask = 0xFFF,
\r
188 //-------------------------------------------------------------------
\r
189 const CanIf_InitHohConfigType CanIfHohConfigData[] =
\r
192 .CanConfigSet = &CanConfigSetData,
\r
193 .CanIfHrhConfig = CanIfHrhConfigData,
\r
194 .CanIfHthConfig = CanIfHthConfigData,
\r
195 .CanIfEcoreEOL = 1,
\r
199 // This container contains the init parameters of the CAN
\r
200 // Multiplicity 1..*
\r
201 const CanIf_InitConfigType CanIfInitConfig =
\r
203 .CanIfConfigSet = 0, // Not used
\r
204 .CanIfNumberOfCanRxPduIds = sizeof(CanIfRxPduConfigData)/sizeof(CanIf_RxPduConfigType),
\r
205 .CanIfNumberOfCanTXPduIds = sizeof(CanIfTxPduConfigData)/sizeof(CanIf_TxPduConfigType),
\r
206 .CanIfNumberOfDynamicCanTXPduIds = 0, // Not used
\r
209 .CanIfHohConfigPtr = CanIfHohConfigData,
\r
210 .CanIfRxPduConfigPtr = CanIfRxPduConfigData,
\r
211 .CanIfTxPduConfigPtr = CanIfTxPduConfigData,
\r
214 // This container includes all necessary configuration sub-containers
\r
215 // according the CAN Interface configuration structure.
\r
216 CanIf_ConfigType CanIf_Config =
\r
218 .ControllerConfig = CanIfControllerConfig,
\r
219 .DispatchConfig = &CanIfDispatchConfig,
\r
220 .InitConfig = &CanIfInitConfig,
\r
221 .TransceiverConfig = NULL, // Not used
\r