AUTOSAR SWS LINTransceiverDriver
AUTOSAR SWS LINTransceiverDriver
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Introduction.......................................................................................................... 7
1.1 Goal of LIN transceiver driver ........................................................................ 7
1.2 Explicitly uncovered LIN transceiver functionality .......................................... 8
2 Acronyms and abbreviations ............................................................................... 9
3 Related documentation...................................................................................... 10
3.1 Input documents .......................................................................................... 10
3.2 Related standards and norms ..................................................................... 10
3.3 Related specification ................................................................................... 10
4 Constraints and assumptions ............................................................................ 12
4.1 Limitations ................................................................................................... 12
4.2 Applicability to car domains ......................................................................... 12
5 Dependencies to other modules ........................................................................ 13
5.1 File structure ................................................................................................ 13
5.1.1 Naming convention for transceiver driver implementation .................... 13
5.1.2 Code file structure ................................................................................. 13
5.1.3 Header file structure .............................................................................. 14
6 Requirements Traceability ................................................................................. 15
1 Introduction
This specification specifies functionality, API and configuration of the module LIN
transceiver driver. It is responsible to handle the LIN transceiver hardware on an
ECU.
A LIN bus transceiver is a hardware device. It is the interface between LIN protocol
controller and physical LIN bus. On one hand the transmit data stream of a LIN
protocol controller is converted into LIN physical layer compliant bus signals. On the
other hand LIN bus data streams are converted into protocol controller input signals.
A LIN protocol controller is typically a microcontroller implementation.
Most LIN transceivers support power supply control and wakeup via the bus. A lot of
different wakeup/sleep and power supply concepts are available on the market.
In addition so called system basis chips (SBC) are available. Beside LIN transceiver
functionalities these devices provide additional features, e.g. detection of electrical
malfunctions (e.g. short-circuit to dominant level (GND)), power supply control,
advanced watchdogs, LIN transceiver, SPI etc.
ECU self test and error detection are not defined within AUTOSAR and requiring
such functionality in general would lock out most currently used transceiver hardware
chips. Therefore, features like “ground shift detection”, “selective wakeup”, “slope
control” and others are not supported.
Abbreviation Description
API Application Program Interface
Channel A channel is a software exchange medium for data that are defined with the same
criteria.
ComM Communication Manager
Det Default Error Tracer
Dio/DIO Digital input output, one of the SPAL SW modules
EcuM ECU State Manager
ECU Electronic Control Unit
Frt Free Running Timer
Gpt General purpose Timer
ICU Interrupt Control Unit
ISR Interrupt Service Routine
LinTrcv Lin Transceiver Driver
MCAL Micro Controller Abstraction Layer
n/a Not applicable
PDU Protocol Data Unit
SBC System Basis Chip; a device, which integrates e.g. LIN and/or LIN transceiver,
watchdog and power control.
SPAL Standard Peripheral Abstraction Layer
SW Software
SPI Serial Peripheral Interface
SPI Channel A channel is a software exchange medium for data that are defined with the same
criteria: configuration parameters, number of data elements with same size and
data pointers (source & destination) or location. See specification of SPI driver for
more details.
SPI Job A job is composed of one or several channels with the same chip select. A job is
considered to be atomic and therefore cannot be interrupted. A job has also an
assigned priority. See specification of SPI driver for more details.
SPI Sequence A sequence is a number of consecutive jobs to be transmitted. A sequence
depends on a static configuration. See specification of SPI driver for more details.
3 Related documentation
Thus, the specification SWS BSW General shall be considered as additional and
required specification for LIN Transceiver Driver.
4.1 Limitations
The used APIs of underlying drivers like DIO or SPI shall be synchronous.
Implementations of underlying drivers, which do not support synchronous behavior,
cannot be used together with LIN transceiver driver.
Module Dependencies
LinIf All LIN transceiver drivers are arranged below LinIf.
ComM ComM steers LIN transceiver driver communication modes via LinIf. Independent
steering of each single LIN transceiver channel is possible.
Det Det gets development error information from LIN transceiver driver.
Dio Dio module is used to access LIN transceiver hardware connected via ports.
EcuM EcuM gets wakeup information from LIN transceiver driver via LinIf.
Icu Icu module might perform LIN transceiver hardware interrupts.
Spi Spi module is used to access LIN transceiver hardware connected via Spi
For details, refer to the section 5.1.6 "Code file structure" of the SWS BSW General
[6].
LinTrcv.c shall include Icu.h (if ICU APIs needed to perform LIN transceiver hardware
interrupts)
LinTrcv.c shall include Spi.h (if the LIN bus transceiver driver use drivers for Spi to
control the LIN bus transceiver hardware)
LinTrcv.c shall include Tm.h (needed for wait states for changing transceiver
operation modes)
⌋ (SRS_BSW_00301, SRS_BSW_00409)
6 Requirements Traceability
handled SWS_LinTrcv_00055
SRS_Lin_01568 The LIN Interface implementation and SWS_LinTrcv_00999
interface shall be independent from
underlying LIN hardware.
SRS_Lin_01569 The LIN Interface shall support SWS_LinTrcv_00999
initialization of each LIN channel
separately
SRS_Lin_01571 Transmission request service shall be SWS_LinTrcv_00999
provided
SRS_Lin_01572 The LIN Driver shall support the SWS_LinTrcv_00999
initialization of each LIN channel
separately
SRS_Lin_01574 It shall be possible to have one SWS_LinTrcv_00999
instance of the TP for each channel
SRS_Lin_01576 The ISO 17987 specifications shall be SWS_LinTrcv_00999
reused as far as possible
SRS_Lin_01577 It shall be compatible to LIN protocol SWS_LinTrcv_00999
specification
SRS_Lin_01579 The AUTOSAR LIN Transport Layer SWS_LinTrcv_00999
shall be based on the Diagnostic
Transport Layer for ISO 17987.
SRS_Lin_01580 The LIN Transceiver Driver shall SWS_LinTrcv_00074,
support separate configuration SWS_LinTrcv_00075
parameters per bus
7 Functional specification
The main idea behind this diagram is to support the majority of available LIN bus
transceivers in a common model view. Depending on the LIN transceiver hardware,
the model may have one or two states more than necessary for a given LIN
transceiver hardware, but this will clearly decouple the ComM and EcuM from the
used hardware.
[Power On]
[Power Off]
POWER_ON
NOT_ACTIVE
ACTIVE
LinTrcv_Init()
LINTRCV_TRCV_MODE_SLEEPLinTrcvSetOpMode LINTRCV_TRCV_MODE_NORMAL
(LinTRCV_TRCV_MODE_NORMAL)
[LinTrcvSetOpMode
(LinTRCV_TRCV_MODE_SLEEP)]
optional LinTrcvSetOpMode
optional LinTrcvSetOpMode (LinTRCV_TRCV_MODE_NORMAL)
(LinTRCV_TRCV_MODE_SLEEP)
optional LinTrcvSetOpMode
(LinTRCV_TRCV_MODE_STANDBY)
optional LinTrcvSetOpMode
LINTRCV_TRCV_MODE_STANDBY (LinTRCV_TRCV_MODE_STANDBY)
Hint: There are several optional interfaces that might not be needed for current LIN
transceiver hardware. E.g. the mode “LINTRCV_TRCV_MODE_STANDBY” might be
only an internal state that is used for internal hardware transitions. Especially if
functionality of “inhibit pin” is used to control the uC only the states
“LINTRCV_TRCV_MODE_SLEEP” and “LINTRCV_TRCV_MODE_NORMAL” are of
interest.
State Description
POWER_ON MCU is fully powered.
NOT_ACTIVE State of LIN transceiver hardware depend on
ECU hardware and on Dio and Port driver
configuration. LIN transceiver driver is not
initialized and therefore not active.
ACTIVE The function LinTrcv_Init() was called. It carries
LIN transceiver driver to active state. LIN
transceiver driver enters state
LINTRCV_TRCV_MODE_SLEEP.
LINTRCV_TRCV_MODE_NOR Full bus communication. If LIN transceiver
MAL hardware controls MCU power supply, MCU is
fully powered. The LIN transceiver driver detects
no further wakeup information.
LINTRCV_TRCV_MODE_STA No communication is possible. If LIN transceiver
NDBY hardware controls MCU power supply, the MCU
is still powered. A wakeup by bus or by a local
wakeup event is possible.
Note: This is an optional state.
LINTRCV_TRCV_MODE_SLEE No communication is possible. If LIN transceiver
P hardware controls MCU power supply, the MCU
is not powered. A wakeup by bus or by a local
wakeup event is possible.
If a LIN transceiver driver covers more than one LIN channel, all channels are either
in state NOT_ACTIVE or in state ACTIVE. In state ACTIVE each channel may be in a
different sub state.
7.2 LIN transceiver hardware operation modes
The LIN transceiver hardware may support more mode transitions than the software.
The dependencies and the recommended implementations behaviour are explained
in this chapter.
1) MCU is not powered, parts of ECU including LIN transceiver hardware are
powered. The considered LIN transceiver hardware is in mode
LINTRCV_TRCV_MODE_SLEEP. A wakeup event on LIN is detected by LIN
transceiver hardware. LIN transceiver hardware causes powering of MCU (e.g.
via pin “inhibit”). In terms of AUTOSAR this is kept as a cold start and not as a
wakeup.
2) MCU is in low power mode, parts of ECU including LIN transceiver hardware are
powered. Depending on the hardware implementation the considered LIN
transceiver hardware is either in mode LINTRCV_TRCV_MODE_STANDBY or
LINTRCV_TRCV_MODE_SLEEP. A wakeup event on LIN is detected by LIN
transceiver hardware. LIN transceiver hardware is informing MCU about wakeup.
In terms of AUTOSAR this is kept as a wakeup of the LIN channel and of the
MCU.
3) MCU is in full power mode, at least parts of the ECU including LIN transceiver
hardware are powered. Depending on the hardware implementation the
considered LIN transceiver hardware is either in mode
LINTRCV_TRCV_MODE_STANDBY or LINTRCV_TRCV_MODE_SLEEP. A wakeup event
on LIN is detected by LIN transceiver hardware. LIN transceiver hardware is
informing MCU about wakeup or is polled cyclically for wakeup events. In terms of
AUTOSAR this is kept as a wakeup of a LIN channel.
4) MCU is in full power mode, at least parts of the ECU including LIN transceiver
hardware are powered. Depending on the hardware implementation the
considered LIN transceiver hardware is either in mode
LINTRCV_TRCV_MODE_STANDBY or LINTRCV_TRCV_MODE_SLEEP. The MCU is now
setting the LIN transceiver hardware to mode LINTRCV_TRCV_MODE_NORMAL and
is waking up the LIN channel. In terms of AUTOSAR this is kept as an internal
wakeup of a LIN channel (through MCU).
1) Internal wakeup
An internal wakeup is initiated by an upper layer, e.g. by calling LinTrcv_Init() or
LinTrcv_SetOpMode.
2) External wakeup
Wakeup detected by LIN transceiver driver is forwarded to the upper layer
through the API LinTrcv_CheckWakeup which has to be called by the LinIf.
Hint: WakeUp through ISR is not supported by the Lin Transceiver Driver but is only
possible through ICU.
[SWS_LinTrcv_00161] ⌈ LinTrcv driver shall use the following APIs provided by ICU
driver, to enable and disable the wakeup event notification:
- Icu_EnableNotification
- Icu_DisableNotification⌋ ()
[SWS_LinTrcv_00162] ⌈ LinTrcv driver shall enable the ICU channels when the
transceiver transmits to standby mode (LINTRCV_STANDBY)⌋ ()
[SWS_LinTrcv_00163] ⌈ LinTrcv driver shall disable the ICU channels when the
transceiver transmits to Normal mode (LINTRCV_NORMAL)⌋ ()
[SWS_LinTrcv_00050] ⌈
[SWS_LinTrcv_00106] ⌈ If development errors are enabled and any API that uses
the parameter “LinNetwork” receives an invalid value for this parameter this function
shall report the development error code LINTRCV_E_INVALID_LIN_NETWORK.⌋ ()
[SWS_LinTrcv_00159] ⌈ If development errors are enabled and any API that uses a
pointer as parameter receives a null pointer as parameter shall report the
development error code LINTRCV_E_PARAM_POINTER.⌋ ()
[SWS_LinTrcv_00099] ⌈ The LIN bus transceiver driver might use drivers for Dio or
Spi to control the LIN bus transceiver hardware. Thus these drivers must be available
and ready to operate before the LIN bus transceiver driver is initialized.⌋ ()
The LIN transceiver driver may have timing requirements for the initialization
sequence and the access to the transceiver device, which must be fulfilled by these
used underlying drivers.
[SWS_LinTrcv_00016] ⌈ For each LIN transceiver hardware type an ECU has one
LIN transceiver driver instance. One instance serves all LIN transceiver hardware of
the same type. ⌋ (SRS_BSW_00347, SRS_BSW_00413)
[SWS_LinTrcv_00171]⌈ The LIN Transceiver Driver shall use the Time service
Tm_BusyWait1us16bit to realize the wait time for transceiver state changes.⌋ ()
8 API specification
8.2.1 LinTrcv_ConfigType
[SWS_LinTrcv_00172] ⌈
Name: LinTrcv_ConfigType
Type: Structure
Range: implementation --
specific
Description: Configuration data structure of the LinTrcv module.
Available via: LinTrcv.h
⌋ (SRS_BSW_00414)
8.2.2 LinTrcv_TrcvModeType
[SWS_LinTrcv_00168] ⌈
Name: LinTrcv_TrcvModeType
Type: Enumeration
Range: LINTRCV_TRCV_MODE_NORMAL -- Transceiver mode NORMAL
LINTRCV_TRCV_MODE_STANDBY -- Transceiver mode STANDBY
LINTRCV_TRCV_MODE_SLEEP -- Transceiver mode SLEEP
Description: Operating modes of the LIN Transceiver Driver
Available via: LinTrcv.h
⌋ ()
8.2.3 LinTrcv_TrcvWakeupModeType
[SWS_LinTrcv_00169] ⌈
Name: LinTrcv_TrcvWakeupModeType
Type: Enumeration
Range: LINTRCV_WUMODE_ENABLE -- The notification for wakeup events is enabled on the
addressed network.
LINTRCV_WUMODE_DISABLE -- The notification for wakeup events is disabled on the
addressed network.
LINTRCV_WUMODE_CLEAR -- A stored wakeup event is cleared on the addressed
network.
Description: Wake up operating modes of the LIN Transceiver Driver.
Available via: Lin_GeneralTypes.h
⌋ ()
8.2.4 LinTrcv_TrcvWakeupReasonType
[SWS_LinTrcv_00170] ⌈
Name: LinTrcv_TrcvWakeupReasonType
Type: Enumeration
Range: LINTRCV_WU_ERROR -- Due to an error wake up reason was not detected.
LINTRCV_WU_NOT_SUPPORTED -- The transceiver does not support any information
for the wake up reason.
LINTRCV_WU_BY_BUS -- The transceiver has detected, that the network
has caused the wake up of the ECU.
LINTRCV_WU_BY_PIN -- The transceiver has detected a wake-up event at
one of the transceiver's pins (not at the LIN bus).
LINTRCV_WU_INTERNALLY -- The transceiver has detected, that the network
has been woken up by the ECU via a request to
NORMAL mode.
LINTRCV_WU_RESET -- The transceiver has detected, that the wake up is
due to an ECU reset.
LINTRCV_WU_POWER_ON -- The transceiver has detected, that the wake up is
due to an ECU reset after power on.
Description: This type denotes the wake up reason detected by the LIN transceiver in detail.
Available via: Lin_GeneralTypes.h
⌋ ()
8.3.1 LinTrcv_Init
[SWS_LinTrcv_00001] ⌈
Service name: LinTrcv_Init
Syntax: void LinTrcv_Init(
const LinTrcv_ConfigType* ConfigPtr
)
Service ID[hex]: 0x00
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): ConfigPtr Pointer to the selected configuration set.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: Initializes the Lin Transceiver Driver module.
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00358, SRS_BSW_00371, SRS_BSW_00414,
SRS_BSW_00101, SRS_Can_01096, SRS_Can_01097)
[SWS_LinTrcv_00119] ⌈
The function LinTrcv_Init shall set the LIN transceiver hardware to the state
LINTRCV_TRCV_MODE_SLEEP.
⌋ ()
Caveats:
The initialization sequence after reset (e.g. power up) is a critical phase for the LIN
transceiver driver. The driver will use SPAL functionality (DIO) to access the
transceiver hardware. Therefore all necessary BSW drivers must be initialized and
usable before.
8.3.2 LinTrcv_SetOpMode
[SWS_LinTrcv_00002] ⌈
Service name: LinTrcv_SetOpMode
Syntax: Std_ReturnType LinTrcv_SetOpMode(
uint8 LinNetwork,
LinTrcv_TrcvModeType OpMode
)
Service ID[hex]: 0x01
Sync/Async: Synchronous
Reentrancy: Non Reentrant
LinNetwork LIN network to wich API call has to be applied
Parameters (in): OpMode The parameter says to which operation mode the change shall be
performed.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: will be returned if the transceiver state has been changed
to the requested mode.
Return value:
E_NOT_OK: will be returned if the transceiver state change is not
accepted or has failed or the parameter is out of the allowed
range.
Description: The internal state of the LIN transceiver driver is switched to mode given in the
parameter OpMode.
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00357, SRS_BSW_00369, SRS_BSW_00371,
SRS_BSW_00406, SRS_Lin_01566, SRS_Lin_01524, SRS_Can_01097,
SRS_Can_01098, SRS_Can_01099, SRS_Can_01100)
[SWS_LinTrcv_00109] ⌈
The function LinTrcv_SetOpMode shall switch the internal state of
channel LinNetwork to the value of LINTRCV_TRCV_MODE_STANDBY if one of
the follwing conditions is fullfilled:
a) the channel LinNetwork is in mode LINTRCV_TRCV_MODE_SLEEP and the
optional transition from this mode to LINTRCV_TRCV_MODE_STANDBY is enabled.
b) the channel LinNetwork is in mode LINTRCV_TRCV_MODE_NORMAL and the
optional transition from this mode to LINTRCV_TRCV_MODE_STANDBY is enabled.
⌋ ()
[SWS_LinTrcv_00110] ⌈
The function LinTrcv_SetOpMode shall switch the internal state of
channel LinNetwork to the value of LINTRCV_TRCV_MODE_SLEEP if one of
the follwing conditions is fullfilled:
a) the channel LinNetwork is in mode LINTRCV_TRCV_MODE_NORMAL
31 of 55 Document ID 257: AUTOSAR_SWS_LINTransceiverDriver
- AUTOSAR confidential -
Specification of LIN Transceiver Driver
AUTOSAR CP Release 4.4.0
8.3.3 LinTrcv_GetOpMode
[SWS_LinTrcv_00005] ⌈
Service name: LinTrcv_GetOpMode
Syntax: Std_ReturnType LinTrcv_GetOpMode(
uint8 LinNetwork,
LinTrcv_TrcvModeType* OpMode
)
Service ID[hex]: 0x02
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): LinNetwork LIN network to which API call has to be applied
Parameters None
(inout):
Parameters (out): OpMode Pointer to operation mode of the bus the API is applied to.
Std_ReturnType E_OK: will be returned if the operation mode is detected
Return value:
E_NOT_OK: will be returned, if service request is failed due to
development errors or the operation mode is not detected.
Description: API detects the actual software state of LIN transceiver driver.
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00377,
SRS_Can_01097, SRS_Can_01101)
Configuration:
The number of supported busses is statically set in the configuration phase.
8.3.4 LinTrcv_GetBusWuReason
[SWS_LinTrcv_00007] ⌈
Service name: LinTrcv_GetBusWuReason
Syntax: Std_ReturnType LinTrcv_GetBusWuReason(
uint8 LinNetwork,
LinTrcv_TrcvWakeupReasonType* Reason
)
Service ID[hex]: 0x03
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): LinNetwork LIN network to which API call has to be applied
Parameters None
(inout):
Parameters (out): Reason Pointer to wakeup reason of the bus the API is applied to.
Std_ReturnType E_OK: will be returned if the wake up reason is detected
Return value:
E_NOT_OK: will be returned, if service request is failed due to
development errors or the wakeup reason is not detected.
Description: This API provides the reason for the wakeup that the LIN transceiver has detected
in the parameter "Reason". The ability to detect and differentiate the possible
wakeup reasons depends strongly on the LIN transceiver hardware.
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00377,
SRS_BSW_00406, SRS_Can_01097, SRS_Can_01103)
Configuration:
35 of 55 Document ID 257: AUTOSAR_SWS_LINTransceiverDriver
- AUTOSAR confidential -
Specification of LIN Transceiver Driver
AUTOSAR CP Release 4.4.0
Caveats:
Be aware that if more than one bus is available each bus may report a different
wakeup reason. E.g. if an ECU has LIN, a wakeup by LIN may occur and the
incoming data may cause an internal wakeup for another LIN bus.
The LIN transceiver driver has a “per bus” view and does not vote the more important
reason or sequence internally. The same may be true if e.g. one transceiver controls
the power supply and the other is just powered or un-powered.
8.3.5 LinTrcv_GetVersionInfo
[SWS_LinTrcv_00008] ⌈
Service name: LinTrcv_GetVersionInfo
Syntax: void LinTrcv_GetVersionInfo(
Std_VersionInfoType* versioninfo
)
Service ID[hex]: 0x04
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters None
(inout):
Parameters (out): versioninfo Pointer to version information of this module.
Return value: None
Description: This service provides the version information of this module through the parameter
"versioninfo".
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00406,
SRS_BSW_00407)
[SWS_LinTrcv_00131] ⌈ The function LinTrcv_GetVersionInfo shall return the
version information of this module. The version information contains all data defined
in Std_VersionInfoType in “AUTOSAR_SWS_StandardTypes”.⌋ ()
8.3.6 LinTrcv_CheckWakeup
[SWS_LinTrcv_00012] ⌈
Service name: LinTrcv_CheckWakeup
Syntax: Std_ReturnType LinTrcv_CheckWakeup(
uint8 LinNetwork
)
Service ID[hex]: 0x07
Sync/Async: Synchronous
36 of 55 Document ID 257: AUTOSAR_SWS_LINTransceiverDriver
- AUTOSAR confidential -
Specification of LIN Transceiver Driver
AUTOSAR CP Release 4.4.0
Reentrancy: Reentrant
Parameters (in): LinNetwork LIN network to which API call has to be applied.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: Will be returned, if a wakeup has been detected.
Return value:
E_NOT_OK: Will be returned, if no wakeup has been detected
Description: Notifies the calling function if a wakeup is detected.
Available via: LinTrcv.h
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00375,
SRS_BSW_00406, SRS_Can_01097)
[SWS_LinTrcv_00144] ⌈ If development error detection for the module LinTrcv is
enabled:
If called before the LinTrcv module has been initialized, the function
LinTrcv_CheckWakeup shall report the development error LINTRCV_E_UNINIT.
⌋ ()
Configuration:
See configuration parameter LinTrcvWakeUpSupport.
8.3.7 LinTrcv_SetWakeupMode
[SWS_LinTrcv_00009] ⌈
Service name: LinTrcv_SetWakeupMode
Syntax: Std_ReturnType LinTrcv_SetWakeupMode(
uint8 LINNetwork,
LinTrcv_TrcvWakeupModeType TrcvWakupMode
)
Service ID[hex]: 0x05
Sync/Async: Synchronous
Reentrancy: non Reentrant
LINNetwork LIN network to which API call has to be applied
Parameters (in):
TrcvWakupMode Requested transceiver wakup reason.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OKwill be returned if the transceiver state has been changed
to the requested mode.
Return value:
E_NOT_OK will be returned, if service request is failed due to
development errors or the wakeup mode is not set.
Description: This API enables, disables and clears the notification for wakeup events on the
addressed network.
Available via: LinTrcv.h
⌋ ()
[SWS_LinTrcv_00135] ⌈ Enabled: If the function LinTrcv_SetWakeupMode is
called with TrcvWakeupMode == LINTRCV_WUMODE_ENABLE and if the LinTrcv
module has a stored wakeup event pending for the addressed bus, the LinTrcv
module shall execute the notification within the API call or immediately after
(depending on the implementation).⌋ ()
This chapter defines all interfaces which are required to fulfill the core functionality of
the module.
[SWS_LinTrcv_91002] ⌈
API function Header Description
File
LinIf_WakeupConfirmation LinIf.h The LIN Driver or LIN Transceiver Driver will call this function
to report the wake up source after the successful wakeup
detection during CheckWakeup or after power on by bus.
⌋ ()
This chapter defines all interfaces which are required to fulfill an optional functionality
of the module.
[SWS_LinTrcv_91003] ⌈
API function Header Description
File
Det_ReportError Det.h Service to report development errors.
Dio_ReadChannel Dio.h Returns the value of the specified DIO channel.
Dio_ReadChannelGroup Dio.h This Service reads a subset of the adjoining bits of a port.
Dio_ReadPort Dio.h Returns the level of all channels of that port.
Dio_WriteChannel Dio.h Service to set a level of a channel.
Dio_WriteChannelGroup Dio.h Service to set a subset of the adjoining bits of a port to a
specified level.
Dio_WritePort Dio.h Service to set a value of the port.
EcuM_SetWakeupEvent EcuM.h Sets the wakeup event.
Icu_DisableNotification Icu.h This function disables the notification of a channel.
Icu_EnableNotification Icu.h This function enables the notification on the given channel.
Spi_GetStatus Spi.h Service returns the SPI Handler/Driver software module
status.
Spi_ReadIB Spi.h Service for reading synchronously one or more data from an
39 of 55 Document ID 257: AUTOSAR_SWS_LINTransceiverDriver
- AUTOSAR confidential -
Specification of LIN Transceiver Driver
AUTOSAR CP Release 4.4.0
9 Sequence diagrams
For all wakeup related sequence diagrams please refer to chapter 9 of ECU State
Manager.
10 Configuration specification
In general this chapter defines configuration parameters and their clustering into
containers. In order to support the specification Chapter 10.1 describes
fundamentals.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
LinTrcv.
10.2.1 Variants
10.2.2 LinTrcv
Included Containers
Container Name Multiplicity Scope / Dependency
Container gives LIN transceiver driver information about a
LinTrcvChannel 1..* single LIN transceiver channel. Any LIN transceiver driver has
such LIN transceiver channels.
LinTrcvGeneral 1 Container gives LIN transceiver driver basic information.
+parameter LinTrcvWakeUpSupport:
EcucBooleanParamDef
+parameter LinTrcvVersionInfoApi:
EcucBooleanParamDef
defaultValue = false
LinTrcvIndex:
+parameter EcucIntegerParamDef
+container
min = 0
max = 255
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
+literal Timer_1us16bit:
EcucEnumerationLiteralDef
LinTrcvWaitTime:
EcucFloatParamDef
+parameter
min = 0
max = 0.000255
lowerMultiplicity = 0
upperMultiplicity = 1
+reference
LinTrcvEcucPartitionRef:
EcucReferenceDef
+destination
lowerMultiplicity = 0 EcucPartition:
upperMultiplicity = * EcucParamConfContainerDef
+destination lowerMultiplicity = 0
LinTrcvChannelEcucPartitionRef: upperMultiplicity = *
EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
+reference LinTrcvSpiSequence:
LinTrcvAccess: +choice EcucParamConfContainerDef
EcucChoiceContainerDef upperMultiplicity = 1
LinTrcvChannel: upperMultiplicity = 1 lowerMultiplicity = 0
+container EcucParamConfContainerDef +subContainer lowerMultiplicity = 1
lowerMultiplicity = 1 +choice LinTrcvDioAccess:
upperMultiplicity = * EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.3 LinTrcvGeneral
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
10.2.4 LinTrcvChannel
Name LinTrcvWakeupSourceRef
Parent Container LinTrcvChannel
Description Reference to a wakeup source in the EcuM configuration. This reference is
only needed if LinTrcvWakeupByBusUsed is true. Implementation Type:
reference to EcuM_WakeupSourceType.
Multiplicity 0..1
Type Symbolic name reference to [ EcuMWakeupSource ]
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: ECU
dependency: LinTrcvWakeupByBusUsed
Included Containers
Container Name Multiplicity Scope / Dependency
Container gives LIN transceiver driver access about a single
LinTrcvAccess 1
LIN transceiver channel.
LinTrcvChannel: LinTrcvChannelId:
EcucParamConfContainerDef EcucIntegerParamDef
+parameter
lowerMultiplicity = 1 symbolicNameValue = true
upperMultiplicity = * min = 0
max = 255
LinTrcvChannelUsed:
+parameter EcucBooleanParamDef
defaultValue = true
LinTrcvWakeupByBusUsed:
+parameter
EcucBooleanParamDef
defaultValue = false
LinTrcvWakeupSourceRef:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
+destination
EcuMWakeupSource: EcuMWakeupSourceId:
EcucParamConfContainerDef +parameter EcucIntegerParamDef
LinTrcvAccess: LinTrcvDioAccess:
EcucChoiceContainerDef +choice EcucParamConfContainerDef
upperMultiplicity = 1 lowerMultiplicity = 0
+subContainer upperMultiplicity = 1
lowerMultiplicity = 1
+choice LinTrcvSpiSequence:
EcucParamConfContainerDef
upperMultiplicity = 1
lowerMultiplicity = 0
LinTrcvIcuChannelRef:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
+destination
IcuChannel: IcuChannelId:
EcucParamConfContainerDef +parameter EcucIntegerParamDef
upperMultiplicity = * min = 0
lowerMultiplicity = 1 max = 65535
symbolicNameValue = true
+reference LinTrcvChannelEcucPartitionRef:
EcucReferenceDef +destination EcucPartition:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = *
10.2.5 LinTrcvAccess
Container Choices
Container Name Multiplicity Scope / Dependency
Container gives LIN transceiver driver information about
accessing ports and port pins. In addition relation between LIN
LinTrcvDioAccess 0..1 transceiver hardware pin names and Dio port access
information is given. If a LIN transceiver hardware has no Dio
interface, there is no instance of this container.
Container gives LIN transceiver driver information about one
SPI sequence.
One SPI sequence used by LIN transceiver driver is in
exclusive use for it. No other driver is allowed to access this
sequence. LIN transceiver driver may use one sequence to
LinTrcvSpiSequence 0..1
access n LIN transceiver hardwares chips of the same type or
n sequences are used to access one single LIN transceiver
hardware chip.
If a LIN transceiver hardware has no SPI interface, there is no
instance of this container.
LinTrcvAccess: LinTrcvDioAccess:
EcucChoiceContainerDef +choice EcucParamConfContainerDef
upperMultiplicity = 1 lowerMultiplicity = 0
lowerMultiplicity = 1 upperMultiplicity = 1
LinTrcvSpiSequence:
LinTrcvSpiSequenceName:
+choice EcucParamConfContainerDef +reference EcucReferenceDef
upperMultiplicity = 1
lowerMultiplicity = 0 requiresSymbolicNameValue = true
+destination
SpiSequence:
SpiSequenceId:
EcucParamConfContainerDef +parameter
EcucIntegerParamDef
upperMultiplicity = *
symbolicNameValue = true
lowerMultiplicity = 1
max = 255
10.2.6 LinTrcvDioAccess
Included Containers
Container Name Multiplicity Scope / Dependency
Container gives DIO channel access by single Lin transceiver
LinTrcvDioChannelAccess 1..*
channel.
10.2.7 LinTrcvDioChannelAccess
No Included Containers
LinTrcvDioAccess:
EcucParamConfContainerDef LinTrcvDioSymRefName:
LinTrcvDioChannelAccess:
EcucChoiceReferenceDef DioChannelGroup:
lowerMultiplicity = 0 EcucParamConfContainerDef +destination
upperMultiplicity = 1 EcucParamConfContainerDef
lowerMultiplicity = 1
lowerMultiplicity = 1
upperMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = *
lowerMultiplicity = 0
+subContainer
DioPort: EcucParamConfContainerDef
+reference +destination
upperMultiplicity = *
lowerMultiplicity = 1
+subContainer
+subContainer
DioChannel: EcucParamConfContainerDef
+destination
upperMultiplicity = *
lowerMultiplicity = 0
LinTrcvHardwareInterfaceName:
+parameter EcucStringParamDef
lowerMultiplicity = 1
upperMultiplicity = 1
10.2.8 LinTrcvSpiSequence
No Included Containers