[go: up one dir, main page]

CN118740540A - Wake-up signal detection method and control device - Google Patents

Wake-up signal detection method and control device Download PDF

Info

Publication number
CN118740540A
CN118740540A CN202310317641.9A CN202310317641A CN118740540A CN 118740540 A CN118740540 A CN 118740540A CN 202310317641 A CN202310317641 A CN 202310317641A CN 118740540 A CN118740540 A CN 118740540A
Authority
CN
China
Prior art keywords
lin
target
wake
signal
transition edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310317641.9A
Other languages
Chinese (zh)
Inventor
王翠荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhaoyi Innovation Technology Group Co ltd
Original Assignee
Zhaoyi Innovation Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhaoyi Innovation Technology Group Co ltd filed Critical Zhaoyi Innovation Technology Group Co ltd
Priority to CN202310317641.9A priority Critical patent/CN118740540A/en
Publication of CN118740540A publication Critical patent/CN118740540A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40039Details regarding the setting of the power status of a node according to activity on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40234Local Interconnect Network LIN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Sources (AREA)

Abstract

The invention provides a wake-up signal detection method and a control device, wherein the detection method comprises the following steps: when the target Lin channel is in a dormant state, configuring a first effective jump edge for the target signal receiving pin, wherein the first effective jump edge indicates the start of counting; in the process that the target signal receiving pin receives the wake-up signal, when the wake-up signal generates a first effective jump edge, counting is started, a second effective jump edge is configured for the target signal receiving pin, and the second effective jump edge is different from the first effective jump edge and indicates the end of counting; when the second effective jump edge appears in the wake-up signal, the counting is ended, the counting time length is calculated at least based on the beginning and ending, and the effectiveness of the wake-up signal is judged according to the time length.

Description

唤醒信号的检测方法以及控制装置Wake-up signal detection method and control device

技术领域Technical Field

本发明总体上涉及自动控制和计算机技术领域,具体涉及一种唤醒信号的检测方法以及控制装置。The present invention generally relates to the fields of automatic control and computer technology, and in particular to a detection method and a control device for a wake-up signal.

背景技术Background Art

Lin(Local Interconnect Network)是一种低成本的串行通讯(SerialCommunication)网络,Lin通讯网络包括一个主模块和至少一从模块(从模块通常也被称为Lin通道),主模块与各Lin通道通过Lin总线耦接。Lin (Local Interconnect Network) is a low-cost serial communication network. The Lin communication network includes a master module and at least one slave module (the slave module is also usually called a Lin channel). The master module and each Lin channel are coupled through a Lin bus.

Lin总线至少包括两种状态:工作状态(Operation)和休眠状态(Sleep),在Lin总线处于休眠状态的情况下,主模块和/或Lin通道也会随之处于休眠状态,当主模块和/或Lin通道在Lin总线上检测到有效的唤醒信号时,其可以从休眠状态跳转至工作状态。The Lin bus includes at least two states: working state (Operation) and sleeping state (Sleep). When the Lin bus is in the sleeping state, the main module and/or the Lin channel will also be in the sleeping state. When the main module and/or the Lin channel detects a valid wake-up signal on the Lin bus, it can jump from the sleeping state to the working state.

基于此,如何保证对唤醒信号有效性判断的可靠性,以避免主模块和/或Lin通道被误唤醒,是目前需要解决的问题。Based on this, how to ensure the reliability of the judgment on the validity of the wake-up signal to avoid the main module and/or the Lin channel being woken up by mistake is a problem that needs to be solved at present.

发明内容Summary of the invention

为了解决上述问题或其他问题,本发明提供了以下技术方案。In order to solve the above problems or other problems, the present invention provides the following technical solutions.

第一方面,本发明提供了一种唤醒信号的检测方法,应用于Lin驱动模块,所述Lin驱动模块包括Lin总线和至少一Lin通道,所述Lin总线与各所述Lin通道耦接,各所述Lin通道具有对应的信号接收引脚,其中,所述至少一Lin通道包括目标Lin通道,所述目标Lin通道具有目标信号接收引脚,所述检测方法至少包括:In a first aspect, the present invention provides a wake-up signal detection method, which is applied to a Lin driver module, wherein the Lin driver module includes a Lin bus and at least one Lin channel, wherein the Lin bus is coupled to each of the Lin channels, and each of the Lin channels has a corresponding signal receiving pin, wherein the at least one Lin channel includes a target Lin channel, and the target Lin channel has a target signal receiving pin, and the detection method at least includes:

当所述目标Lin通道处于休眠状态时,对所述目标信号接收引脚配置第一有效跳变沿,所述第一有效跳变沿用以指示计数的开始;When the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, wherein the first valid transition edge is used to indicate the start of counting;

在所述目标信号接收引脚从所述Lin总线接收唤醒信号的过程中,当所述唤醒信号出现所述第一有效跳变沿时,开始所述计数,并对所述目标信号接收引脚配置第二有效跳变沿,所述第二有效跳变沿不同于所述第一有效跳变沿、且用以指示所述计数的结束;以及,In the process that the target signal receiving pin receives the wake-up signal from the Lin bus, when the first valid transition edge appears in the wake-up signal, the counting is started, and a second valid transition edge is configured for the target signal receiving pin, the second valid transition edge is different from the first valid transition edge and is used to indicate the end of the counting; and,

当所述唤醒信号出现所述第二有效跳变沿时,结束所述计数,并至少基于所述开始和所述结束计算所述计数的时长,并根据所述时长判断所述唤醒信号的有效性。When the second valid transition edge appears in the wake-up signal, the counting is ended, and the duration of the counting is calculated based on at least the start and the end, and the validity of the wake-up signal is determined according to the duration.

根据本发明实施例的检测方法,所述检测方法还包括:According to the detection method of the embodiment of the present invention, the detection method further includes:

当所述目标Lin通道进入所述休眠状态时,使能跳变沿检测中断;When the target Lin channel enters the dormant state, enabling a transition edge detection interrupt;

当所述唤醒信号出现所述第一有效跳变沿时,进入所述目标Lin通道对应的所述跳变沿检测中断,以开始所述计数;以及,When the first valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to start the counting; and

当所述唤醒信号出现所述第二有效跳变沿时,进入所述目标Lin通道对应的所述跳变沿检测中断,以结束所述计数,并去能所述跳变沿检测中断。When the second valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to end the counting and disable the transition edge detection interrupt.

根据本发明实施例的检测方法,所述目标Lin通道与目标控制寄存器相映射,其中:According to the detection method of the embodiment of the present invention, the target Lin channel is mapped to the target control register, wherein:

所述对所述目标信号接收引脚配置第一有效跳变沿的步骤至少包括:将所述目标控制寄存器中的值配置为第一预设值,以使所述目标信号接收引脚根据所述第一预设值确定所述唤醒信号中的所述第一有效跳变沿;The step of configuring the target signal receiving pin with a first valid transition edge at least comprises: configuring the value in the target control register to be a first preset value, so that the target signal receiving pin determines the first valid transition edge in the wake-up signal according to the first preset value;

所述对所述目标信号接收引脚配置第二有效跳变沿的步骤至少包括:将所述目标控制寄存器中的值配置为第二预设值,以使所述目标信号接收引脚根据所述第二预设值确定所述唤醒信号中的所述第二有效跳变沿。The step of configuring the target signal receiving pin with a second valid transition edge at least includes: configuring the value in the target control register to a second preset value, so that the target signal receiving pin determines the second valid transition edge in the wake-up signal according to the second preset value.

