]> rtime.felk.cvut.cz Git - arc.git/blob - boards/mpc5516it/config/LinIf_Cfg.h
Cleanup of some drivers. Re-generated examples for mpc551xsim
[arc.git] / boards / mpc5516it / config / LinIf_Cfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 /** @addtogroup LinIf LIN Interface\r
17  *  @{ */\r
18 \r
19 /** @file LinIf_Cfg.h\r
20  *  Definitions of configuration parameters for LIN Interface.\r
21  */\r
22 \r
23 #warning "This default file may only be used as an example!"\r
24 \r
25 #ifndef LINIF_CFG_H_\r
26 #define LINIF_CFG_H_\r
27 \r
28 #include "Std_Types.h"\r
29 #include "Lin_Cfg.h"\r
30 \r
31 // PDU definitions\r
32 enum {\r
33   PDU_MSG_LIN_TX_1 = 0, // Changed by Mattias original value 101\r
34   PDU_MSG_LIN_RX_1,\r
35   PDU_MSG_LIN_RX_2,\r
36 };\r
37 \r
38 /** Switches the Development Error Detection and Notification\r
39 ON or OFF. */\r
40 #define LINIF_DEV_ERROR_DETECT STD_ON\r
41 \r
42 /** States if multiple drivers are included in the LIN Interface or not. The\r
43  *  reason for this parameter is to reduce the size of LIN Interface if multiple\r
44  *  drivers are not used. */\r
45 #define LINIF_MULTIPLE_DRIVER_SUPPORT STD_OFF\r
46 \r
47 /** States if the node configuration commands Assign NAD and Conditional\r
48  *  Change NAD are supported. */\r
49 #define LINIF_OPTIONAL_REQUEST_SUPPORTED STD_OFF\r
50 \r
51 /** States if the TP is included in the LIN Interface or not. The reason for this\r
52  *  parameter is to reduce the size of LIN Interface if the TP is not used. */\r
53 #define LINIF_TP_SUPPORTED STD_OFF\r
54 \r
55 /** Switches the LinIf_GetVersionInfo function ON or OFF. */\r
56 #define LINIF_VERSION_INFO_API STD_ON\r
57 \r
58 typedef struct {\r
59         /** Switches the Development Error Detection and Notification\r
60          *  ON or OFF. */\r
61         boolean LinIfDevErrorDetect;\r
62         /** States if multiple drivers are included in the LIN Interface or not. The\r
63          *  reason for this parameter is to reduce the size of LIN Interface if multiple\r
64          *  drivers are not used. */\r
65         boolean LinIfMultipleDriversSupported;\r
66         /** States if the node configuration commands Assign NAD and Conditional\r
67          *  Change NAD are supported. */\r
68         boolean LinIfNcOptionalRequestSupported;\r
69         /** States if the TP is included in the LIN Interface or not. The reason for this\r
70          *  parameter is to reduce the size of LIN Interface if the TP is not used. */\r
71         boolean LinIfTpSupported;\r
72         /** Switches the LinIf_GetVersionInfo function ON or OFF. */\r
73         boolean LinIfVersionInfoApi;\r
74 }LinIf_GeneralType;\r
75 \r
76 typedef enum {\r
77         CLASSIC,\r
78         ENHANCED,\r
79 }LinIf_ChecksumType;\r
80 \r
81 typedef enum {\r
82         ASSIGN,\r
83         ASSIGN_NAD,\r
84         CONDITIONAL,\r
85         EVENT_TRIGGERED,\r
86         FREE,\r
87         MRF,\r
88         SPORADIC,\r
89         SRF,\r
90         UNASSIGN,\r
91         UNCONDITIONAL,\r
92 }LinIf_FrameTypeType;\r
93 \r
94 typedef enum\r
95 {\r
96         LinIfInternalPdu,\r
97         LinIfRxPdu,\r
98         LinIfSlaveToSlavePdu,\r
99         LinIfTxPdu,\r
100 }LinIf_PduDirectionType;\r
101 \r
102 typedef struct {\r
103         LinIf_ChecksumType LinIfChecksumType;\r
104         char* LinIfFrameName;\r
105         uint8 LinIfFramePriority;\r
106         LinIf_FrameTypeType LinIfFrameType;\r
107         uint8 LinIfLength;\r
108         uint8 LinIfPid;\r
109         uint8 LinIfTxTargetPduId;\r
110         uint8 *LinIfFixedFrameSdu;\r
111         LinIf_PduDirectionType LinIfPduDirection;\r
112         //LinIf_SubstitutionFramesType *LinIfSubstitutionFrames;\r
113 } LinIf_FrameType;\r
114 \r
115 typedef struct {\r
116         uint32 LinIfJitter;\r
117 }LinIf_MasterType;\r
118 \r
119 typedef struct {\r
120         uint32 LinIfConfiguredNad;\r
121         uint32 LinIfFunctionId;\r
122         char* LinIfProtocolVersion;\r
123         uint32 LinIfResponseErrorBitPos;\r
124         uint32 LinIfSupplierId;\r
125         uint32 LinIfVariant;\r
126         uint32 LinIfResponseErrorEventRef;\r
127         uint16 LinIfResponseErrorFrameRef;\r
128 }LinIf_SlaveType;\r
129 \r
130 typedef enum {\r
131         CONTINUE_AT_IT_POINT,\r
132         START_FROM_BEGINNING,\r
133 }LinIf_ResumePositionType;\r
134 \r
135 typedef enum {\r
136         RUN_CONTINUOUS,\r
137         RUN_ONCE,\r
138 }LinIfRunModeType;\r
139 \r
140 typedef struct {\r
141         uint16 LinIfDelay;\r
142         uint16 LinIfEntryIndex;\r
143         uint16 LinIfCollisionResolvingRef;\r
144         uint16 LinIfFrameRef;\r
145 }LinIfEntryType;\r
146 \r
147 typedef struct {\r
148         LinIf_ResumePositionType LinIfResumePosition;\r
149         LinIfRunModeType LinIfRunMode;\r
150         uint8 LinIfSchedulePriority;\r
151         uint16 LinIfScheduleTableIndex;\r
152         char* LinIfScheduleTableName;\r
153         const LinIfEntryType *LinIfEntry;\r
154         uint16 LinIfNofEntries;\r
155 }LinIf_ScheduleTableType;\r
156 \r
157 typedef uint8 LinIf_WakeUpSourceType;\r
158 \r
159 typedef char* LinIf_NodeComposition;\r
160 \r
161 typedef struct {\r
162         /* Internal ID for the channel on LIN Interface level. This parameter shall map\r
163          * the NetworkHandleType to the physical LIN channel.\r
164          * Implementation Type: NetworkHandleType */\r
165         uint8 LinIfChannelId;\r
166         /* Number of schedule requests the schedule table manager can handle for\r
167          * this channel. */\r
168         uint8 LinIfScheduleRequestQueueLength;\r
169         /* Reference to the used channel in Lin. Replaces LINIF_CHANNEL_INDEX */\r
170         const Lin_ChannelConfigType *LinIfChannelRef;\r
171 \r
172         /* Generic container for all types of LIN frames. */\r
173         const LinIf_FrameType *LinIfFrame;\r
174         /* Each Master can only be connected to one physical channel.\r
175          * This could be compared to the Node parameter in a LDF file. */\r
176         LinIf_MasterType LinIfMaster;\r
177         /* Describes a schedule table. Each LinIfChannel may have several schedule tables.\r
178          * Each schedule table can only be connected to one channel. */\r
179         const LinIf_ScheduleTableType *LinIfScheduleTable;\r
180         /* The Node attributes of the Slaves are provided with these parameter. */\r
181         const LinIf_SlaveType *LinIfSlave;\r
182         /* This container contains the configuration (parameters) needed\r
183         to configure a wakeup capable channel */\r
184         const LinIf_WakeUpSourceType *LinIfWakeUpSource;\r
185 } LinIf_ChannelType;\r
186 \r
187 typedef struct {\r
188         uint16 LinIfTimeBase;\r
189         const LinIf_ChannelType *LinIfChannel;\r
190 }LinIf_GlobalConfigType;\r
191 \r
192 typedef struct {\r
193         const LinIf_GeneralType *LinIfGeneral;\r
194         const LinIf_GlobalConfigType *LinIfGlobalConfig;\r
195 } LinIf_Type;\r
196 \r
197 extern const LinIfEntryType LinIfEntryCfg1[];\r
198 extern const LinIf_ScheduleTableType LinIfScheduleTableCfg[];\r
199 extern const LinIf_ChannelType LinIfChannelCfg[];\r
200 extern const LinIf_GlobalConfigType LinIfGlobalConfig;\r
201 \r
202 // TODO not in Lin if spec\r
203 extern const LinIf_FrameType LinIfFrameCfg[];\r
204 \r
205 #define LINIF_CONTROLLER_CNT 1\r
206 #define LINIF_SCH_CNT 2\r
207 \r
208 #endif /*LINIF_CFG_H_*/\r
209 /** @} */\r