1 PLIN-API Documentation - PEAK-System
1 PLIN-API Documentation - PEAK-System
1 PLIN-API Documentation - PEAK-System
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3.2 Configuring the Hardware <strong>PLIN</strong> <strong>API</strong> <strong>Documentation</strong> Programming a LIN Master<br />
In this Chapter<br />
Topics Description<br />
Programming a LIN Slave ( see<br />
page 8)<br />
Programming a LIN Master ( see<br />
page 8)<br />
Programming a LIN<br />
Advanced-Master ( see page 9)<br />
3.2.1 Programming a LIN Slave<br />
This section contains Information about programming a LIN hardware as Slave.<br />
This section contains Information about programming a LIN hardware as<br />
Simple-Master.<br />
This section contains Information about programming a LIN hardware as<br />
Advanced-Master.<br />
A client can configure a Hardware as Slave using the mode "modSlave" and a baud rate within the function<br />
LIN_InitializeHardware ( see page 116). The baud rate is an integer value. The conversion into baud rate divider is hidden<br />
at this level. Note that if the hardware was already initialized, it will be re-initialized, maybe corrupting current Frame<br />
transfers. The function LIN_GetStatus ( see page 139) can be used in order to check if a hardware is initialized or not. The<br />
data transfer in a Slave is determined by setting its LIN frames.<br />
When the LIN bus stays more than 4 seconds without data traffic (idle), the network goes in the sleep state. A client<br />
application can send a Wake-Up impulse to a hardware working as Slave using the function LIN_XmtWakeUp ( see page<br />
137). The hardware sends then a single data byte (F0h) to generate a suitable impulse at the configured baud rate.<br />
Reading<br />
The client can get messages received by the Slave. If a received message meets the configured filter of a client (the filter<br />
allows the message to pass through), the Slave stores the message in the receive queue of the client. From there the<br />
messages can be read, using the functions LIN_Read ( see page 114) and LIN_ReadMulti ( see page 114).<br />
Writing<br />
A client using a connection to a Hardware configured as Slave can not directly send messages to the LIN bus. A Slave must<br />
be configured using the function LIN_SetFrameEntry ( see page 125). A client application can configure all data Frames for<br />
a hardware (Slave), from ID 0 to 63. The configuration in the hardware can be read again using the function<br />
LIN_GetFrameEntry ( see page 126). More information about a Frame Entry can be found in The LIN Frame Entry ( see<br />
page 10) chapter. The data sent from a Slave, as Publisher, will be updated using the function LIN_UpdateByteArray ( see<br />
page 127).<br />
See Also<br />
The LIN Frame Entry ( see page 10)<br />
LIN_InitializeHardware ( see page 116) (.NET: InitializeHardware ( see page 64))<br />
LIN_GetStatus ( see page 139) (.NET: GetStatus ( see page 95))<br />
LIN_SetFrameEntry ( see page 125) (.NET: SetFrameEntry ( see page 81))<br />
LIN_GetFrameEntry ( see page 126) (.NET: GetFrameEntry ( see page 82))<br />
LIN_UpdateByteArray ( see page 127) (.NET: UpdateByteArray ( see page 83))<br />
LIN_XmtWakeUp ( see page 137) (.NET: XmtWakeUp ( see page 93))<br />
3.2.2 Programming a LIN Master<br />
A client can configure a Hardware as Master using the mode "modMaster" and a baud rate within the function<br />
8<br />
3