根据本发明实施例的检测方法,所述目标Lin通道与目标状态寄存器相映射,所述配置使得所述目标Lin通道进入所述跳变沿检测中断的步骤至少包括:According to the detection method of the embodiment of the present invention, the target Lin channel is mapped to the target status register, and the step of configuring the target Lin channel to enter the transition edge detection interruption includes at least:

对所述目标状态寄存器中的值进行配置,以在所述值的指示下触发进入所述跳变沿检测中断。The value in the target status register is configured to trigger entry into the transition edge detection interrupt under the indication of the value.

根据本发明实施例的检测方法,各所述Lin通道包括Lin控制器,所述信号接收引脚设置于所述Lin控制器上,其中,所述Lin控制器由非Lin协议控制器硬件实现。According to the detection method of the embodiment of the present invention, each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.

根据本发明实施例的检测方法,所述Lin控制器被配置为执行所述计数。According to the detection method of the embodiment of the present invention, the Lin controller is configured to perform the counting.

根据本发明实施例的检测方法,所述Lin控制器更被配置为执行所述计算。According to the detection method of the embodiment of the present invention, the Lin controller is further configured to perform the calculation.

根据本发明实施例的检测方法,所述第一有效跳变沿为下降沿,且所述第二有效跳变沿为上升沿。According to the detection method of the embodiment of the present invention, the first valid transition edge is a falling edge, and the second valid transition edge is a rising edge.

根据本发明实施例的检测方法,所述检测方法还包括:According to the detection method of the embodiment of the present invention, the detection method further includes:

当所述判断的结果指示所述唤醒信号有效时,将预设宏配置为第一状态,以使所述目标Lin通道从所述休眠状态进入工作状态。When the result of the determination indicates that the wake-up signal is valid, the preset macro is configured to a first state, so that the target Lin channel enters a working state from the sleep state.

根据本发明实施例的检测方法,所述根据所述时长判断所述唤醒信号的有效性的步骤至少包括:According to the detection method of the embodiment of the present invention, the step of judging the validity of the wake-up signal according to the duration at least includes:

当所述时长大于150微秒时,确定所述唤醒信号为有效。When the duration is greater than 150 microseconds, it is determined that the wake-up signal is valid.

第二方面,本发明提供了一种控制装置,所述控制装置至少包括:In a second aspect, the present invention provides a control device, the control device comprising at least:

如上述任一项所述的Lin驱动模块;以及,A Lin driver module as described in any one of the above items; and

处理器,与所述Lin驱动模块耦接,并被配置为执行如上述任一项所述的唤醒信号的检测方法。A processor is coupled to the Lin driving module and is configured to execute any of the above-mentioned wake-up signal detection methods.

根据本发明实施例的控制装置,各所述Lin通道包括Lin控制器,所述信号接收引脚设置于所述Lin控制器上,其中,所述Lin控制器由非Lin协议控制器硬件实现。According to the control device of the embodiment of the present invention, each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.

根据本发明实施例的控制装置,所述控制装置还包括定时器模块,所述定时器模块被配置为执行所述计数。According to the control device of the embodiment of the present invention, the control device further includes a timer module, and the timer module is configured to perform the counting.

本发明的有益效果至少包括:本发明提供了一种唤醒信号的检测方法以及控制装置,其中,唤醒信号的检测方法应用于Lin驱动模块,Lin驱动模块包括Lin总线和至少一Lin通道,Lin总线与各Lin通道耦接,各Lin通道具有对应的信号接收引脚,其中,至少一Lin通道包括目标Lin通道,目标Lin通道具有目标信号接收引脚,检测方法至少包括:当目标Lin通道处于休眠状态时,对目标信号接收引脚配置第一有效跳变沿,第一有效跳变沿用以指示计数的开始;在目标信号接收引脚从Lin总线接收唤醒信号的过程中,当唤醒信号出现第一有效跳变沿时,开始计数,并对目标信号接收引脚配置第二有效跳变沿,第二有效跳变沿不同于第一有效跳变沿、且用以指示计数的结束;之后,当唤醒信号出现第二有效跳变沿时,结束计数,并至少基于开始和结束计算计数的时长,并根据时长判断唤醒信号的有效性,本发明通过在唤醒信号出现第一有效跳变沿的前后,对目标信号接收引脚配置不同的有效跳变沿,以控制对唤醒信号中某一电位持续时间的计数的开始和结束,使得所计算的持续时间更加精准,因此,保证了对唤醒信号有效性判断的可靠性,避免了时钟频率较高的应用场景下唤醒信号被误判从而导致目标Lin通道被误唤醒。The beneficial effects of the present invention include at least: the present invention provides a detection method and a control device for a wake-up signal, wherein the detection method for the wake-up signal is applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each Lin channel, each Lin channel has a corresponding signal receiving pin, wherein at least one Lin channel includes a target Lin channel, the target Lin channel has a target signal receiving pin, and the detection method includes at least: when the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, the first valid transition edge is used to indicate the start of counting; in the process of the target signal receiving pin receiving the wake-up signal from the Lin bus, when the wake-up signal has the first valid transition edge , start counting, and configure a second valid transition edge for the target signal receiving pin, the second valid transition edge is different from the first valid transition edge and is used to indicate the end of counting; thereafter, when the second valid transition edge appears in the wake-up signal, end counting, and calculate the duration of the count at least based on the start and end, and judge the validity of the wake-up signal according to the duration. The present invention configures different valid transition edges for the target signal receiving pin before and after the first valid transition edge appears in the wake-up signal to control the start and end of counting the duration of a certain potential in the wake-up signal, so that the calculated duration is more accurate. Therefore, the reliability of the judgment on the validity of the wake-up signal is guaranteed, and the wake-up signal is avoided from being misjudged in application scenarios with high clock frequencies, thereby causing the target Lin channel to be mistakenly awakened.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明的技术方案,下面将对根据本发明而成的各实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of each embodiment according to the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

图1是根据本发明而成的实施例提供的唤醒信号的检测方法的流程示意图。FIG. 1 is a schematic flow chart of a method for detecting a wake-up signal according to an embodiment of the present invention.

图2是根据本发明而成的实施例提供的唤醒信号的检测方法的进一步流程示意图。FIG. 2 is a further schematic flow chart of a method for detecting a wake-up signal according to an embodiment of the present invention.

图3是根据本发明而成的实施例提供的唤醒信号的检测方法的时序图。FIG. 3 is a timing diagram of a method for detecting a wake-up signal according to an embodiment of the present invention.

图4是根据本发明而成的实施例提供的Lin驱动模块的结构示意图。FIG. 4 is a schematic diagram of the structure of a Lin driving module provided in an embodiment according to the present invention.

图5是根据本发明而成的实施例提供的控制装置的结构示意图。FIG. 5 is a schematic diagram of the structure of a control device provided in an embodiment according to the present invention.

图6a和图6b是根据本发明而成的实施例提供的控制寄存器和状态寄存器所对应的位域的示意图。6a and 6b are schematic diagrams of bit fields corresponding to a control register and a status register provided in accordance with an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

请参阅图1和图4,其中,图1示出了根据本发明而成的实施例提供的唤醒信号的检测方法的流程示意图,该唤醒信号的检测方法应用于Lin驱动模块100,图4示出了根据本发明而成的实施例提供的Lin驱动模块100的结构示意图,从图中可以看到上述检测方法的大致步骤以及Lin驱动模块100的各组成部分及其相对位置关系。Please refer to Figures 1 and 4, wherein Figure 1 shows a flow chart of a method for detecting a wake-up signal provided in accordance with an embodiment of the present invention, and the method for detecting a wake-up signal is applied to a Lin driver module 100, and Figure 4 shows a structural diagram of a Lin driver module 100 provided in accordance with an embodiment of the present invention, from which one can see the general steps of the above-mentioned detection method and the components of the Lin driver module 100 and their relative positional relationships.

