Skip to content

Commit fdc7e80

Browse files
bmenne-dspaceBenedikt Menne
andauthored
Add initial operation for LIN bus (#73)
* Add initial operation for LIN bus * Removed ToDo * Fixed wording and operation length --------- Co-authored-by: Benedikt Menne <[email protected]>
1 parent 1358956 commit fdc7e80

File tree

1 file changed

+332
-1
lines changed

1 file changed

+332
-1
lines changed

docs/4_4_2_lin.adoc

Lines changed: 332 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,334 @@
11
==== LIN
2+
This chapter describes the <<low-cut-layered-standard-bus-protocol, Layered Standard Bus Protocol>> for LIN.
3+
4+
===== Operations
5+
This section defines the allowed operations for LIN.
6+
The following tables provides an overview of all operations and specifies the position and length of the corresponding arguments, as well as the respective flow direction.
7+
8+
====== Transmit [[low-cut-lin-transmit-operation]]
9+
There are three types of transmit operations, each representing the transmission of a LIN header, a response and a combination of a header and response.
10+
11+
.Detailed description of the LIN Header operation.
12+
[#table-lin-header-operation]
13+
[cols="5,4,3,20"]
14+
|====
15+
h|Name 3+| Header
16+
h|Description 3+| Represents an operation for the transmission of a LIN header from a LIN Master to LIN slaves.
17+
h|OP Code [hex] 3+| 0x10
18+
.5+h|Content h|Argument h|Length h|Description
19+
| OP Code | 1 byte | Contains the OP Code of the specified operation.
20+
For this operation the OP Code always has the value 0x10.
21+
| Total Length | 4 byte | Defines the cumulative length of all arguments in bytes.
22+
For this operation always applies: `Total Length = 7`.
23+
| PID | 1 byte | The specified protected ID (PID) of the LIN message.
24+
The maximum length of a PID is 8-bit.
25+
| Response Data Length | 1 byte | The size of the response in byte.
26+
h|Behavior
27+
3+|The Header operation shall be provided by Network FMUs to initiate the transmission of a LIN header.
28+
In case of direct connected Network FMUs (see <<common-concepts-direct-communication>>), the FMU importer forwards the operation directly to the receiving Network FMUs.
29+
If a Bus Simulation is involved (see <<common-concepts-composition-with-dedicated-bus-simulation-fmu>> and <<common-concepts-importer-with-integrated-bus-simulation>>), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior.
30+
Depending on the simulation details, the Bus Simulation might response with a <<low-cut-lin-bus-error-operation, Bus Error>> or <<low-cut-lin-format-error-operation, Format Error>> operation.
31+
32+
|====
33+
34+
.Detailed description of the LIN Response operation.
35+
[#table-lin-response-operation]
36+
[cols="5,4,3,20"]
37+
|====
38+
h|Name 3+| Response
39+
h|Description 3+| Represents an operation for the transmission of a LIN response from a LIN slave to the LIN Master.
40+
h|OP Code [hex] 3+| 0x11
41+
.7+h|Content h|Argument h|Length h|Description
42+
| OP Code | 1 byte | Contains the OP Code of the specified operation.
43+
For this operation the OP Code always has the value 0x11.
44+
| Total Length | 4 byte | Defines the cumulative length of all arguments in bytes.
45+
For this operation always applies: `Total Length = 8 + Data Length`.
46+
| PID | 1 byte | The specified protected ID (PID) of the LIN message.
47+
The maximum length of a PID is 8-bit.
48+
| Response Error | 1 byte | Represents the Response Error field of a LIN frame.
49+
For specification the boolean values `TRUE` and `FALSE` (see <<table-boolean-value-kinds>>) shall be used.
50+
| Data Length | 1 byte | Specifies the length of the Data argument in bytes.
51+
| Data | n byte | Stores the given frame data to transfer, whereby the valid length of the data depends on the LIN Format.
52+
h|Behavior
53+
3+|The Response operation shall be provided by Network FMUs to initiate a response to a given LIN header.
54+
In case of direct connected Network FMUs (see <<common-concepts-direct-communication>>), the FMU importer forwards the operation directly to the receiving Network FMUs.
55+
If a Bus Simulation is involved (see <<common-concepts-composition-with-dedicated-bus-simulation-fmu>> and <<common-concepts-importer-with-integrated-bus-simulation>>), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior.
56+
Depending on the simulation details, the Bus Simulation might response with a <<low-cut-lin-bus-error-operation, Bus Error>> or <<low-cut-lin-format-error-operation, Format Error>> operation.
57+
58+
|====
59+
60+
.Detailed description of the LIN Header Response operation.
61+
[#table-lin-header-response-operation]
62+
[cols="5,4,3,20"]
63+
|====
64+
h|Name 3+| Header Response
65+
h|Description 3+| Represents an operation for the transmission of a LIN header and response from a LIN Master to LIN slaves.
66+
h|OP Code [hex] 3+| 0x12
67+
.6+h|Content h|Argument h|Length h|Description
68+
| OP Code | 1 byte | Contains the OP Code of the specified operation.
69+
For this operation the OP Code always has the value 0x12.
70+
| Total Length | 4 byte | Defines the cumulative length of all arguments in bytes.
71+
For this operation always applies: `Total Length = 7 + Data Length`.
72+
| PID | 1 byte | The specified protected ID (PID) of the LIN message.
73+
The maximum length of a PID is 8-bit.
74+
| Data Length | 1 byte | Specifies the length of the Data argument in bytes.
75+
| Data | n byte | Stores the given frame data to transfer, whereby the valid length of the data depends on the LIN Format.
76+
h|Behavior
77+
3+|The Header Response operation shall be provided by Network FMUs to initiate the transmission of a LIN frame that contains the specified header and response.
78+
In case of direct connected Network FMUs (see <<common-concepts-direct-communication>>), the FMU importer forwards the operation directly to the receiving Network FMUs.
79+
If a Bus Simulation is involved (see <<common-concepts-composition-with-dedicated-bus-simulation-fmu>> and <<common-concepts-importer-with-integrated-bus-simulation>>), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior.
80+
Depending on the simulation details, the Bus Simulation might response with a <<low-cut-lin-bus-error-operation, Bus Error>> or <<low-cut-lin-format-error-operation, Format Error>> operation.
81+
82+
|====
83+
84+
====== Format Error [[low-cut-lin-format-error-operation]]
85+
Represents a format error that indicates a syntax or content error of receiving operations.
86+
See <<low-cut-format-error-operation, Format Error>> for definition.
87+
88+
====== Bus Error [[low-cut-lin-bus-error-operation]]
89+
The Bus Error operation represents special bus communication errors, which are delivered to the LIN Master node in the network.
90+
91+
.Detailed description of the Bus Error operation.
92+
[#table-lin-bus-error-operation]
93+
[cols="5,4,3,20"]
94+
|====
95+
h|Name
96+
3+|Bus Error
97+
h|Description
98+
3+|Represents an operation for bus communication error handling.
99+
h|OP Code [hex]
100+
3+|0x20
101+
.5+h|Content h|Argument h|Length h|Description
102+
|OP Code
103+
|1 byte
104+
|Contains the OP Code of the specified operation.
105+
For this operation the OP Code always has the value 0x20.
106+
107+
|Total Length
108+
|4 byte
109+
|Defines the cumulative length of all arguments in bytes.
110+
For this operation always applies: `Total Length = 10`.
111+
112+
|ID
113+
|4 byte
114+
|The specified ID of the LIN message which triggers the error.
115+
116+
|Error Code
117+
|1 byte
118+
|The specified error code, basing on the table below.
119+
120+
h|Behavior
121+
3+|The specified operation shall be produced by the Bus Simulation and consumed by Network FMUs.
122+
An Error operation is always a reaction from the Bus Simulation to a <<low-cut-lin-transmit-operation, Transmit operation>> that was produced by a Network FMU.
123+
Out of this Error operations are available in the <<common-concepts-composition-with-dedicated-bus-simulation-fmu, Composition with dedicated Bus Simulation FMU>> and <<common-concepts-importer-with-integrated-bus-simulation, Importer with Integrated Bus Simulation>> communication use case only.
124+
125+
|====
126+
127+
The following codes are allowed to use as Error Code:
128+
129+
.Overview of the available error states and codes.
130+
[#table-lin-bus-error-codes]
131+
[cols="1,3,20"]
132+
|====
133+
134+
h|State h|Error Code h|Description
135+
136+
|BIT_ERROR
137+
|0x01
138+
|Represents a bit error.
139+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
140+
141+
|CHECKSUM_ERROR
142+
|0x02
143+
|Represents a CRC error.
144+
The error can occurs during a collision of multiple response frames when Event-Triggered-Frames are used.
145+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
146+
147+
|IDENTIFIER_PARITY_ERROR
148+
|0x03
149+
|Represents an Identifier Parity Error.
150+
The error can occurs during a collision of multiple LIN headers.
151+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
152+
153+
|SLAVE_NOT_RESPONDING_ERROR
154+
|0x04
155+
|Represents a Slave Not Responding Error.
156+
The error can occurs if LIN Slaves does not response to a specified LIN header.
157+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
158+
159+
|SYNCH_FIELD_ERROR
160+
|0x05
161+
|Represents a Inconsistent-Synch Field Error.
162+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
163+
164+
|PHYSICAL_BUS_ERROR
165+
|0x06
166+
|Represents a Physical Bus Error.
167+
The given error is always related to a specific <<low-cut-lin-transmit-operation, Transmit operation>>.
168+
169+
|====
170+
171+
====== Configuration [[low-cut-lin-configuration-operation]]
172+
The `Configuration operation` allows Network FMUs the configuration of the Bus Simulation with parameters like baud rate information and further options.
173+
The following information are included within this operation:
174+
175+
176+
.Detailed description of the Configuration operation.
177+
[#table-lin-configuration-operation]
178+
[cols="5,1,10,4,3,20"]
179+
|====
180+
h|Name
181+
5+|Configuration
182+
h|Description
183+
5+|Represents an operation for the configuration of a Bus Simulation.
184+
In detail the configuration of a LIN baud rate is possible.
185+
Also the configuration of further options, like LIN Master or LIN Slave representation, is supported by this operation.
186+
h|OP Code [hex]
187+
5+|0x30
188+
.7+h|Content 3+h|Argument h|Length h|Description
189+
3+|OP Code
190+
|1 byte
191+
|Contains the OP Code (0x30) of the operation.
192+
193+
3+|Total Length
194+
|4 byte
195+
|Defines the cumulative length of all arguments in bytes.
196+
The following applies for this operation: `Total Length = 6 + Length of parameter arguments in bytes`.
197+
198+
3+|Parameter Type
199+
|1 byte
200+
|Defines the current configuration parameter.
201+
Note that only one parameter can be set per `Configuration operation`.
202+
203+
.3+h|
204+
4+h|Parameters
205+
206+
|LIN_BAUDRATE
207+
|Baudrate
208+
|4 byte
209+
|The specified baudrate value to configure, whereby the specified ranges are defined by the LIN standard.
210+
The required unit for the baudrate value is bit/s.
211+
212+
|LIN_NODE_DEFINITION
213+
|Node Definition
214+
|1 byte
215+
|Configures the required node type (Master or Slave) within a Bus Simulation.
216+
Possible values are: `LIN_MASTER` and `LIN_SLAVE` (see <<table-lin-configuration-node-definition-kinds>>).
217+
218+
h|Behavior
219+
5+|The specified operation shall be produced by a Network FMU and consumed by the Bus Simulation.
220+
The operation shall not be routed to other Network FMUs by the Bus Simulation.
221+
A Network FMU shall ignored this operation on consumer side.
222+
The configuration shall be completed by a specified Network FMU before it produces any <<low-cut-lin-transmit-operation, Transmission operation>>.
223+
Any configuration can be repeated multiple times during the runtime of a Network FMU.
224+
If required configuration parameters are not adjusted by a Network FMU the Bus Simulation shall choose a default behavior by itself.
225+
For a smooth simulation, it must be ensured that exactly one master node is configured.
226+
|====
227+
228+
The following Kind values are allowed to be used:
229+
230+
.Overview of the available configuration kinds and values.
231+
[#table-lin-configuration-kinds]
232+
[cols="1,1,5"]
233+
|====
234+
235+
h|Kind h|Value h|Description
236+
|LIN_BAUDRATE|0x01|This code indicates that a LIN baud rate should be configured for the Bus Simulation.
237+
|LIN_NODE_DEFINITION|0x02|This code configures the specified node type (Master or Slave) within a Bus Simulation.
238+
239+
|====
240+
241+
The following values for the Arbitration Lost Behavior option are defined:
242+
243+
.Overview of the available node definition values for LIN.
244+
[#table-lin-configuration-node-definition-kinds]
245+
[cols="2,1,5"]
246+
|====
247+
248+
h|Node Definition h|Value h|Description
249+
|LIN_MASTER|0x01|Configuration of a LIN Master node within a specified Bus Simulation.
250+
|LIN_SLAVE|0x02|Configuration of a LIN Slave node within a specified Bus Simulation.
251+
252+
|====
253+
254+
====== Status [[low-cut-lin-status-operation]]
255+
By using the `Status operation` a Network FMU can communicate the current LIN node state of the simulated LIN Controller within the Network FMU to the Bus Simulation.
256+
The following information are included within this operation:
257+
258+
.Detailed description of the status operation.
259+
[#table-lin-status-operation]
260+
[cols="5,4,3,20"]
261+
|====
262+
h|Name
263+
3+|Status
264+
h|Description
265+
3+|Represents an operation for status handling.
266+
h|OP Code [hex]
267+
3+|0x31
268+
.4+h|Content h|Argument h|Length h|Description
269+
|OP Code
270+
|1 byte
271+
|Contains the OP Code of the specified operation.
272+
For this operation the OP Code always has the value 0x31.
273+
274+
|Total Length
275+
|4 byte
276+
|Defines the cumulative length of all arguments in bytes.
277+
For this operation always applies: `Total Length = 6`.
278+
279+
|Status
280+
|1 byte
281+
|The specified status code, basing on the table below.
282+
283+
h|Behavior
284+
3+|The specified operation shall be produced by Network FMUs and consumed by the Bus Simulation.
285+
The operation shall not be routed to other Network FMUs by the Bus Simulation.
286+
A Network FMU shall ignore this operation on the consumer side.
287+
A Network FMU shall report its status to the Bus Simulation after it changes.
288+
289+
|====
290+
291+
The following status values are allowed to use:
292+
293+
.Overview of the available status values.
294+
[#table-lin-status-values]
295+
[cols="1,1,5"]
296+
|====
297+
298+
h|Kind h|Value h|Description
299+
|POWER_OFF|0x01|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Power Off.
300+
|INITIALIZATION|0x02|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Initialization.
301+
|OPERATION|0x03|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Operation.
302+
|SLEEP|0x04|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Sleep.
303+
|====
304+
305+
====== Wake-up [[low-cut-lin-wakeup-operation]]
306+
By using the `Wakeup operation` the underlying Bus Simulation can trigger a bus-specific wake up.
307+
308+
.Detailed description of the Wakeup operation.
309+
[#table-lin-wakeup-operation]
310+
[cols="5,4,3,20"]
311+
|====
312+
h|Name
313+
3+|Wakeup
314+
h|Description
315+
3+|Represents an operation for triggering a bus-specific wake up.
316+
h|OP Code [hex]
317+
3+|0x32
318+
.3+h|Content h|Argument h|Length h|Description
319+
|OP Code
320+
|1 byte
321+
|Contains the OP Code of the specified operation.
322+
For this operation the OP Code always has the value 0x32.
323+
324+
|Total Length
325+
|4 byte
326+
|Defines the cumulative length of all arguments in bytes.
327+
For this operation always applies: `Total Length = 5`.
328+
329+
h|Behavior
330+
3+|The specified operation shall be produced by a Network FMU and distributed to all participants, except the wake-up initiator, of the bus by using the Bus Simulation.
331+
If a Network FMU does not support wake-up this operation can be ignored on consumer side.
332+
333+
|====
2334

3-
#TODO dSPACE#

0 commit comments

Comments
 (0)