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