具体的,Lin驱动模块包括Lin总线和至少一Lin通道,在图4的示例中,Lin驱动模块100包括Lin总线110和三个Lin通道(分别被标记为120a、120b和120c),其中,Lin总线110与各Lin通道(120a、120b和120c)耦接,各Lin通道(120a、120b和120c)具有对应的信号接收引脚(分别被标记为Rxa、Rxb和Rxc)。Specifically, the Lin driver module includes a Lin bus and at least one Lin channel. In the example of Figure 4, the Lin driver module 100 includes a Lin bus 110 and three Lin channels (respectively marked as 120a, 120b and 120c), wherein the Lin bus 110 is coupled to each Lin channel (120a, 120b and 120c), and each Lin channel (120a, 120b and 120c) has a corresponding signal receiving pin (respectively marked as Rxa, Rxb and Rxc).

进一步地,在Lin通道(120a、120b以及120c)处于上文所述的休眠状态(Sleep)的情况下,当某一时刻需要将某一Lin通道从休眠状态唤醒至工作状态(Operation)以执行相应操作时,该Lin通道则为该时刻下的目标Lin通道。也就是说,上述至少一Lin通道(图4的示例中则为“三个Lin通道”)中包括目标Lin通道,相应的,目标Lin通道具有目标信号接收引脚。Further, when the Lin channels (120a, 120b and 120c) are in the sleep state (Sleep) described above, when a certain Lin channel needs to be awakened from the sleep state to the working state (Operation) to perform a corresponding operation at a certain moment, the Lin channel is the target Lin channel at that moment. That is to say, the at least one Lin channel (the "three Lin channels" in the example of FIG. 4) includes the target Lin channel, and accordingly, the target Lin channel has a target signal receiving pin.

接下来,以在图4中被标记为“120a”的Lin通道为目标Lin通道、且以在图4中被标记为“Rxa”的信号接收引脚为目标信号接收引脚为例,对唤醒信号的检测方法进行详细说明,具体的,上述检测方法至少包括以下步骤:Next, taking the Lin channel marked as "120a" in FIG. 4 as the target Lin channel and the signal receiving pin marked as "Rxa" in FIG. 4 as the target signal receiving pin as an example, the detection method of the wake-up signal is described in detail. Specifically, the above detection method includes at least the following steps:

第一配置步骤S101:当目标Lin通道120a处于休眠状态时,对目标信号接收引脚Rxa配置第一有效跳变沿,第一有效跳变沿用以指示计数的开始;First configuration step S101: when the target Lin channel 120a is in a dormant state, a first valid transition edge is configured for the target signal receiving pin Rxa, where the first valid transition edge is used to indicate the start of counting;

第二配置步骤S102:在目标信号接收引脚Rxa从Lin总线110接收唤醒信号S1的过程中,当唤醒信号S1出现第一有效跳变沿时,开始计数,并对目标信号接收引脚Rxa配置第二有效跳变沿,第二有效跳变沿不同于第一有效跳变沿、且用以指示计数的结束;The second configuration step S102: in the process of the target signal receiving pin Rxa receiving the wake-up signal S1 from the Lin bus 110, when the wake-up signal S1 has a first valid transition edge, the counting starts, and the target signal receiving pin Rxa is configured with a second valid transition edge, the second valid transition edge is different from the first valid transition edge, and is used to indicate the end of the counting;

判断步骤S103:当唤醒信号S1出现第二有效跳变沿时,结束计数,并至少基于开始和结束计算计数的时长,并根据时长判断唤醒信号S1的有效性。Determining step S103: when the second valid transition edge of the wake-up signal S1 appears, the counting is ended, and the duration of the counting is calculated at least based on the start and end, and the validity of the wake-up signal S1 is determined according to the duration.

具体的,请继续参阅图4,如图4所示,各Lin通道(120a、120b和120c)包括对应的Lin控制器(130a、130b和130c),且各信号接收引脚(Rxa、Rxb和Rxc)设置于对应的Lin控制器上。进一步地,在一些实施方式下,上述检测方法中的“计数”以及“计算”由Lin控制器来执行。Specifically, please continue to refer to Figure 4. As shown in Figure 4, each Lin channel (120a, 120b and 120c) includes a corresponding Lin controller (130a, 130b and 130c), and each signal receiving pin (Rxa, Rxb and Rxc) is set on the corresponding Lin controller. Further, in some embodiments, the "counting" and "calculation" in the above detection method are performed by the Lin controller.

具体的,上述有效的唤醒信号S1是指在某一电位持续了一定时间的信号。示例性的,Lin总线110上的有效的唤醒信号S1可以是持续250微秒(um)至5毫秒(ms)的低电平信号。Specifically, the effective wake-up signal S1 is a signal that lasts for a certain period of time at a certain potential. Exemplarily, the effective wake-up signal S1 on the Lin bus 110 may be a low-level signal that lasts for 250 microseconds (um) to 5 milliseconds (ms).

进一步地,判断步骤S103中的“根据时长判断唤醒信号S1的有效性”,可以以150微秒为时长的阈值来进行判断,至少包括以下步骤:Furthermore, the determination of “determining the validity of the wake-up signal S1 according to the duration” in step S103 may be performed with a threshold of 150 microseconds as the duration, and at least includes the following steps:

当时长大于150微秒时,确定唤醒信号S1为有效。When the duration is greater than 150 microseconds, the wake-up signal S1 is determined to be valid.

需要说明的是,在一些实施方式中,是以“处于休眠状态的目标Lin通道是否接收到一帧数据”作为“时长是否达到150微秒”的标志。It should be noted that, in some implementations, "whether the target Lin channel in the sleep state receives a frame of data" is used as a sign of "whether the duration reaches 150 microseconds".

具体的,一帧数据包括若干个字节数据,当目标Lin通道120a处于休眠状态和工作状态时,其目标信号接收引脚Rxa都可以接收数据。Specifically, one frame of data includes several bytes of data. When the target Lin channel 120a is in a dormant state and a working state, its target signal receiving pin Rxa can receive data.

进一步地,在这种实施方式中,当目标信号接收引脚Rxa接收到一字节数据时,会产生接收缓冲区非空中断(也称“RXNE中断”),以在对应的中断处理函数中判断目标Lin通道120a是否处于休眠状态,并且,当确定目标Lin通道120a处于休眠状态时,使能idle中断(也称“空闲中断”),idle中断用以指示一帧数据传输的结束,当目标信号接收引脚Rxa接收到一帧数据后,会产生idle中断。也就是说,在这种实施方式下,当接连产生了一个RXNE中断和一个idle中断时,就标志着一帧数据已经传输完成,也即,标志着时长已经达到150微秒,从而,目标Lin通道120a被唤醒。Further, in this embodiment, when the target signal receiving pin Rxa receives a byte of data, a receiving buffer non-empty interrupt (also called "RXNE interrupt") is generated to determine whether the target Lin channel 120a is in a dormant state in the corresponding interrupt processing function, and when it is determined that the target Lin channel 120a is in a dormant state, an idle interrupt (also called "idle interrupt") is enabled. The idle interrupt is used to indicate the end of a frame of data transmission. When the target signal receiving pin Rxa receives a frame of data, an idle interrupt is generated. That is, in this embodiment, when an RXNE interrupt and an idle interrupt are generated in succession, it indicates that a frame of data has been transmitted, that is, it indicates that the duration has reached 150 microseconds, and thus, the target Lin channel 120a is awakened.

