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