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