但是,在这种实施方式下,一方面,若处于休眠状态的目标Lin通道120a所对应的目标信号接收引脚Rxa上所接收到的一帧数据的传输频率过高(如大于10k赫兹),那么,会导致处理器将持续时长不足预定标准(如150微秒)的一帧数据误判为有效的唤醒信号S1,从而使得目标Lin通道120a被误唤醒。另一方面,这种实施方式需要Lin驱动模块100可以检测出一帧数据的传输是否完成并在完整地接收到一帧数据后产生idle中断,由于一些硬件(如非Lin协议的Lin控制器)并不支持上述检测以及上述idle中断的产生,因此,这种实施方式的适用性不高。However, in this implementation, on the one hand, if the transmission frequency of a frame of data received on the target signal receiving pin Rxa corresponding to the target Lin channel 120a in the dormant state is too high (such as greater than 10k Hz), then the processor will mistakenly judge a frame of data that lasts less than a predetermined standard (such as 150 microseconds) as a valid wake-up signal S1, thereby causing the target Lin channel 120a to be mistakenly awakened. On the other hand, this implementation requires that the Lin driver module 100 can detect whether the transmission of a frame of data is completed and generate an idle interrupt after receiving a frame of data completely. Since some hardware (such as a Lin controller that is not a Lin protocol) does not support the above detection and the generation of the above idle interrupt, the applicability of this implementation is not high.

现在返回继续参考图1和图4,在本发明实施例中,针对上述问题,本案发明人提出,对于非Lin协议的Lin控制器,可以对唤醒信号S1中出现的某一电位的持续时间进行计数,并计算得到对应的时长,从而,处理器可以直接以“时长的大小”作为“时长是否达到阈值”的判断依据,使得该判断步骤的可靠性更高。Now return to continue to refer to Figures 1 and 4. In an embodiment of the present invention, in response to the above-mentioned problems, the inventor of this case proposes that, for a Lin controller that is not a Lin protocol, the duration of a certain potential appearing in the wake-up signal S1 can be counted, and the corresponding duration can be calculated. Thus, the processor can directly use the "length of the duration" as the basis for judging "whether the duration reaches the threshold", thereby making the reliability of the judgment step higher.

进一步地,在本发明实施例中,Lin控制器(130a、130b以及130c)在硬件上由非Lin协议控制器实现。具体的,Lin控制器可以基于通用异步收发传输器(UniversalSynchronous Asynchronous Receiver Transmitter,UART)的硬件实现,或者,基于串行通信接口(Serial Communication Interface,SCI)协议的控制器的硬件实现。Further, in the embodiment of the present invention, the Lin controller (130a, 130b and 130c) is implemented in hardware by a non-Lin protocol controller. Specifically, the Lin controller can be based on the hardware implementation of a Universal Synchronous Asynchronous Receiver Transmitter (UART), or based on the hardware implementation of a controller of a Serial Communication Interface (SCI) protocol.

进一步地,本案发明人还提出,由于信号在“开始维持某一电位”和“结束维持某一电位”这两个节点下的跳变沿是不同的,因此,可以在唤醒信号S1出现某一跳变沿的前后,对目标信号接收引脚Rxa配置不同的有效跳变沿,不同的有效跳变沿可以触发不同的计数操作(如计数的开始以及结束),从而,在目标信号接收引脚Rxa接收唤醒信号S1的过程中,可以利用唤醒信号S1中不同跳变沿在不同节点下的有效性来触发上述计数操作,以精确定位唤醒信号S1维持某一电位的开始节点和结束节点,提高了后续计算得到的该计数所对应的时长的精准度,保证了处理器对唤醒信号S1有效性判断的可靠性,避免了目标Lin通道120a被误唤醒。Furthermore, the inventor of this case also proposed that since the transition edges of the signal at the two nodes of "starting to maintain a certain potential" and "ending to maintain a certain potential" are different, different valid transition edges can be configured for the target signal receiving pin Rxa before and after a certain transition edge appears in the wake-up signal S1. Different valid transition edges can trigger different counting operations (such as the start and end of counting). Therefore, in the process of the target signal receiving pin Rxa receiving the wake-up signal S1, the validity of different transition edges in the wake-up signal S1 at different nodes can be used to trigger the above-mentioned counting operation, so as to accurately locate the start node and the end node of the wake-up signal S1 maintaining a certain potential, thereby improving the accuracy of the time length corresponding to the count obtained by subsequent calculation, ensuring the reliability of the processor's judgment on the validity of the wake-up signal S1, and avoiding the target Lin channel 120a from being woken up by mistake.

具体的,请参考图1中的第一配置步骤S101和第二配置步骤S102,在本发明实施例中,是选择在目标Lin通道120a处于休眠状态时,对目标信号接收引脚Rxa配置第一有效跳变沿,并且,选择在唤醒信号S1出现第一有效跳变沿时,开始计数,并对目标信号接收引脚Rxa配置第二有效跳变沿。也就是说,在唤醒信号S1出现第一有效跳变沿时,表示唤醒信号S1开始在某一电位进行维持,第一有效跳变沿会触发处理器开始对上述某一电位的持续时间进行计数,之后,在唤醒信号S1出现第二有效跳变沿时,表示唤醒信号S1结束对上述某一电位的维持,相应的,第二有效跳变沿会触发处理器结束上述计数。Specifically, please refer to the first configuration step S101 and the second configuration step S102 in FIG1. In the embodiment of the present invention, when the target Lin channel 120a is in a dormant state, the target signal receiving pin Rxa is configured with a first valid transition edge, and when the first valid transition edge of the wake-up signal S1 appears, counting is started, and the target signal receiving pin Rxa is configured with a second valid transition edge. That is, when the first valid transition edge of the wake-up signal S1 appears, it indicates that the wake-up signal S1 begins to maintain a certain potential, and the first valid transition edge triggers the processor to start counting the duration of the above-mentioned potential. Afterwards, when the second valid transition edge of the wake-up signal S1 appears, it indicates that the wake-up signal S1 ends maintaining the above-mentioned potential, and accordingly, the second valid transition edge triggers the processor to end the above-mentioned counting.

进一步地,上文所述的“对目标信号接收引脚Rxa配置第一有效跳变沿/第二有效跳变沿”可以通过处理器上运行的软件配置寄存器(Register)来实现。Furthermore, the above-mentioned “configuring the first valid transition edge/the second valid transition edge for the target signal receiving pin Rxa” can be implemented by configuring a register (Register) through software running on a processor.

例如,请参阅图5所示出的根据本发明而成的实施例提供的控制装置200的结构示意图,控制装置200包括目标控制寄存器RG1(图6a示出了目标控制寄存器RG1所对应的位域的示意图)。在本发明实施例中,目标Lin通道120a与目标控制寄存器RG1相映射,其中:For example, referring to FIG. 5 , which is a schematic diagram of the structure of a control device 200 provided according to an embodiment of the present invention, the control device 200 includes a target control register RG1 ( FIG. 6 a shows a schematic diagram of a bit field corresponding to the target control register RG1). In an embodiment of the present invention, the target Lin channel 120a is mapped to the target control register RG1, wherein:

上述第一配置步骤S101中的“对目标信号接收引脚Rxa配置第一有效跳变沿”这一步骤,至少可以包括:将目标控制寄存器RG1中的值配置为第一预设值,以使目标信号接收引脚Rxa根据第一预设值确定唤醒信号S1中的第一有效跳变沿;The step of “configuring a first valid transition edge for the target signal receiving pin Rxa” in the first configuration step S101 may at least include: configuring the value in the target control register RG1 to be a first preset value, so that the target signal receiving pin Rxa determines the first valid transition edge in the wake-up signal S1 according to the first preset value;

