[AUTOSAR] [Lin Communication] LinTrcv

Table of contents

I. Overview

2. Function description

2.1 LIN Transceiver Driver Mode of Operation

2.2 LIN Transceiver Hardware Operation Mode

2.3 LIN Transceiver Wakeup Types

2.4 LIN transceiver wake-up mode

2.5 Misclassification

2.5.1 Development errors

3. API interface

3.1 API definition


I. Overview

        This specification specifies the functionality, API and configuration of the module's LIN transceiver driver. It handles the LIN transceiver hardware on one ECU.

        A LIN bus transceiver is a hardware device. It is the interface between the LIN protocol controller and the physical LIN bus. On the one hand, the transport data stream of a LIN protocol controller is converted into bus signals conforming to the LIN physical layer. On the other hand, the data flow of the LIN bus is converted into the input signal of the protocol controller. A LIN protocol controller is usually a microcontroller implementation.

        Most LIN transceivers support power control and wake-up over the bus. There are many different wake/sleep and power supply concepts on the market.

[Specification] The LIN transceiver driver abstracts the application's LIN transceiver hardware and overlays the hardware-independent interface to higher layers. It also abstracts from the ECU layout by accessing the LIN transceiver hardware using APIs of the MCAL layer.

2. Function description

2.1 LIN Transceiver Driver Mode of Operation

[Specification] The operation mode of the LIN transceiver driver is shown in the figure below:

2.2 LIN Transceiver Hardware Operation Mode

LIN transceiver hardware may support more mode conversions than software. Determines which LIN transceiver hardware state is implemented by which LIN transceiver driver software state. An implementation must guarantee that the entire functionality of the described LIN transceiver driver is given by the implementation.

2.3 LIN Transceiver Wakeup Types

        Option 1 : The microcontroller does not supply power, and the ECU part includes the LIN transceiver hardware power supply. The considered LIN transceiver hardware is in LINTRCV_TRCV_MODE_SLEEP mode. A wakeup event on LIN is detected by the LIN transceiver hardware. The LIN transceiver hardware leads to powering the microcontroller. As far as AUTOSAR is concerned, this is done as a cold start, not as a wake up.

        Solution 2 : The single chip microcomputer is in low power consumption mode, and some ECUs including LIN transceiver hardware are powered. Depending on the hardware implementation, the considered LIN transceiver hardware is either in LINTRCV_TRCV_MODE_STANDBY mode or LINTRCV_TRCV_MODE_SLEEP mode. A wakeup event on LIN is detected by the LIN transceiver hardware. The LIN transceiver hardware is notifying the MCU about waking up. As far as AUTOSAR is concerned, this is a wake-up as a LIN channel and microcontroller.

        Option 3 : The MCU is in full power mode, supplying power to at least part of the ECU including the LIN transceiver hardware. Depending on the hardware implementation, the considered LIN transceiver hardware is either in LINTRCV_TRCV_MODE_STANDBY mode or LINTRCV_TRCV_MODE_SLEEP mode. A wakeup event on LIN is detected by the LIN transceiver hardware. The LIN transceiver hardware is notifying the microcontroller to wake up or periodically polling for wakeup events. As far as automatic memory is concerned, this is wakeup as a LIN channel.

        Option 4 : The MCU is in full power mode, powering at least part of the ECU including the LIN transceiver hardware. Depending on the hardware implementation, the considered LIN transceiver hardware is either in LINTRCV_TRCV_MODE_STANDBY mode or LINTRCV_TRCV_MODE_SLEEP mode. The microcontroller is now setting the LIN transceiver hardware to LINTRCV_TRCV_MODE_NORMAL mode and is waking up the LIN channel. As far as AUTOSAR is concerned, this is an internal wakeup (via MCU) as a LIN channel.

2.4 LIN transceiver wake-up mode

【Specification】Wake-up notification must be supported by Lin transceiver driver, so Lin transceiver driver covers 2 wake-up modes, upper layer internal wake-up or Lin channel external wake-up.

  • Internal wakeup: An internal wakeup is initiated by upper layers, for example by calling LinTrcv_Init() or LinTrcv_SetOpMode.
  • External Wakeup: Wakeup detected by the LIN transceiver driver is forwarded to the upper layer via the API LinTrcv_CheckWakeup, which must be called by LinIf.

[Specification] The selection of the wake-up mode should be done by configuring the parameter LinTrcv wake-up support.

[Specification] The wake-up support of each LIN transceiver channel should be enabled and disabled by configuring the parameter LinTrcv wake-up line.

[Specification] LinTrcv drivers should use the following APIs provided by the ICU driver to enable and disable wakeup event notifications:

  • Icu_EnableNotification
  • Icu_DisableNotification

[Specification] The LinTrcv driver should enable the ICU channel when the transceiver is transferred to standby mode (LINTRCV_STANDBY).

[Specification] The LinTrcv driver should disable the ICU channel when the transceiver transmits to normal mode (LINTRCV_NORMAL).

2.5 Misclassification

2.5.1 Development errors

3. API interface

3.1 API definition

  1. LinTrcv_Init
  2. LinTrcv_SetOpMode
  3. LinTrcv_GetOpMode
  4. LinTrcv_GetBusWuReason
  5. LinTrcv_GetVersionInfo
  6. LinTrcv_CheckWakeup
  7. LinTrcv_SetWakeupMode

Guess you like

Origin blog.csdn.net/qq_42357877/article/details/129972205