Three-terminal communication structure and communication system
By introducing an enable signal or signal request interface into the SPI communication structure, direct communication between slave devices is allowed, solving the problem that communication in the prior art required communication through the master device, and achieving more efficient communication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING TSINGTENG MICROSYSTEM CO LTD
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-17
AI Technical Summary
When there is a communication requirement between two slave devices, communication must be done through the master device; direct communication is not possible.
Adding an enable signal interface or a signal request interface to the communication structure allows the first slave device to communicate directly with the second slave device via SPI, or to achieve direct communication under the control of the master device.
Direct communication between the first slave device and the second slave device was achieved, reducing intermediate data transmission links, lowering communication latency, and improving communication efficiency.
Smart Images

Figure CN121880248A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of SPI communication technology, and for example to a three-terminal communication structure and communication system. Background Technology
[0002] SPI (Serial Peripheral Interface) is a high-speed, full-duplex, synchronous communication bus. The bus architecture includes master-slave and master-multiple-slave structures, with the latter including standard and daisy-chain modes. The master module selects a slave module for synchronous communication, thus completing data exchange. SPI consists of four lines: MISO (Master Input Slave Output), MOSI (Master Output Slave Input), SCK (Serial Clock), and SSN (Slave Select Not). The master device can select a slave device for communication via the SSN signal.
[0003] In related technologies, the connection structure between the master device (Master) and two slave devices (Slave A and Slave B) in a master-slave device group is as follows: Figure 1 As shown, the master device can select the corresponding slave device for communication through the SSNA interface and SSNB interface.
[0004] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art: When there is a communication requirement between two slave devices, communication must be conducted through the master device; the two slave devices cannot communicate directly.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0007] This disclosure provides a three-terminal communication structure and communication system to enable direct communication between two slave devices.
[0008] In some embodiments, the three-terminal communication structure includes: a master device, a first slave device, and a second slave device; the master device is capable of SPI communication with the first slave device and the second slave device respectively; wherein, the first slave device is provided with an enable signal interface for enabling the second slave device to realize SPI communication between the first slave device and the second slave device; or, the first slave device and the master device are provided with a signal request interface, and the master device is capable of responding to the communication request sent by the first slave device and controlling the first slave device to perform SPI communication with the second slave device.
[0009] Optionally, the first slave device is provided with an enable signal interface for enabling the second slave device, including: the first slave device is provided with an SSN interface, an SCK interface, a MISO interface, a MOSI interface, and an SSNB interface; the second slave device is provided with an SSN interface, an SCK interface, a MISO interface, and a MOSI interface; the master device is provided with an SSNA interface, an SCK interface, a MISO interface, a MOSI interface, and an SSNB interface; wherein, the SSN interface of the first slave device is connected to the SSNA interface of the master device, the SCK interface of the first slave device is connected to both the SCK interface of the second slave device and the SCK interface of the master device, the MISO interface of the first slave device is connected to both the MISO interface of the second slave device and the MISO interface of the master device, the MOSI interface of the first slave device is connected to both the MOSI interface of the second slave device and the MOSI interface of the master device, and the SSNB interface of the first slave device is connected to both the SSN interface of the second slave device and the SSNB interface of the master device.
[0010] Optionally, the SPI communication between the master device and the first slave device is implemented as follows: when the master device detects that the SSNB interface is high, the master device pulls the SSNA interface low and sends SCK and MOSI signals to the first slave device through the SCK and MOSI interfaces; when the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0011] Optionally, the SPI communication between the master device and the second slave device is implemented as follows: when the master device detects that the SSNB interface is high, the master device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0012] Optionally, the SPI communication between the first slave device and the second slave device is implemented as follows: when the first slave device detects that the SSNB interface is high, the first slave device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the first slave device through the SCK and MOSI interfaces, and performs bidirectional communication with the first slave device through the MISO interface.
[0013] Optionally, the first slave device and the master device are provided with signal request interfaces, including: the first slave device is provided with a REQ interface, an SSN interface, an SCK interface, a MISO interface, and a MOSI interface; the second slave device is provided with an SSN interface, an SCK interface, a MOSI interface, and a MISO interface; the master device is provided with an SSNA interface, an SCK interface, a MOSI interface, a MISO interface, an SSNB interface, and a REQ interface; wherein, the REQ interface of the first slave device is connected to the REQ interface of the master device, the SSN interface of the first slave device is connected to the SSNA interface of the master device, the SCK interface of the first slave device is connected to both the SCK interface of the second slave device and the SCK interface of the master device, the MISO interface of the first slave device is connected to both the MOSI interface of the second slave device and the MOSI interface of the master device, the MOSI interface of the first slave device is connected to both the MISO interface of the second slave device and the MISO interface of the master device, and the SSN interface of the second slave device is connected to the SSNB interface of the master device.
[0014] Optionally, SPI communication between the master device and the first slave device is implemented as follows: When the first slave device pulls the REQ interface high, and the master device detects that the REQ interface is high and confirms that the first slave device requests to communicate with the master device, or when the master device actively communicates with the first slave device, the master device pulls the SSNA interface low, switches the MOSI interface to the MISO interface, switches the MISO port to the MOSI interface, and sends SCK and MOSI signals to the first slave device through the SCK and MOSI interfaces; when the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0015] Optionally, the SPI communication between the master device and the second slave device is implemented as follows: the master device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0016] Optionally, the SPI communication between the first slave device and the second slave device is implemented as follows: When the first slave device pulls the REQ interface high, and the master device detects that the REQ interface is high and confirms that the first slave device requests communication with the second slave device, the master device pulls the SSNA and SSNB interfaces low, and sends SCK signals to the first and second slave devices respectively through the SCK interface; when the first slave device detects that the SSNA interface is low, it sends data to the second slave device through the MISO interface and receives data sent by the second slave device through the MOSI interface; when the second slave device detects that the SSNB interface is low, it receives data sent by the first slave device through the MOSI interface and sends data to the first slave device through the MISO interface; after the first slave device and the second slave device end the SPI communication, the first slave device pulls the REQ interface low.
[0017] In some embodiments, the communication system includes the three-terminal communication structure as described above.
[0018] The three-terminal communication structure and communication system provided in this disclosure can achieve the following technical effects: In this embodiment of the disclosure, by adding an enable signal interface or a signal request interface to the communication structure, direct communication between the first slave device and the second slave device can be realized. Specifically, the first slave device can enable the second slave device through the enable signal interface, at which point the first slave device possesses master device functions relative to the second slave device, allowing it to actively initiate communication with the second slave device. Alternatively, the first slave device can request direct communication with the second slave device from the master device through the signal request interface, thereby achieving direct communication between the first and second slave devices under the control of the master device. Furthermore, direct communication between the first and second slave devices reduces intermediate data transmission links, lowers communication latency, and improves communication efficiency.
[0019] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0020] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein: Figure 1 This is a schematic diagram of a master-slave device group connection structure in related technologies; Figure 2 This is a schematic diagram of a three-terminal communication structure provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram illustrating communication between a master device and a first slave device in a three-terminal communication structure provided in this embodiment of the disclosure; Figure 4 This is a schematic diagram illustrating communication between a master device and a second slave device in a three-terminal communication structure provided in this embodiment of the present disclosure; Figure 5 This is a schematic diagram illustrating communication between a first slave device and a second slave device in a three-terminal communication structure provided in this embodiment of the present disclosure; Figure 6 This is a schematic diagram of another three-terminal communication structure provided in an embodiment of this disclosure; Figure 7 This is a schematic diagram of communication between the master device and the first slave device in another three-terminal communication structure provided in this embodiment of the present disclosure; Figure 8 This is a schematic diagram illustrating communication between a master device and a second slave device in another three-terminal communication structure provided in this embodiment of the present disclosure; Figure 9 This is a schematic diagram of communication between the first slave device and the second slave device in another three-terminal communication structure provided in this embodiment of the present disclosure; Figure 10 This is a timing diagram of the REQ interface and SSN interface of a first slave device provided in an embodiment of this disclosure; Figure 11 This is a timing diagram of the REQ interface and SSN interface of another first slave device provided in an embodiment of this disclosure. Detailed Implementation
[0021] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0022] The terms "first," "second," etc., used in the technical solutions described in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0023] Unless otherwise stated, the term "multiple" means two or more.
[0024] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0025] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0026] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.
[0027] Combination Figures 2 to 9 As shown in the figure, this disclosure provides a three-terminal communication structure, including: a master device, a first slave device, and a second slave device. The master device is capable of SPI communication with both the first and second slave devices. The first slave device is provided with an enable signal interface for enabling the second slave device, thereby enabling SPI communication between the first and second slave devices; alternatively, the first slave device and the master device are provided with a signal request interface, allowing the master device to respond to communication requests sent by the first slave device and control the first and second slave devices to perform SPI communication.
[0028] In this embodiment of the disclosure, by adding an enable signal interface or a signal request interface to the communication structure, direct communication between the first slave device and the second slave device can be realized. Specifically, the first slave device can enable the second slave device through the enable signal interface, at which point the first slave device possesses master device functions relative to the second slave device, allowing it to actively initiate communication with the second slave device. Alternatively, the first slave device can request direct communication with the second slave device from the master device through the signal request interface, thereby achieving direct communication between the first and second slave devices under the control of the master device. Furthermore, direct communication between the first and second slave devices reduces intermediate data transmission links, lowers communication latency, and improves communication efficiency.
[0029] Optionally, combined Figure 2As shown, the first slave device is provided with an enable signal interface for enabling the second slave device, including: the first slave device is provided with an SSN interface, an SCK interface, a MISO interface, a MOSI interface, and an SSNB interface; the second slave device is provided with an SSN interface, an SCK interface, a MISO interface, and a MOSI interface; the master device is provided with an SSNA interface, an SCK interface, a MISO interface, a MOSI interface, and an SSNB interface; wherein, the SSN interface of the first slave device is connected to the SSNA interface of the master device, the SCK interface of the first slave device is connected to both the SCK interface of the second slave device and the SCK interface of the master device, the MISO interface of the first slave device is connected to both the MISO interface of the second slave device and the MISO interface of the master device, the MOSI interface of the first slave device is connected to both the MOSI interface of the second slave device and the MOSI interface of the master device, and the SSNB interface of the first slave device is connected to both the SSN interface of the second slave device and the SSNB interface of the master device.
[0030] In this embodiment, the first slave device directly enables the SSN interface of the second slave device through the SSNB interface, thereby directly controlling the communication status of the second slave device. In this case, the first slave device can communicate with the second slave device independently of the master device. Furthermore, the SCK, MISO, and MOSI interfaces of the first slave device are connected to the corresponding interfaces of the second slave device and the master device, respectively. By achieving signal sharing, the number of signal lines is reduced, simplifying the hardware design.
[0031] Optionally, the SSN and SSNB interfaces of the first slave device, the SSN interface of the second slave device, and the SSNA and SSNB interfaces of the master device are all active low.
[0032] Optionally, combined Figure 3 As shown, SPI communication between the master device and the first slave device is implemented as follows: When the master device detects that the SSNB interface is high, the master device pulls the SSNA interface low and sends SCK and MOSI signals to the first slave device through the SCK and MOSI interfaces; when the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0033] In this embodiment, when the master device needs to communicate with the first slave device, it first needs to detect the signal of the SSNB interface. If the SSNB interface is low, it indicates that the first slave device is currently communicating with the second slave device, and the master device needs to wait for the communication to complete. If the SSNB interface is high, it indicates that the first slave device is in an idle state, and the master device can pull the SSNA interface low to communicate with the first slave device. This ensures the correctness and reliability of communication between the master device and the first slave device, avoids the master device initiating communication with the first slave device at inappropriate times, and thus reduces communication conflicts and errors.
[0034] Optionally, combined Figure 4 As shown, SPI communication between the master device and the second slave device is implemented as follows: When the master device detects that the SSNB interface is high, the master device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0035] In this embodiment, when the master device needs to communicate with the second slave device, it first needs to detect the signal of the SSNB interface. If the SSNB interface is low, it indicates that the first slave device is currently communicating with the second slave device, and the communication needs to be completed. If the SSNB interface is high, it indicates that the second slave device is in an idle state, and the master device can pull the SSNB interface low to communicate with the second slave device. This ensures the correctness and reliability of communication between the master device and the second slave device, avoids the master device initiating communication with the second slave device at inappropriate times, and thus reduces communication conflicts and errors.
[0036] Optionally, combined Figure 5 As shown, SPI communication between the first slave device and the second slave device is implemented in the following manner: When the first slave device detects that the SSNB interface is high, the first slave device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the first slave device through the SCK and MOSI interfaces, and performs bidirectional communication with the first slave device through the MISO interface.
[0037] In this embodiment, when the first slave device needs to communicate with the second slave device, it first needs to detect the signal of the SSNB interface. If the SSNB interface is low, it indicates that the master device is currently communicating with the second slave device, and it needs to wait for the communication to complete. If the SSNB interface is high, it indicates that the second slave device is in an idle state, and the first slave device can pull the SSNB interface low to communicate with the second slave device. This ensures the correctness and reliability of communication between the first and second slave devices, avoids the first slave device initiating communication with the second slave device at inappropriate times, and thus reduces communication conflicts and errors.
[0038] Optionally, combined Figure 6 As shown, the first slave device and the master device are provided with signal request interfaces, including: the first slave device is provided with a REQ interface, an SSN interface, an SCK interface, a MISO interface, and a MOSI interface; the second slave device is provided with an SSN interface, an SCK interface, a MOSI interface, and a MISO interface; the master device is provided with an SSNA interface, an SCK interface, a MOSI interface, a MISO interface, an SSNB interface, and a REQ interface; wherein, the REQ interface of the first slave device is connected to the REQ interface of the master device, the SSN interface of the first slave device is connected to the SSNA interface of the master device, the SCK interface of the first slave device is connected to both the SCK interface of the second slave device and the SCK interface of the master device, the MISO interface of the first slave device is connected to both the MOSI interface of the second slave device and the MOSI interface of the master device, the MOSI interface of the first slave device is connected to both the MISO interface of the second slave device and the MISO interface of the master device, and the SSN interface of the second slave device is connected to the SSNB interface of the master device.
[0039] In this embodiment, the first slave device and the master device are connected via a REQ interface. The first slave device can send communication requests to the master device through the REQ interface. At this time, the master device can respond to the communication requests sent by the first slave device and control the first slave device to conduct SPI communication with the second slave device. In addition, the SCK interface, MISO interface, and MOSI interface of the first slave device are respectively connected to the corresponding interfaces of the second slave device and the master device. By realizing signal sharing, the number of signal lines is reduced and the hardware design is simplified.
[0040] Optionally, combined Figure 7As shown, SPI communication between the master device and the first slave device is implemented as follows: When the first slave device pulls the REQ interface high, and the master device detects that the REQ interface is high and confirms that the first slave device requests communication with the master device, or when the master device actively communicates with the first slave device, the master device pulls the SSNA interface low, switches the MOSI interface to the MISO interface, switches the MISO port to the MOSI interface, and sends SCK and MOSI signals to the first slave device through the SCK and MOSI interfaces; when the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0041] In this embodiment, the first slave device can actively initiate a communication request to the master device by pulling the REQ interface high, and the master device can also actively communicate with the first slave device. Before the master device communicates with the first slave device, it needs to pull the SSNA interface low and switch the MOSI interface to the MISO interface, and the MISO port to the MOSI interface, to realize the communication mode conversion and adapt the communication interface between the master device and the first slave device, thereby realizing communication between the master device and the first slave device.
[0042] Optionally, combined Figure 8 As shown, SPI communication between the master device and the second slave device is implemented as follows: The master device pulls the SSNB interface low and sends SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; when the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and performs bidirectional communication with the master device through the MISO interface.
[0043] In this embodiment, when the master device needs to communicate with the second slave device, communication between the master device and the second slave device can be achieved by pulling the SSNB interface low.
[0044] Optionally, combined Figure 9As shown, SPI communication between the first slave device and the second slave device is implemented as follows: When the first slave device pulls the REQ interface high, and the master device detects that the REQ interface is high and confirms that the first slave device requests communication with the second slave device, the master device pulls the SSNA and SSNB interfaces low, and sends SCK signals to the first and second slave devices respectively through the SCK interface; when the first slave device detects that the SSNA interface is low, it sends data to the second slave device through the MISO interface and receives data sent by the second slave device through the MOSI interface; when the second slave device detects that the SSNB interface is low, it receives data sent by the first slave device through the MOSI interface and sends data to the first slave device through the MISO interface; after the first and second slave devices end SPI communication, the first slave device pulls the REQ interface low.
[0045] In this embodiment, when the first slave device needs to communicate with the second slave device, the first slave device first needs to initiate a communication request to the master device. When the master device confirms that the first slave device needs to communicate with the second slave device, the master device pulls the SSNA interface and SSNB interface low and outputs a clock signal. At this time, both the first slave device and the second slave device are in a receiving state, thereby enabling the first slave device to send data to the second slave device through the MISO interface and receive data sent by the second slave device through the MOSI interface. The second slave device receives data sent by the first slave device through the MOSI interface and sends data to the first slave device through the MISO interface.
[0046] Optionally, the first slave device controls the REQ interface in the following manner to initiate different communication requests to the master device: if the first slave device pulls the REQ interface high and does not pull it low until the communication is completed, then pulls it low, the first slave device initiates a request to communicate with the master device; if the first slave device pulls the REQ interface high, pulls it low after a first preset duration, and then pulls the REQ interface high again after a second preset duration, and pulls it low again until the communication is completed, then the first slave device initiates a request to communicate with the second slave device to the master device.
[0047] In this embodiment, the first slave device can initiate different communication requests to the master device by controlling different REQ interface level signals, thereby realizing communication between the first slave device and the master device or the second slave device. Combined with... Figure 10 As shown, after the first slave device pulls the REQ interface high and does not pull it low within 100μs, it indicates that the first slave device initiated a request to communicate with the master device. At this time, the master device pulls the SSNA interface low, and the first slave device's SSN interface receives a low-level signal and enables, thus starting operation. Combined with... Figure 11As shown, after the first slave device pulls the REQ interface high, it pulls it low after 30μs, and then pulls it high again after 30μs. After the high level lasts for 40μs, the master device confirms that the first slave device initiated a request to communicate with the second slave device. At this time, the master device pulls the SSNA and SSNB interfaces low. After the first slave device receives the low-level signal, its SSN interface is enabled and starts working.
[0048] The three-terminal communication structure provided in this disclosure enables direct communication between a first slave device and a second slave device in two different ways. When the first slave device has an enable signal interface for enabling the second slave device, communication between the two slave devices does not require the participation of the master device; the first slave device switches to master mode when communicating with the second slave device. When both the first slave device and the master device have signal request interfaces, the master device needs to provide a clock signal when the first slave device communicates with the second slave device, but this does not require adding a master mode for the first slave device, thus reducing the size of the first slave device.
[0049] This disclosure provides a communication system including the three-terminal communication structure described above.
[0050] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the technical solutions described herein. As used in the technical solutions described herein, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used herein refers to any and all possible combinations of one or more of the associated listed elements. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0051] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0052] The methods and products disclosed in the embodiments herein (including but not limited to devices and equipment) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0053] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A three-terminal communication structure, characterized in that, include: Master device, first slave device, and second slave device; The master device can communicate with the first slave device and the second slave device via SPI respectively; The first slave device is provided with an enable signal interface for enabling the second slave device, so as to realize SPI communication between the first slave device and the second slave device; or, the first slave device and the master device are provided with a signal request interface, and the master device can respond to the communication request sent by the first slave device and control the first slave device to perform SPI communication with the second slave device.
2. The three-terminal communication structure according to claim 1, characterized in that, The first slave device is provided with an enable signal interface for enabling the second slave device, including: The first slave device is equipped with an SSN interface, an SCK interface, a MISO interface, a MOSI interface, and an SSNB interface; The second slave device is equipped with an SSN interface, an SCK interface, a MISO interface, and a MOSI interface; The main equipment is equipped with SSNA, SCK, MISO, MOSI and SSNB interfaces; Specifically, the SSN interface of the first slave device is connected to the SSNA interface of the master device; the SCK interface of the first slave device is connected to the SCK interfaces of the second slave device and the master device; the MISO interface of the first slave device is connected to the MISO interfaces of the second slave device and the master device; the MOSI interface of the first slave device is connected to the MOSI interfaces of the second slave device and the master device; and the SSNB interface of the first slave device is connected to the SSN interface of the second slave device and the SSNB interface of the master device.
3. The three-terminal communication structure according to claim 2, characterized in that, Implement SPI communication between the master device and the first slave device as follows: When the master device detects that the SSNB interface is high, the master device pulls the SSNA interface low and sends the SCK signal and MOSI signal to the first slave device through the SCK interface and MOSI interface. When the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and conducts bidirectional communication with the master device through the MISO interface.
4. The three-terminal communication structure according to claim 2, characterized in that, Implement SPI communication between the master device and the second slave device as follows: When the master device detects that the SSNB interface is high, the master device pulls the SSNB interface low and sends the SCK signal and MOSI signal to the second slave device through the SCK interface and MOSI interface. When the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and conducts bidirectional communication with the master device through the MISO interface.
5. The three-terminal communication structure according to claim 2, characterized in that, Implement SPI communication between the first slave device and the second slave device as follows: When the first slave device detects that the SSNB interface is high, the first slave device pulls the SSNB interface low and sends the SCK signal and MOSI signal to the second slave device through the SCK interface and MOSI interface; When the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the first slave device through the SCK and MOSI interfaces, and performs bidirectional communication with the first slave device through the MISO interface.
6. The three-terminal communication structure according to claim 1, characterized in that, The first slave device and the master device are equipped with signal request interfaces, including: The first slave device is equipped with REQ interface, SSN interface, SCK interface, MISO interface and MOSI interface; The second slave device is equipped with an SSN interface, an SCK interface, a MOSI interface, and a MISO interface; The main equipment is equipped with SSNA, SCK, MOSI, MISO, SSNB and REQ interfaces; Specifically, the REQ interface of the first slave device is connected to the REQ interface of the master device; the SSN interface of the first slave device is connected to the SSNA interface of the master device; the SCK interface of the first slave device is connected to both the SCK interface of the second slave device and the SCK interface of the master device; the MISO interface of the first slave device is connected to both the MOSI interface of the second slave device and the MOSI interface of the master device; the MOSI interface of the first slave device is connected to both the MISO interface of the second slave device and the MISO interface of the master device; and the SSN interface of the second slave device is connected to the SSNB interface of the master device.
7. The three-terminal communication structure according to claim 6, characterized in that, Implement SPI communication between the master device and the first slave device as follows: When the first slave device pulls the REQ interface high, the master device detects that the REQ interface is high and confirms that the first slave device requests to communicate with the master device, or when the master device actively communicates with the first slave device, the master device pulls the SSNA interface low, switches the MOSI interface to the MISO interface, switches the MISO port to the MOSI interface, and sends the SCK signal and MOSI signal to the first slave device through the SCK interface and the MOSI interface. When the first slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and conducts bidirectional communication with the master device through the MISO interface.
8. The three-terminal communication structure according to claim 6, characterized in that, Implement SPI communication between the master device and the second slave device as follows: The master device pulls the SSNB interface low and sends the SCK and MOSI signals to the second slave device through the SCK and MOSI interfaces; When the second slave device detects that the SSN interface is low, it receives the SCK and MOSI signals sent by the master device through the SCK and MOSI interfaces, and conducts bidirectional communication with the master device through the MISO interface.
9. The three-terminal communication structure according to claim 6, characterized in that, Implement SPI communication between the first slave device and the second slave device as follows: When the master device detects that the REQ interface is high and confirms that the first slave device requests to communicate with the second slave device, the master device pulls the SSNA and SSNB interfaces low and sends SCK signals to the first and second slave devices respectively through the SCK interface. When the first slave device detects that the SSNA interface is low, it sends data to the second slave device through the MISO interface and receives data sent by the second slave device through the MOSI interface. When the second slave device detects that the SSNB interface is low, it receives data sent by the first slave device through the MOSI interface and sends data to the first slave device through the MISO interface. After the first slave device and the second slave device end SPI communication, the first slave device pulls the REQ interface low.
10. A communication system, characterized in that, Includes the three-terminal communication structure as described in any one of claims 1 to 9.