上述第二配置步骤S102中的“对目标信号接收引脚Rxa配置第二有效跳变沿”这一步骤,至少可以包括:将目标控制寄存器RG1中的值配置为第二预设值,以使目标信号接收引脚Rxa根据第二预设值确定唤醒信号S1中的第二有效跳变沿。The step of "configuring a second valid transition edge for the target signal receiving pin Rxa" in the above-mentioned second configuration step S102 may at least include: configuring the value in the target control register RG1 to a second preset value, so that the target signal receiving pin Rxa determines the second valid transition edge in the wake-up signal S1 according to the second preset value.

需要说明的是,第一预设值可以是0,第二预设值可以是1,唤醒信号S1中的低电平可以与“0”值相对应,且唤醒信号S1中的高电平可以与“1”值相对应,在这种配置方式下,上述第一有效跳变沿为下降沿,上述第二有效跳变沿为上升沿。It should be noted that the first preset value can be 0, the second preset value can be 1, the low level in the wake-up signal S1 can correspond to the "0" value, and the high level in the wake-up signal S1 can correspond to the "1" value. In this configuration, the above-mentioned first valid transition edge is a falling edge, and the above-mentioned second valid transition edge is a rising edge.

举例来说,在目标控制寄存器RG1中的值被配置为“0”值的情况下,当唤醒信号S1出现下降沿时,会具有与“0”值相对应的低电平,从而,处理器确定目标信号接收引脚Rxa接收到了唤醒信号S1中作为第一有效跳变沿的下降沿。相应的,在目标控制寄存器RG1中的值被配置为“1”值的情况下,当唤醒信号S1出现上升沿时,会具有与“1”值相对应的高电平,从而,处理器确定目标信号接收引脚Rxa接收到了唤醒信号S1中作为第二有效跳变沿的上升沿。For example, when the value in the target control register RG1 is configured as a "0" value, when the wake-up signal S1 has a falling edge, it will have a low level corresponding to the "0" value, so that the processor determines that the target signal receiving pin Rxa has received the falling edge of the wake-up signal S1 as the first valid transition edge. Correspondingly, when the value in the target control register RG1 is configured as a "1" value, when the wake-up signal S1 has a rising edge, it will have a high level corresponding to the "1" value, so that the processor determines that the target signal receiving pin Rxa has received the rising edge of the wake-up signal S1 as the second valid transition edge.

应当理解的是,在根据本发明而成的其他变形例中,当第一预设值是0,第二预设值是1,且唤醒信号S1中的高电平与“0”值相对应,且唤醒信号S1中的低电平与“1”值相对应时,上述第一有效跳变沿为上升沿,且上述第二有效跳变沿为下降沿。其他配置方式在此不作赘述。It should be understood that in other variations according to the present invention, when the first preset value is 0, the second preset value is 1, and the high level in the wake-up signal S1 corresponds to the value "0", and the low level in the wake-up signal S1 corresponds to the value "1", the first valid transition edge is a rising edge, and the second valid transition edge is a falling edge. Other configurations are not described in detail herein.

进一步地,本案发明人还提出,考虑到当Lin总线110上有唤醒信号S1出现时,处理器可能正处于其他操作的处理进程中而无法对唤醒信号S1进行检测和判断,因此,为了提高目标Lin通道120a对唤醒信号S1响应的及时性,可以设置相应的中断来提高处理器对唤醒信号S1进行上述检测与判断处理的优先级。Furthermore, the inventor of the present case also proposed that, considering that when a wake-up signal S1 appears on the Lin bus 110, the processor may be in the process of processing other operations and cannot detect and judge the wake-up signal S1, therefore, in order to improve the timeliness of the target Lin channel 120a's response to the wake-up signal S1, a corresponding interrupt can be set to increase the priority of the processor's detection and judgment processing of the wake-up signal S1.

例如,请参阅图2所示出的根据本发明而成的实施例提供的唤醒信号S1的检测方法的进一步流程示意图,如图2所示,在第一配置步骤S101之前,检测方法还包括中断使能步骤S104,具体如下:For example, please refer to FIG. 2 for a further flow chart of a detection method of a wake-up signal S1 according to an embodiment of the present invention. As shown in FIG. 2 , before the first configuration step S101, the detection method further includes an interrupt enabling step S104, which is as follows:

当目标Lin通道120a进入休眠状态时,使能跳变沿检测中断。When the target Lin channel 120a enters the sleep state, the transition edge detection interrupt is enabled.

进一步地,如图2所示,当唤醒信号S1出现第一有效跳变沿时,第二配置步骤S102还包括第一中断步骤S1022,例如:进入目标Lin通道120a对应的跳变沿检测中断,以开始计数。相应的,当唤醒信号S1出现第二有效跳变沿时,判断步骤S103还包括第二中断步骤S1032,例如:进入目标Lin通道120a对应的跳变沿检测中断,以结束计数。Further, as shown in FIG2 , when the wake-up signal S1 has a first valid transition edge, the second configuration step S102 further includes a first interruption step S1022, for example, entering the transition edge detection interrupt corresponding to the target Lin channel 120a to start counting. Correspondingly, when the wake-up signal S1 has a second valid transition edge, the determination step S103 further includes a second interruption step S1032, for example, entering the transition edge detection interrupt corresponding to the target Lin channel 120a to end counting.

进一步地,如图2所示,在判断步骤S103之后,检测方法还包括中断去能步骤S105,具体如下:Further, as shown in FIG. 2 , after the determination step S103 , the detection method further includes an interruption disabling step S105 , which is specifically as follows:

去能跳变沿检测中断。Disable edge detection interrupt.

需要说明的是,上文所述的“配置使得目标Lin通道120a进入跳变沿检测中断”也可以通过处理器上运行的软件配置寄存器(Register)来实现。It should be noted that the above-mentioned “configuring the target Lin channel 120a to enter the transition edge detection interrupt” can also be implemented by configuring a register (Register) through software running on a processor.

例如,请继续参阅图5,如图5所示,控制装置200还包括目标状态寄存器RG2(图6b示出了目标状态寄存器RG2所对应的位域的示意图)。在本发明实施例中,目标Lin通道120a与目标状态寄存器RG2相映射,上述“配置使得目标Lin通道120a进入跳变沿检测中断”的步骤至少可以包括:For example, please continue to refer to FIG. 5 , as shown in FIG. 5 , the control device 200 further includes a target state register RG2 ( FIG. 6 b shows a schematic diagram of the bit field corresponding to the target state register RG2). In an embodiment of the present invention, the target Lin channel 120a is mapped to the target state register RG2, and the above-mentioned step of “configuring the target Lin channel 120a to enter the transition edge detection interrupt” may at least include:

对目标状态寄存器RG2中的值进行配置,以在值的指示下触发进入跳变沿检测中断。The value in the target status register RG2 is configured to trigger an entry transition edge detection interrupt under the indication of the value.

接下来,将结合图3示出的根据本发明而成的实施例提供的唤醒信号S1的检测方法的时序图,来对上文所提到的检测方法的各步骤之间的配合进行完整的叙述。Next, the coordination between the various steps of the above-mentioned detection method will be fully described in conjunction with the timing diagram of the detection method of the wake-up signal S1 provided according to the embodiment of the present invention shown in FIG. 3 .

