-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExampleGenerated.c
226 lines (197 loc) · 7.85 KB
/
ExampleGenerated.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/****************************************************************************************************/
/**
\file cnf_lin.c
\brief Configuration of LIN driver
\author Abraham Tezmol
\version 1.0
\date Thu Mar 31 2016 23:49:16 GMT-0600 (CST)
*/
/****************************************************************************************************/
/*****************************************************************************************************
* Include files
*****************************************************************************************************/
/** SCI configuration definitions */
#include "cnf_lin.h"
/*****************************************************************************************************
* Definition of VARIABLEs -
*****************************************************************************************************/
UINT8 RearFogLampInd = 0x0;
UINT8 PositionLampInd = 0x1;
UINT8 FrontFogLampInd = 0x2;
UINT8 IgnitionKeyPos = 0x3;
UINT8 SLVFuncIllum = 0x4;
UINT8 SLVSymbolIllum = 0x5;
UINT8 SLVSWPartNo = 0x6;
UINT16 SLVHWPartNoB0 = 0x7;
UINT16 SLVHWPartNoB1 = 0x8;
UINT16 FanIdealSpeed = 0x9;
UINT16 FanMeasSpeed = 0x10;
UINT16 WaterTemp = 0x11;
/*****************************************************************************************************
* Definition of module wide (CONST-) CONSTANTs
*****************************************************************************************************/
/* Frame1 */
const tLIN_signal_config LIN_signalsFrame1[] =
{
{
(UINT8 *)&RearFogLampInd, /* Pointer to LIN signal data Signal Name UINT8 */
1, /* Signal size in bytes */
0 /* Signal offset in frame */
},
{
(UINT8 *)&PositionLampInd, /* Pointer to LIN signal data Signal Name UINT8 */
1, /* Signal size in bytes */
1 /* Signal offset in frame */
},
{
(UINT8 *)&FrontFogLampInd, /* Pointer to LIN signal data Signal Name UINT8 */
1, /* Signal size in bytes */
2 /* Signal offset in frame */
},
{
(UINT8 *)&IgnitionKeyPos, /* Pointer to LIN signal data Signal Name UINT8 */
3, /* Signal size in bytes */
3 /* Signal offset in frame */
},
{
(UINT8 *)&SLVFuncIllum, /* Pointer to LIN signal data Signal Name UINT8 */
4, /* Signal size in bytes */
8 /* Signal offset in frame */
},
{
(UINT8 *)&SLVSymbolIllum, /* Pointer to LIN signal data Signal Name UINT8 */
4, /* Signal size in bytes */
12 /* Signal offset in frame */
},
};
/* end: LIN_signalsFrame1 */
/* Frame2 */
const tLIN_signal_config LIN_signalsFrame2[] =
{
{
(UINT8 *)&SLVSWPartNo, /* Pointer to LIN signal data Signal Name UINT8 */
8, /* Signal size in bytes */
0 /* Signal offset in frame */
},
{
(UINT8 *)&SLVHWPartNoB0, /* Pointer to LIN signal data Signal Name UINT16 */
12, /* Signal size in bytes */
8 /* Signal offset in frame */
},
{
(UINT8 *)&SLVHWPartNoB1, /* Pointer to LIN signal data Signal Name UINT16 */
12, /* Signal size in bytes */
24 /* Signal offset in frame */
},
};
/* end: LIN_signalsFrame2 */
/* Frame3 */
const tLIN_signal_config LIN_signalsFrame3[] =
{
{
(UINT8 *)&FanIdealSpeed, /* Pointer to LIN signal data Signal Name UINT16 */
16, /* Signal size in bytes */
0 /* Signal offset in frame */
},
{
(UINT8 *)&FanMeasSpeed, /* Pointer to LIN signal data Signal Name UINT16 */
16, /* Signal size in bytes */
16 /* Signal offset in frame */
},
{
(UINT8 *)&WaterTemp, /* Pointer to LIN signal data Signal Name UINT16 */
16, /* Signal size in bytes */
32 /* Signal offset in frame */
},
};
/* end: LIN_signalsFrame3 */
/*****************************************************************************************************
* Definition of Frames -
*****************************************************************************************************/
const tLIN_frame_config LIN_frameTableMST[] =
{
/* if is the same publisher */
{
& LIN_signalsFrame1[0], /* Pointer to LIN signal configuration */
LIN_masterResponse,
LIN_classic, /* Classic or enhanced checksum supported */
15 /* LIN_startTimeMs */
sizeof(LIN_signalsFrame1)/sizeof(tLIN_signal_config),
8, /* 2 actually used Number of data bytes supported by frame */
0xd3 /* Protected Identifier */
},
};
const tLIN_frame_config LIN_frameTableSLV[] =
{
/* if is the same publisher */
{
& LIN_signalsFrame2[0], /* Pointer to LIN signal configuration */
LIN_slaveResponse,
LIN_enhanced, /* Classic or enhanced checksum supported */
25 /* LIN_startTimeMs */
sizeof(LIN_signalsFrame2)/sizeof(tLIN_signal_config),
8, /* 4 actually used Number of data bytes supported by frame */
0xe2 /* Protected Identifier */
},
{
& LIN_signalsFrame3[0], /* Pointer to LIN signal configuration */
LIN_slaveResponse,
LIN_enhanced, /* Classic or enhanced checksum supported */
25 /* LIN_startTimeMs */
sizeof(LIN_signalsFrame3)/sizeof(tLIN_signal_config),
8, /* 6 actually used Number of data bytes supported by frame */
0xfb /* Protected Identifier */
},
};
/*******************************************************************************/
#ifdef LIN_MODE_MST
const tLIN_table_config LIN_tableMST =
{
&LIN_frameTableMST[0], /* Pointer to supported pusblisher frame table */
&LIN_frameTableSLV[0], /* Pointer to supported suscriber frame table */
200, /* Table total time in ms */
sizeof(LIN_frameTableMST)/sizeof(tLIN_frame_config), /* Size of the publisher frame configuration table */
sizeof(LIN_frameTableSLV)/sizeof(tLIN_frame_config), /* Size of the suscriber frame configuration table */
5 /* Master table resolution in ms */
};
const tLIN_channel_config LIN_channelMaster =
{
&LIN_tableMST, /* Pointer to LIN configuration table */
(tCallbackFunction*)NULL, /* Pointer to function to be callled upon Wake Up */
(UINT32)19200, /* LIN Baudrate*/
LIN_0, /* LIN Channel ID */
SCI_CH0, /* Low leverl drier SCI channel assigned */
LIN_master /* Master or Slave */
};
const tLIN_driver_config LIN_driverMaster =
{
&LIN_channelMaster /* Pointer to LIN channels configuration */
};
#endif /* LIN_MODE_MST */
#ifdef LIN_MODE_SLV
const tLIN_table_config LIN_tableSLV =
{
&LIN_frameTableSLV[0], /* Pointer to supported pusblisher frame table */
&LIN_frameTableMST[0], /* Pointer to supported suscriber frame table */
200, /* Table total time in ms */
sizeof(LIN_frameTableSLV)/sizeof(tLIN_frame_config), /* Size of the publisher frame configuration table */
sizeof(LIN_frameTableMST)/sizeof(tLIN_frame_config), /* Size of the suscriber frame configuration table */
5 /* Master table resolution in ms */
};
const tLIN_channel_config LIN_channelSlave =
{
&LIN_tableSLV, /* Pointer to LIN configuration table */
(tCallbackFunction*)NULL, /* Pointer to function to be callled upon Wake Up */
(UINT32)19200, /* LIN Baudrate*/
LIN_0, /* LIN Channel ID */
SCI_CH0, /* Low leverl drier SCI channel assigned */
LIN_slav /* Master or Slave */
};
const tLIN_driver_config LIN_driverSlave =
{
&LIN_channelSlave /* Pointer to LIN channels configuration */
};
#endif /* LIN_MODE_ */
/*****************************************************************************************************
* Code of module wide private FUNCTIONS
*****************************************************************************************************/