]> rtime.felk.cvut.cz Git - arc.git/blob - examples/switch_node/config/mpc5567qrtech/Can_Cfg.h
Starting 'pdur2' branch with copied content from remote repository.
[arc.git] / examples / switch_node / config / mpc5567qrtech / Can_Cfg.h
1 /*\r
2 * Configuration of module: Can (Can_Cfg.h)\r
3 *\r
4 * Created by:              Arccore AB\r
5 * Copyright:               \r
6 *\r
7 * Configured for (MCU):    MPC5567\r
8 *\r
9 * Module vendor:           ArcCore\r
10 * Generator version:       2.0.2\r
11 *\r
12 * Generated by Arctic Studio (http://arccore.com) \r
13 *           on Thu Mar 10 10:50:24 CET 2011\r
14 */\r
15 \r
16
17 #if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )\r
18 #error Can: Configuration file expected BSW module version to be 1.0.*\r
19 #endif
20
21         \r
22 \r
23 #ifndef CAN_CFG_H_\r
24 #define CAN_CFG_H_\r
25 \r
26 // Number of controller configs\r
27 #define CAN_ARC_CTRL_CONFIG_CNT         1\r
28 \r
29 #define CAN_DEV_ERROR_DETECT                    STD_OFF\r
30 #define CAN_VERSION_INFO_API                    STD_OFF\r
31 #define CAN_MULTIPLEXED_TRANSMISSION    STD_OFF  // Not supported\r
32 #define CAN_WAKEUP_SUPPORT                              STD_OFF  // Not supported\r
33 #define CAN_HW_TRANSMIT_CANCELLATION    STD_OFF  // Not supported\r
34 \r
35 typedef enum {\r
36         FLEXCAN_A = 0,\r
37         CAN_CTRL_A = 0,\r
38         FLEXCAN_B = 1,\r
39         CAN_CTRL_B = 1,\r
40         FLEXCAN_C = 2,\r
41         CAN_CTRL_C = 2,\r
42         FLEXCAN_D = 3,\r
43         CAN_CTRL_D = 3,\r
44         FLEXCAN_E = 4,\r
45         CAN_CTRL_E = 4,\r
46         CAN_CONTROLLER_CNT = 5\r
47 }CanControllerIdType;\r
48 \r
49 \r
50 typedef enum {\r
51         CAN_ID_TYPE_EXTENDED,\r
52         CAN_ID_TYPE_MIXED,\r
53         CAN_ID_TYPE_STANDARD\r
54 } Can_IdTypeType;\r
55 \r
56 typedef enum {\r
57         CAN_OBJECT_TYPE_RECEIVE,\r
58         CAN_OBJECT_TYPE_TRANSMIT\r
59 } Can_ObjectTypeType;\r
60 \r
61 \r
62 typedef enum {\r
63         CAN_ARC_HANDLE_TYPE_BASIC,\r
64         CAN_ARC_HANDLE_TYPE_FULL\r
65 } Can_Arc_HohType;\r
66 \r
67 \r
68 typedef enum {\r
69         HWObj_1,\r
70         NUM_OF_HTHS\r
71 } Can_Arc_HTHType;\r
72 \r
73 \r
74 typedef enum {\r
75         NUM_OF_HRHS\r
76 } Can_Arc_HRHType;\r
77 \r
78 \r
79 typedef struct {\r
80         void (*CancelTxConfirmation)( const Can_PduType *);\r
81         void (*RxIndication)( uint8 ,Can_IdType ,uint8 , const uint8 * );\r
82         void (*ControllerBusOff)(uint8);\r
83         void (*TxConfirmation)(PduIdType);\r
84         void (*ControllerWakeup)(uint8);\r
85         void (*Arc_Error)(uint8,Can_Arc_ErrorType);\r
86 } Can_CallbackType;\r
87 \r
88 \r
89 typedef struct {\r
90         //      Specifies the InstanceId of this module instance. If only one instance is\r
91         //      present it shall have the Id 0\r
92         uint8 CanIndex;\r
93 } Can_GeneralType;\r
94 \r
95 // Start mc9s12 unique\r
96 typedef enum {\r
97   CAN_ARC_IDAM_2_32BIT,\r
98   CAN_ARC_IDAM_4_16BIT,\r
99   CAN_ARC_IDAM_8_8BIT,\r
100   CAN_ARC_IDAM_FILTER_CLOSED,\r
101 } Can_Arc_IDAMType;\r
102 \r
103 typedef uint32 Can_FilterMaskType;\r
104 \r
105 typedef struct Can_HardwareObjectStruct {\r
106         // Specifies the type (Full-CAN or Basic-CAN) of a hardware object.\r
107         Can_Arc_HohType CanHandleType;\r
108 \r
109         // Specifies whether the IdValue is of type - standard identifier - extended\r
110         // identifier - mixed mode ImplementationType: Can_IdType\r
111         Can_IdTypeType CanIdType;\r
112 \r
113         //      Specifies (together with the filter mask) the identifiers range that passes\r
114         //      the hardware filter.\r
115         uint32 CanIdValue;\r
116 \r
117         //      Holds the handle ID of HRH or HTH. The value of this parameter is unique\r
118         //      in a given CAN Driver, and it should start with 0 and continue without any\r
119         //      gaps. The HRH and HTH Ids are defined under two different name-spaces.\r
120         //      Example: HRH0-0, HRH1-1, HTH0-2, HTH1-3\r
121         uint32 CanObjectId;\r
122 \r
123         // Specifies if the HardwareObject is used as Transmit or as Receive object\r
124         Can_ObjectTypeType CanObjectType;\r
125 \r
126         // Reference to the filter mask that is used for hardware filtering togerther\r
127         // with the CAN_ID_VALUE\r
128         Can_FilterMaskType *CanFilterMaskRef;\r
129 \r
130         // A "1" in this mask tells the driver that that HW Message Box should be\r
131         // occupied by this Hoh. A "1" in bit 31(ppc) occupies Mb 0 in HW.\r
132         uint32 Can_Arc_MbMask;  \r
133         \r
134         // End Of List. Set to TRUE is this is the last object in the list.\r
135         boolean Can_Arc_EOL;\r
136 } Can_HardwareObjectType;\r
137 \r
138 typedef enum {\r
139         CAN_ARC_PROCESS_TYPE_INTERRUPT,\r
140         CAN_ARC_PROCESS_TYPE_POLLING\r
141 } Can_Arc_ProcessType;\r
142 \r
143 typedef struct {\r
144 \r
145         //      Enables / disables API Can_MainFunction_BusOff() for handling busoff\r
146         //      events in polling mode.\r
147         // INTERRUPT or POLLING\r
148         Can_Arc_ProcessType CanBusOffProcessing;\r
149 \r
150         // Defines if a CAN controller is used in the configuration.\r
151         boolean CanControllerActivation;\r
152 \r
153         // Specifies the buadrate of the controller in kbps.\r
154         uint32 CanControllerBaudRate;\r
155 \r
156         //      This parameter provides the controller ID which is unique in a given CAN\r
157         //      Driver. The value for this parameter starts with 0 and continue without any\r
158         //      gaps.\r
159         CanControllerIdType CanControllerId;\r
160 \r
161         // Specifies propagation delay in time quantas.\r
162         uint32 CanControllerPropSeg;\r
163 \r
164         // Specifies phase segment 1 in time quantas.\r
165         uint32 CanControllerSeg1;\r
166 \r
167         // Specifies phase segment 2 in time quantas.\r
168         uint32 CanControllerSeg2;\r
169 \r
170         //      Specifies the time quanta for the controller. The calculation of the resulting\r
171         //      prescaler value depending on module clocking and time quanta shall be\r
172         //      done offline Hardware specific.\r
173         uint32 CanControllerTimeQuanta;\r
174 \r
175         //      Enables / disables API Can_MainFunction_Read() for handling PDU\r
176         //      reception events in polling mode.\r
177         Can_Arc_ProcessType CanRxProcessing;\r
178 \r
179         //      Enables / disables API Can_MainFunction_Write() for handling PDU\r
180         //      transmission events in polling mode.\r
181         Can_Arc_ProcessType CanTxProcessing;\r
182 \r
183         //      Enables / disables API Can_MainFunction_Wakeup() for handling wakeup\r
184         //      events in polling mode.\r
185         Can_Arc_ProcessType CanWakeupProcessing;\r
186 \r
187         //      Reference to the CPU clock configuration, which is set in the MCU driver\r
188         //      configuration\r
189         uint32 CanCpuClockRef;\r
190 \r
191         //      This parameter contains a reference to the Wakeup Source for this\r
192         //      controller as defined in the ECU State Manager. Implementation Type:\r
193         //      reference to EcuM_WakeupSourceType\r
194         uint32 CanWakeupSourceRef;\r
195 \r
196         // List of Hoh id's that belong to this controller\r
197         const Can_HardwareObjectType  *Can_Arc_Hoh;\r
198 \r
199         boolean Can_Arc_Loopback;\r
200 \r
201         // Set this to use the fifo\r
202         boolean Can_Arc_Fifo;\r
203 } Can_ControllerConfigType;\r
204 \r
205 \r
206 typedef struct {\r
207         const Can_ControllerConfigType *CanController;\r
208         \r
209         // Callbacks( Extension )\r
210         const Can_CallbackType *CanCallbacks;\r
211 } Can_ConfigSetType;\r
212 \r
213 \r
214 typedef struct {\r
215         // This is the multiple configuration set container for CAN Driver\r
216         // Multiplicity 1..*\r
217         const Can_ConfigSetType  *CanConfigSet;\r
218         // This container contains the parameters related each CAN\r
219         // Driver Unit.\r
220         // Multiplicity 1..*\r
221         const Can_GeneralType    *CanGeneral;\r
222 } Can_ConfigType;\r
223 \r
224 \r
225 extern const Can_ConfigType CanConfigData;\r
226 extern const Can_ControllerConfigType CanControllerConfigData[];\r
227 extern const Can_ConfigSetType Can_ConfigSet;\r
228 \r
229 #endif /*CAN_CFG_H_*/\r