在图3所示的t1时刻下,目标Lin通道120a由工作状态进入休眠状态,此时,处理器(例如通过处理器上运行的软件)会配置目标状态寄存器RG2中的值,以使能跳变沿检测中断。进一步地,在目标Lin通道120a处于休眠状态的过程中,处理器(例如通过处理器上运行的软件)会基于目标控制寄存器RG1来对目标信号接收引脚Rxa配置第一有效跳变沿(例如,在目标控制寄存器RG1中写入0而将第一有效跳变沿配置为下降沿),在t2时刻下,处理器受目标信号接收引脚Rxa接收到的唤醒信号S1中的下降沿的触发而暂停其他操作的处理进程,并进入跳变沿检测中断以开始计数,且会基于目标控制寄存器RG1来对目标信号接收引脚Rxa配置第二有效跳变沿(示例的,在目标控制寄存器RG1中写入1而将第二有效跳变沿配置为上升沿),在t3时刻下,处理器(例如通过处理器上运行的软件)受目标信号接收引脚Rxa接收到的唤醒信号S1中的上升沿的触发而暂停其他操作的处理进程,并进入跳变沿检测中断以结束计数,然后,配置目标状态寄存器RG2中的值,以去能跳变沿检测中断。之后,根据计数的开始和结束计算该计数的时长,并根据时长判断唤醒信号S1的有效性。At time t1 shown in FIG. 3 , the target Lin channel 120a enters the sleep state from the working state. At this time, the processor (eg, through software running on the processor) configures the value in the target state register RG2 to enable the transition edge detection interrupt. Further, when the target Lin channel 120a is in a sleep state, the processor (for example, through the software running on the processor) configures the first valid transition edge of the target signal receiving pin Rxa based on the target control register RG1 (for example, write 0 in the target control register RG1 and configure the first valid transition edge as a falling edge). At time t2, the processor is triggered by the falling edge of the wake-up signal S1 received by the target signal receiving pin Rxa to suspend the processing of other operations, and enters the transition edge detection interrupt to start counting, and configures the second valid transition edge of the target signal receiving pin Rxa based on the target control register RG1 (for example, write 1 in the target control register RG1 and configure the second valid transition edge as a rising edge). At time t3, the processor (for example, through the software running on the processor) is triggered by the rising edge of the wake-up signal S1 received by the target signal receiving pin Rxa to suspend the processing of other operations, and enter the transition edge detection interrupt to end the counting, and then configure the value in the target status register RG2 to disable the transition edge detection interrupt. Afterwards, the duration of the count is calculated according to the start and end of the count, and the validity of the wake-up signal S1 is determined according to the duration.

具体的,在一些实施方式中,结合图3和图2,处理器完成步骤S104和S101对目标状态寄存器RG2和RG1的配置后,由Lin控制器(130a、130b或130c)的硬件监测唤醒信号S1的有效跳变沿,具体而言:当Lin控制器(130a、130b或130c)的硬件在t2时刻监测到唤醒信号S1中的下降沿时,产生中断信号以触发处理器进入目标Lin通道(120a、120b或120c)对应的跳变沿检测中断,以执行所述步骤S1021和步骤S1022;当Lin控制器(130a、130b或130c)的硬件在t3时刻监测到唤醒信号S1中的上升沿时,产生中断信号以触发处理器进入目标Lin通道(120a、120b或120c)对应的跳变沿检测中断,以执行所述步骤S1031和步骤S1032。具体的,在一些实施方式中,是基于宏(Macro)来实现Lin通道(120a、120b和120c)的工作状态和休眠状态,因此,可以对相关的宏定义多个不同的状态(state),当对上述相关的宏配置对应的状态时,可以使Lin通道处于工作状态或者休眠状态。Specifically, in some embodiments, in combination with FIG. 3 and FIG. 2, after the processor completes the configuration of the target state registers RG2 and RG1 in steps S104 and S101, the hardware of the Lin controller (130a, 130b or 130c) monitors the effective transition edge of the wake-up signal S1. Specifically, when the hardware of the Lin controller (130a, 130b or 130c) monitors the falling edge of the wake-up signal S1 at time t2, an interrupt signal is generated to trigger the processor to enter the target L The jump edge detection interrupt corresponding to the target Lin channel (120a, 120b or 120c) is used to execute the steps S1021 and S1022; when the hardware of the Lin controller (130a, 130b or 130c) detects the rising edge in the wake-up signal S1 at time t3, an interrupt signal is generated to trigger the processor to enter the jump edge detection interrupt corresponding to the target Lin channel (120a, 120b or 120c) to execute the steps S1031 and S1032. Specifically, in some embodiments, the working state and the sleeping state of the Lin channel (120a, 120b and 120c) are realized based on the macro (Macro), therefore, a plurality of different states (state) can be defined for the related macros, and when the corresponding states are configured for the above-mentioned related macros, the Lin channel can be in the working state or the sleeping state.

例如,在判断步骤S103之后,检测方法还可以包括以下步骤:For example, after determining step S103, the detection method may further include the following steps:

当判断的结果指示唤醒信号S1有效时,将预设宏配置为第一状态,以使目标Lin通道120a从休眠状态进入工作状态。When the determination result indicates that the wake-up signal S1 is valid, the preset macro is configured to the first state, so that the target Lin channel 120a enters the working state from the sleep state.

具体的,在一些实施方式下,当Lin总线110空闲超过一定时间,或者,当主模块(如处理器)和/或Lin通道(120a、120b和120c)收到指示其需要跳转至休眠状态的指令(例如“Go to Sleep/Go to Sleep Internal”)时,其会从工作状态跳转至休眠状态。Specifically, in some embodiments, when the Lin bus 110 is idle for more than a certain period of time, or when the main module (such as a processor) and/or the Lin channel (120a, 120b and 120c) receives an instruction indicating that it needs to jump to a sleep state (for example, "Go to Sleep/Go to Sleep Internal"), it will jump from a working state to a sleep state.

具体的,上述操作也可以基于对预设宏的配置来实现,例如,检测方法还可以包括以下步骤:Specifically, the above operation may also be implemented based on the configuration of a preset macro. For example, the detection method may further include the following steps:

当目标Lin通道120a处于工作状态时,将预设宏配置为第二状态,以使目标Lin通道120a从工作状态进入休眠状态。When the target Lin channel 120a is in the working state, the preset macro is configured to the second state, so that the target Lin channel 120a enters the dormant state from the working state.

进一步地,在一些实施方式中,当Lin通道(120a、120b和120c)中的硬件支持低功耗模式时,可以在目标Lin通道120a从工作状态进入休眠状态后,将目标Lin通道120a配置为低功耗模式,以进一步降低目标Lin通道120a的静态功耗。Furthermore, in some embodiments, when the hardware in the Lin channels (120a, 120b, and 120c) supports the low power consumption mode, the target Lin channel 120a can be configured to the low power consumption mode after the target Lin channel 120a enters the sleep state from the working state to further reduce the static power consumption of the target Lin channel 120a.

进一步地,在主模块和/或Lin通道进入休眠状态后,主模块和/或Lin通道均可以向Lin总线110发出唤醒信号S1。Furthermore, after the main module and/or the Lin channel enters the sleep state, the main module and/or the Lin channel may send a wake-up signal S1 to the Lin bus 110 .

请参阅图5,图5示出了根据本发明而成的实施例提供的控制装置200的结构示意图,从图中可以看到控制装置200的各组成部分,以及各组成部分的相对位置关系。Please refer to FIG5 , which shows a schematic diagram of the structure of a control device 200 provided in an embodiment according to the present invention. From the figure, it can be seen the various components of the control device 200 and the relative position relationship of the various components.

如图5所示,控制装置200至少包括如上文所述的Lin驱动模块100以及处理器210。接下来,将结合图5,对控制装置200中的各部件进行详细说明。As shown in Fig. 5, the control device 200 at least includes the Lin driver module 100 and the processor 210 as described above. Next, the components in the control device 200 will be described in detail in conjunction with Fig. 5.

需要说明的是,在本发明实施例中,控制装置200可以是集成有中央处理器(Central Processing Unit,CPU)、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、定时器模块以及若干输入/输出(Input/Output,I/O)接口的片上系统,如微控制单元(Micro-controller Unit,MCU)。It should be noted that, in the embodiment of the present invention, the control device 200 can be a system on a chip that integrates a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM), a timer module and several input/output (I/O) interfaces, such as a micro-controller unit (MCU).

具体的,处理器210可以是上述中央处理器,处理器210与Lin驱动模块100耦接,并被配置为执行如上文所述的唤醒信号的检测方法中的各步骤,如第一配置步骤S101、第二配置步骤S102和判断步骤S103。Specifically, the processor 210 may be the above-mentioned central processing unit, the processor 210 is coupled to the Lin driver module 100, and is configured to execute the steps in the wake-up signal detection method as described above, such as the first configuration step S101, the second configuration step S102 and the determination step S103.

进一步地,在一些实施方式中,上文所述的“对唤醒信号S1中出现的某一电位的持续时间进行计数”这一操作,可以由Lin驱动模块100中的Lin控制器(120a、120b以及120c)执行,具体的,基于Lin控制器内部的计数模块执行。而在另外一些实施方式中,上述计数还可以由控制装置200的定时器模块执行。Further, in some embodiments, the above-mentioned operation of "counting the duration of a certain potential appearing in the wake-up signal S1" can be performed by the Lin controller (120a, 120b and 120c) in the Lin driver module 100, specifically, based on the counting module inside the Lin controller. In other embodiments, the above counting can also be performed by the timer module of the control device 200.

根据前述内容,本发明实施例提供了一种唤醒信号的检测方法以及控制装置,其中,唤醒信号的检测方法应用于Lin驱动模块,Lin驱动模块包括Lin总线和至少一Lin通道,Lin总线与各Lin通道耦接,各Lin通道具有对应的信号接收引脚,其中,至少一Lin通道包括目标Lin通道,目标Lin通道具有目标信号接收引脚。检测方法至少包括:当目标Lin通道处于休眠状态时,对目标信号接收引脚配置第一有效跳变沿,第一有效跳变沿用以指示计数的开始;在目标信号接收引脚从Lin总线接收唤醒信号的过程中,当唤醒信号出现第一有效跳变沿时,开始计数,并对目标信号接收引脚配置第二有效跳变沿,第二有效跳变沿不同于第一有效跳变沿、且用以指示计数的结束;之后,当唤醒信号出现第二有效跳变沿时,结束计数,并至少基于开始和结束计算计数的时长,并根据时长判断唤醒信号的有效性。本发明通过在唤醒信号出现第一有效跳变沿的前后,对目标信号接收引脚配置不同的有效跳变沿,以控制对唤醒信号中某一电位持续时间的计数的开始和结束,使得所计算的持续时间更加精准,因此,保证了对唤醒信号有效性判断的可靠性,避免了时钟频率较高的应用场景下唤醒信号被误判从而导致目标Lin通道被误唤醒。According to the foregoing content, an embodiment of the present invention provides a detection method and a control device for a wake-up signal, wherein the detection method for the wake-up signal is applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each Lin channel, each Lin channel has a corresponding signal receiving pin, wherein at least one Lin channel includes a target Lin channel, and the target Lin channel has a target signal receiving pin. The detection method at least includes: when the target Lin channel is in a dormant state, a first valid transition edge is configured for the target signal receiving pin, and the first valid transition edge is used to indicate the start of counting; in the process of the target signal receiving pin receiving the wake-up signal from the Lin bus, when the wake-up signal has the first valid transition edge, the counting starts, and the target signal receiving pin is configured with a second valid transition edge, the second valid transition edge is different from the first valid transition edge, and is used to indicate the end of counting; thereafter, when the wake-up signal has the second valid transition edge, the counting ends, and the duration of the counting is calculated at least based on the start and end, and the validity of the wake-up signal is judged according to the duration. The present invention configures different valid transition edges for the target signal receiving pin before and after the first valid transition edge of the wake-up signal appears, so as to control the start and end of counting the duration of a certain potential in the wake-up signal, thereby making the calculated duration more accurate. Therefore, the reliability of judging the validity of the wake-up signal is ensured, and the wake-up signal is avoided from being misjudged in application scenarios with a high clock frequency, thereby causing the target Lin channel to be mistakenly awakened.

除上述实施例外,本发明还可以有其他实施方式。凡采用等同替换或等效替换形成的技术方案,均落在本发明要求的保护范围。In addition to the above embodiments, the present invention may also have other implementations. Any technical solution formed by equivalent replacement or equivalent replacement falls within the protection scope required by the present invention.

综上所述,虽然本发明已将优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。In summary, although the preferred embodiments of the present invention have been disclosed as above, the above preferred embodiments are not intended to limit the present invention. Ordinary technicians in this field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined in the claims.

Claims (13)

1.一种唤醒信号的检测方法,其特征在于,应用于Lin驱动模块,所述Lin驱动模块包括Lin总线和至少一Lin通道,所述Lin总线与各所述Lin通道耦接,各所述Lin通道具有对应的信号接收引脚,其中,所述至少一Lin通道包括目标Lin通道,所述目标Lin通道具有目标信号接收引脚,所述检测方法至少包括:1. A method for detecting a wake-up signal, characterized in that it is applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each of the Lin channels, each of the Lin channels has a corresponding signal receiving pin, wherein the at least one Lin channel includes a target Lin channel, the target Lin channel has a target signal receiving pin, and the detection method at least includes: 当所述目标Lin通道处于休眠状态时,对所述目标信号接收引脚配置第一有效跳变沿,所述第一有效跳变沿用以指示计数的开始;When the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, wherein the first valid transition edge is used to indicate the start of counting; 在所述目标信号接收引脚从所述Lin总线接收唤醒信号的过程中,当所述唤醒信号出现所述第一有效跳变沿时,开始所述计数,并对所述目标信号接收引脚配置第二有效跳变沿,所述第二有效跳变沿不同于所述第一有效跳变沿、且用以指示所述计数的结束;以及,In the process that the target signal receiving pin receives the wake-up signal from the Lin bus, when the first valid transition edge appears in the wake-up signal, the counting is started, and a second valid transition edge is configured for the target signal receiving pin, the second valid transition edge is different from the first valid transition edge and is used to indicate the end of the counting; and, 当所述唤醒信号出现所述第二有效跳变沿时,结束所述计数,并至少基于所述开始和所述结束计算所述计数的时长,并根据所述时长判断所述唤醒信号的有效性。When the second valid transition edge appears in the wake-up signal, the counting is ended, and the duration of the counting is calculated based on at least the start and the end, and the validity of the wake-up signal is determined according to the duration. 2.根据权利要求1所述的检测方法,其特征在于,所述检测方法还包括:2. The detection method according to claim 1, characterized in that the detection method further comprises: 当所述目标Lin通道进入所述休眠状态时,使能跳变沿检测中断;When the target Lin channel enters the dormant state, enabling a transition edge detection interrupt; 当所述唤醒信号出现所述第一有效跳变沿时,进入所述目标Lin通道对应的所述跳变沿检测中断,以开始所述计数;以及,When the first valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to start the counting; and 当所述唤醒信号出现所述第二有效跳变沿时,进入所述目标Lin通道对应的所述跳变沿检测中断,以结束所述计数,并去能所述跳变沿检测中断。When the second valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to end the counting and disable the transition edge detection interrupt. 3.根据权利要求1所述的检测方法,其特征在于,所述目标Lin通道与目标控制寄存器相映射,其中:3. The detection method according to claim 1, characterized in that the target Lin channel is mapped to a target control register, wherein: 所述对所述目标信号接收引脚配置第一有效跳变沿的步骤至少包括:将所述目标控制寄存器中的值配置为第一预设值,以使所述目标信号接收引脚根据所述第一预设值确定所述唤醒信号中的所述第一有效跳变沿;The step of configuring the target signal receiving pin with a first valid transition edge at least comprises: configuring the value in the target control register to be a first preset value, so that the target signal receiving pin determines the first valid transition edge in the wake-up signal according to the first preset value; 所述对所述目标信号接收引脚配置第二有效跳变沿的步骤至少包括:将所述目标控制寄存器中的值配置为第二预设值,以使所述目标信号接收引脚根据所述第二预设值确定所述唤醒信号中的所述第二有效跳变沿。The step of configuring the target signal receiving pin with a second valid transition edge at least includes: configuring the value in the target control register to a second preset value, so that the target signal receiving pin determines the second valid transition edge in the wake-up signal according to the second preset value. 4.根据权利要求2所述的检测方法,其特征在于,所述目标Lin通道与目标状态寄存器相映射,所述配置使得所述目标Lin通道进入所述跳变沿检测中断的步骤至少包括:4. The detection method according to claim 2, characterized in that the target Lin channel is mapped to a target status register, and the step of configuring the target Lin channel to enter the transition edge detection interruption at least comprises: 对所述目标状态寄存器中的值进行配置,以在所述值的指示下触发进入所述跳变沿检测中断。The value in the target status register is configured to trigger entry into the transition edge detection interrupt under the indication of the value. 5.根据权利要求1所述的检测方法,其特征在于,各所述Lin通道包括Lin控制器,所述信号接收引脚设置于所述Lin控制器上,其中,所述Lin控制器由非Lin协议控制器硬件实现。5. The detection method according to claim 1, characterized in that each of the Lin channels comprises a Lin controller, the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware. 6.根据权利要求5所述的检测方法,其特征在于,所述Lin控制器被配置为执行所述计数。6 . The detection method according to claim 5 , wherein the Lin controller is configured to perform the counting. 7.根据权利要求5所述的检测方法,其特征在于,所述Lin控制器更被配置为执行所述计算。7 . The detection method according to claim 5 , wherein the Lin controller is further configured to perform the calculation. 8.根据权利要求1所述的检测方法,其特征在于,所述第一有效跳变沿为下降沿,且所述第二有效跳变沿为上升沿。8 . The detection method according to claim 1 , wherein the first valid transition edge is a falling edge, and the second valid transition edge is a rising edge. 9.根据权利要求1所述的检测方法,其特征在于,所述检测方法还包括:9. The detection method according to claim 1, characterized in that the detection method further comprises: 当所述判断的结果指示所述唤醒信号有效时,将预设宏配置为第一状态,以使所述目标Lin通道从所述休眠状态进入工作状态。When the result of the determination indicates that the wake-up signal is valid, the preset macro is configured to a first state, so that the target Lin channel enters a working state from the sleep state. 10.根据权利要求1所述的检测方法,其特征在于,所述根据所述时长判断所述唤醒信号的有效性的步骤至少包括:10. The detection method according to claim 1, wherein the step of judging the validity of the wake-up signal according to the duration at least comprises: 当所述时长大于150微秒时,确定所述唤醒信号为有效。When the duration is greater than 150 microseconds, it is determined that the wake-up signal is valid. 11.一种控制装置,其特征在于,所述控制装置至少包括:11. A control device, characterized in that the control device at least comprises: 如权利要求1至10任一项所述的Lin驱动模块;以及,The Lin driver module according to any one of claims 1 to 10; and 处理器,与所述Lin驱动模块耦接,并被配置为执行如权利要求1至12任一项所述的唤醒信号的检测方法。A processor is coupled to the Lin driving module and configured to execute the wake-up signal detection method according to any one of claims 1 to 12. 12.根据权利要求11所述的控制装置,其特征在于,各所述Lin通道包括Lin控制器,所述信号接收引脚设置于所述Lin控制器上,其中,所述Lin控制器由非Lin协议控制器硬件实现。12. The control device according to claim 11, characterized in that each of the Lin channels comprises a Lin controller, the signal receiving pin is arranged on the Lin controller, and the Lin controller is implemented by non-Lin protocol controller hardware. 13.根据权利要求11所述的控制装置,其特征在于,所述控制装置还包括定时器模块,所述定时器模块被配置为执行所述计数。13 . The control device according to claim 11 , further comprising a timer module, wherein the timer module is configured to perform the counting.
CN202310317641.9A 2023-03-29 2023-03-29 Wake-up signal detection method and control device Pending CN118740540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310317641.9A CN118740540A (en) 2023-03-29 2023-03-29 Wake-up signal detection method and control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310317641.9A CN118740540A (en) 2023-03-29 2023-03-29 Wake-up signal detection method and control device

Publications (1)

Publication Number Publication Date
CN118740540A true CN118740540A (en) 2024-10-01

Family

ID=92867954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310317641.9A Pending CN118740540A (en) 2023-03-29 2023-03-29 Wake-up signal detection method and control device

Country Status (1)

Country Link
CN (1) CN118740540A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119459377A (en) * 2025-01-03 2025-02-18 广州汽车集团股份有限公司 Wake-up control method of charger and electric vehicle

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119459377A (en) * 2025-01-03 2025-02-18 广州汽车集团股份有限公司 Wake-up control method of charger and electric vehicle

Similar Documents

Publication Publication Date Title
US11010327B2 (en) I3C point to point
US7353300B2 (en) Apparatus to improve the firmware efficiency for a multiframe serial interface
CN101420308B (en) Method and system for improving pci-e l1 aspm exit latency
US9684624B2 (en) Receive clock calibration for a serial bus
US9690725B2 (en) Camera control interface extension with in-band interrupt
CN111737173A (en) I2C bus communication control method, device, system and readable storage medium
WO2007022368A2 (en) Method and apparatus for synchronizing data between different clock domains in a memory controller
CN113688086A (en) High-speed CAN transceiver baud rate matching detection system for local network
CN118467453B (en) Data transmission method, device, equipment, medium and computer program product
CN114817110B (en) Data transmission method and device
JPH06324977A (en) Data transfer method
CN118740540A (en) Wake-up signal detection method and control device
CN110865959A (en) Method and circuit for waking up I2C equipment
US9921981B2 (en) Method to minimize the number of IRQ lines from peripherals to one wire
JP2005515546A (en) Low power bus interface
WO2025077865A1 (en) Message sending control method and apparatus, vehicle and storage medium
US20200201804A1 (en) I3c device timing adjustment to accelerate in-band interrupts
CN118796743A (en) Data communication method, device, equipment and medium based on reduced pin bus
CN100547924C (en) Method and apparatus for driving multiple peripheral devices at different clock frequencies in an integrated circuit
CN118503102A (en) Single-line debugging device, system, method and equipment to be debugged
CN117971743A (en) Embedded platform synchronous communication system and method based on bus structure
CN111158339B (en) CAN bus simulation monitoring system
CN112558750A (en) Method and device for waking up chip
CN114261354B (en) Low frequency clock circuit and control method
CN118733127A (en) System control method and chip system in BootROM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination