CN114064545B - Method and device for identifying serial port function, main control chip, household electrical appliance and medium - Google Patents

Method and device for identifying serial port function, main control chip, household electrical appliance and medium Download PDF

Info

Publication number
CN114064545B
CN114064545B CN202111272348.2A CN202111272348A CN114064545B CN 114064545 B CN114064545 B CN 114064545B CN 202111272348 A CN202111272348 A CN 202111272348A CN 114064545 B CN114064545 B CN 114064545B
Authority
CN
China
Prior art keywords
serial port
configuration information
function
identification command
information
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.)
Active
Application number
CN202111272348.2A
Other languages
Chinese (zh)
Other versions
CN114064545A (en
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.)
GD Midea Air Conditioning Equipment Co Ltd
Foshan Shunde Midea Electric Science and Technology Co Ltd
Original Assignee
GD Midea Air Conditioning Equipment Co Ltd
Foshan Shunde Midea Electric Science and Technology 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 GD Midea Air Conditioning Equipment Co Ltd, Foshan Shunde Midea Electric Science and Technology Co Ltd filed Critical GD Midea Air Conditioning Equipment Co Ltd
Priority to CN202111272348.2A priority Critical patent/CN114064545B/en
Publication of CN114064545A publication Critical patent/CN114064545A/en
Application granted granted Critical
Publication of CN114064545B publication Critical patent/CN114064545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The embodiment of the application provides a serial port function identification method, a serial port function identification device, a main control chip, household electrical appliances and a computer storage medium. The method comprises the following steps: acquiring attribute information of a multifunctional serial port of the main control chip, wherein the attribute information comprises a plurality of kinds of functional configuration information, and each kind of functional configuration information in the plurality of kinds of functional configuration information is used for representing the functions of the at least two pins; sequentially sending identification commands corresponding to the multiple function configuration information to an external device; under the condition that reply information corresponding to a target identification command is received, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.

Description

Method and device for identifying serial port function, main control chip, household electrical appliance and medium
Technical Field
The present application relates to serial port function identification technologies, and in particular, to a serial port function identification method, a serial port function identification device, a main control chip, a home appliance, and a computer storage medium.
Background
The household electrical appliance is commonly connected with various peripheral devices, and different peripheral devices have different functions and are important components in the household electrical appliance, so that the communication mode between the household electrical appliance and the peripheral devices is very important, wherein a main control chip of the household electrical appliance is generally connected with the peripheral devices through serial ports. In order to connect different peripheral devices, the home appliance needs to reserve a plurality of different serial ports corresponding to different serial port devices, and it can be seen that the requirements on software and hardware resources of a main control chip of the home appliance are higher, so that the cost of the chip is higher. Meanwhile, different peripheral devices correspond to different serial ports, when the peripheral device is used, serial port devices of the peripheral device are required to be connected to the corresponding serial ports, and otherwise, the peripheral device cannot work normally.
In summary, how to realize the main control chip of the home appliance without presetting a plurality of different serial ports, and the serial device of the peripheral device can be directly connected with the serial port for use is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application provides a serial port function identification method, a serial port function identification device, a main control chip, household electrical appliances and a computer storage medium.
The embodiment of the application provides a serial port function identification method, which is applied to a main control chip of household appliances, wherein the main control chip is provided with a multifunctional serial port; the multifunctional serial port is provided with at least two pins; the method comprises the following steps:
acquiring attribute information of a multifunctional serial port of the main control chip, wherein the attribute information comprises a plurality of kinds of functional configuration information, and each kind of functional configuration information in the plurality of kinds of functional configuration information is used for representing the functions of the at least two pins;
sequentially sending identification commands corresponding to the multiple function configuration information to an external device;
under the condition that reply information corresponding to a target identification command is received, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
In the above scheme, the attribute information includes at least one serial port type of the multi-functional serial port configuration and at least two kinds of functional configuration information corresponding to each serial port type.
In the above scheme, the plurality of functional configuration information includes 1 st functional configuration information to n functional configuration information, where n is an integer greater than 1; the sending, in order, an identification command corresponding to the plurality of functional configuration information to the external device includes:
after an ith identification command is sent to the peripheral equipment, sending an (i+1) th identification command to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
In the above solution, the determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command includes:
and obtaining the serial port type of the current configuration of the multifunctional serial port and the function information of at least two pins under the serial port type of the current configuration according to the function configuration information corresponding to the target identification command.
In the above scheme, the serial port type of the multifunctional serial port includes: a universal asynchronous receiver/Transmitter (Universal Asynchronous Receiver/Transmitter, UART), a serial peripheral interface (Serial Peripheral Interface, SPI), and an integrated circuit bus (Inter-Integrated Circuit, IIC).
The embodiment of the application also provides a serial port function identification device, which is applied to a main control chip of the household appliance, wherein the main control chip is provided with a multifunctional serial port; the multifunctional serial port is provided with at least two pins; the device comprises at least:
the device comprises an acquisition module and a control module, wherein the acquisition module is used for acquiring attribute information of a multifunctional serial port of the main control chip, the attribute information comprises a plurality of kinds of function configuration information, and each kind of function configuration information in the plurality of kinds of function configuration information is used for representing functions of at least two pins;
the sending module is used for sequentially sending identification commands corresponding to the multiple function configuration information to the external equipment;
the determining module is used for determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command under the condition that the reply information corresponding to the target identification command is received; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
In one implementation, the attribute information includes at least one serial port type of the multi-functional serial port configuration and at least two kinds of functional configuration information corresponding to each serial port type.
In one implementation, the plurality of functional configuration information includes 1 st functional configuration information to n functional configuration information, n being an integer greater than 1; the sending module is used for sequentially sending identification commands corresponding to the plurality of functional configuration information to the external equipment; wherein,,
after the ith identification command is sent to the peripheral equipment, the (i+1) th identification command is sent to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
In one implementation manner, the determining module is configured to determine, according to function configuration information corresponding to the target identification command, function information of the at least two pins; wherein,,
and the function configuration information is used for obtaining the serial port type of the current configuration of the multifunctional serial port and the function information of at least two pins under the serial port type of the current configuration according to the function configuration information corresponding to the target identification command.
In one implementation, the serial port type of the multifunctional serial port includes: UART, SPI, IIC.
The embodiment of the application also provides a main control chip, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any serial port function identification method when executing the program.
The embodiment of the application also provides the household appliance, which comprises the main control chip.
The embodiment of the application also provides a computer storage medium, on which a computer program is stored, which when being executed by a processor, implements any one of the serial port function identification methods.
According to the serial port function identification method, the serial port function identification device, the main control chip, the household electrical appliance and the computer storage medium, attribute information of a multifunctional serial port of the main control chip is obtained, the attribute information comprises multiple kinds of function configuration information, and each kind of function configuration information in the multiple kinds of function configuration information is used for representing functions of at least two pins; sequentially sending identification commands corresponding to the multiple function configuration information to an external device; under the condition that reply information corresponding to a target identification command is received, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information. It can be seen that, according to the embodiment of the application, based on the attribute information of the multifunctional serial port, identification commands corresponding to various functional configuration information are sequentially sent to the equipment, and when the identification is successful, reply information is received to obtain the functional configuration information corresponding to the target identification command, so that the functional information of at least two pins of the multifunctional serial port is determined.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is an application scenario diagram of a serial port function identification method provided by an embodiment of the present application;
fig. 2 is a flow chart of a serial port function identification method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a multifunctional serial port according to an embodiment of the present application;
fig. 4 is a schematic diagram of a serial port function identification method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a specific implementation of a serial port function identification method according to an embodiment of the present application;
fig. 6 is a schematic diagram of a serial port function identification device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a main control chip according to an embodiment of the present application.
Detailed Description
In the related art, a plurality of peripheral devices are connected to a home appliance for implementing various functions. The home appliance is generally connected with the peripheral equipment through a serial port communication mode, but different peripheral equipment has different serial port types, so that a plurality of different serial ports are required to be preset on a main control chip of the home appliance so as to meet the requirement of connecting different peripheral equipment, the cost of the main control chip of the home appliance is increased, and software and hardware resources of the chip are further increased. Meanwhile, in the use process, each peripheral equipment needs to be connected with a corresponding serial port, otherwise, the peripheral equipment cannot be used normally, and the use operation is complicated. Under the condition, how to realize the main control chip of the household appliance without presetting a plurality of different serial ports, and the serial port device of the peripheral equipment can be directly used by being connected with the serial port is a technical problem to be solved.
Aiming at the technical problems, the technical scheme of the embodiment of the disclosure is provided. Embodiments of the present application will be described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the examples provided herein are for the purpose of illustration only and are not intended to limit the application. In addition, the embodiments provided below are some of the embodiments for carrying out the present application, but not all of the embodiments for carrying out the present application, and the technical solutions described in the embodiments of the present application may be implemented in any combination without conflict.
It should be noted that, in the embodiments of the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a method or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such method or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other related elements in a method or apparatus comprising the element (e.g., a step in a method or an element in an apparatus, e.g., an element may be part of a circuit, part of a processor, part of a program or software, etc.).
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
For example, the serial port function identification method provided in the embodiment of the present application includes a series of steps, but the serial port function identification method provided in the embodiment of the present application is not limited to the described steps, and similarly, the serial port function identification device provided in the embodiment of the present application includes a series of modules, but the serial port function identification device provided in the embodiment of the present application is not limited to the modules explicitly described, and may also include modules that are required to be set when acquiring related information or performing processing based on the information.
The technical scheme for serial port function identification is provided in the embodiment of the application, and can be applied to identification of serial port functions in a scene of connecting household appliances and peripheral equipment.
Fig. 1 shows an application scenario diagram of a serial port function identification method provided by the embodiment of the present application, referring to fig. 1, a main control chip of a home appliance is provided with three serial ports with different functions, namely CN1, CN2 and CN3, where CN1 is used for connecting peripheral equipment 1, CN2 is used for peripheral equipment 2, CN3 is used for peripheral equipment 3, that is, only each peripheral equipment is connected with a corresponding serial port, and the peripheral equipment can work normally.
Based on the application scenario shown in fig. 1, the technical scheme of the embodiment of the application is provided.
Fig. 2 is a schematic flow chart of a serial port function identification method according to an embodiment of the present application, as shown in fig. 2, the flow may include:
step a201: the method comprises the steps of obtaining attribute information of a multifunctional serial port of the main control chip, wherein the attribute information comprises multiple kinds of function configuration information, and each kind of function configuration information in the multiple kinds of function configuration information is used for representing functions of at least two pins.
In the embodiment of the application, the serial port is an expansion interface adopting a serial communication mode, which can be also called as a serial interface, and the serial communication mode can convert the received parallel data characters from the processor into continuous serial data to be sent out, and can convert the received serial data into parallel data characters to be sent to the processor.
In the embodiment of the application, the multifunctional serial port is configured by software and/or program and can be switched to serial ports with different functions. The multifunctional serial port is provided with at least two pins, the at least two pins are connected with an Input/Output interface (I/O interface) of the main control chip, and the attribute information of the multifunctional serial port can be determined by configuring the functional information of the at least two pins.
In the embodiment of the application, the attribute information of the multifunctional serial port comprises at least one serial port type of the multifunctional serial port configuration and at least two kinds of functional configuration information corresponding to each serial port type. It should be noted that, one serial port type corresponds to a serial port function, that is, different peripheral devices need to be connected with the main control chip through serial ports of the corresponding serial port type. Meanwhile, under each serial port type, different function configuration information of at least two pins corresponds to different functions.
Illustratively, as shown in FIG. 3, one multifunctional serial port CN1 has 4 pins, with pin 1 for grounding, pin 2 for connecting with the I/O1 port, pin 3 for connecting with the I/O2 port, and pin 4 for connecting with the I/O3 port. The main control chip can configure the multifunctional serial port CN1 into an SPI serial port type, and meanwhile, the functional information of the pin 2, the pin 3 and the pin 4 can be configured into the following by software or a program: pin 2 may be used to input data, pin 3 may be used to output data, and pin 4 may be used to generate a clock signal.
In the embodiment of the application, the multifunctional serial port of the main control chip can be connected with different peripheral devices, as shown in fig. 4, the main control chip is provided with a multifunctional serial port, and the main control chip can be connected with the peripheral device 1, the peripheral device 2 and the peripheral device 3 through the multifunctional serial port, wherein the peripheral device 1, the peripheral device 2 and the peripheral device 3 are respectively provided with serial ports with different serial port types,
in the embodiment of the application, the main control chip is connected with the peripheral equipment through the multifunctional serial port, and when the main control chip is connected, the multifunctional serial port is initialized, namely, the functional information of at least two pins of the multifunctional serial port is configured, so that various functional configuration information is obtained, and the attribute information of the multifunctional serial port of the main control chip can be obtained.
Step A202: and sequentially sending identification commands corresponding to the plurality of functional configuration information to the external equipment.
In the embodiment of the application, after the main control chip initializes the multifunctional interface, the identification command corresponding to the multiple functional configuration information is sequentially sent to the peripheral equipment.
In the embodiment of the application, the identification command is used for the main control chip to identify the attribute information of the interface of the peripheral equipment, and it can be understood that one identification command corresponds to one function configuration information. And under the condition that the main control chip can receive the reply information from the peripheral equipment, indicating that the identification is successful, and under the condition that the main control chip does not receive the reply information from the peripheral equipment within a preset time, indicating that the identification is failed, and sending the next identification command to the peripheral equipment by the main control chip.
Step A203: under the condition that reply information corresponding to a target identification command is received, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
In the embodiment of the application, when the functional configuration information of the multifunctional serial port is the same as the attribute information of the peripheral equipment, the main control chip can communicate with the peripheral equipment through the multifunctional serial port, so that the peripheral equipment can receive the identification command from the main control chip, and the peripheral equipment sends reply information to the main control chip.
In the embodiment of the application, the target identification command is an identification command under the condition of successful identification, and the function configuration information corresponding to the target identification command can be used for configuring the attribute information of the multifunctional serial port. It can be understood that, according to the function configuration information corresponding to the target identification command, the serial port type of the multifunctional serial port and the function information of at least two pins under the serial port type can be determined.
In practical applications, steps a201 to a203 are implemented by a processor based on a main control chip, where the processor may be at least one of an ASIC (Application Specific Integrated Circuit, ASIC), a DSP (Digital Signal Processor, DSP), a DSP (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a CPU (Central Processing Unit, CPU), a controller, a microcontroller, and a microprocessor.
It can be seen that, in the embodiment of the present application, based on the attribute information of the multifunctional serial port of the main control chip, the identification command corresponding to the multiple functional configuration information is sequentially sent to the peripheral device, and the target identification command is determined under the condition that the reply information is received, so that the serial port type of the multifunctional serial port and the functional information of at least two pins under the serial port type can be effectively determined according to the functional configuration information corresponding to the target identification command. It can be seen that only one multi-functional serial port is preset in the embodiment of the application, and the functional configuration information of the multi-functional serial port is configured by identifying the attribute information of the peripheral equipment, so that the multi-functional serial port can be configured as a serial port corresponding to the peripheral equipment, and the peripheral equipment can be directly used after being connected with the multi-functional serial port.
In some embodiments, the plurality of functional configuration information includes 1 st functional configuration information through n functional configuration information, n being an integer greater than 1; the sending, in order, an identification command corresponding to the plurality of functional configuration information to the external device includes:
after an ith identification command is sent to the peripheral equipment, sending an (i+1) th identification command to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
In the embodiment of the application, the multifunctional serial port has m serial port types, m is an integer greater than 1 and less than or equal to m, and at least two pins under each serial port type have at least one functional information. Thus, the n kinds of functional configuration information include at least one kind of functional information of at least two pins of each serial port type of the m kinds of serial port types.
The multi-functional serial port has two pins, and the serial port has 3 serial port types, namely a first serial port, a second serial port and a third serial port; two pins under the first serial port have 2 kinds of functional information, two pins under the second serial port have 1 kind of functional information, two pins under the third serial port have 2 kinds of functional information, then the multi-functional serial port has 5 kinds of functional configuration information.
In the embodiment of the present application, the plurality of kinds of function configuration information includes 1 st kind of function configuration information to nth kind of function configuration information, wherein the ith identification command corresponds to the identification command of the ith function configuration information, that is, the identification command includes 1 st kind of identification command to nth kind of identification command.
In the embodiment of the application, the main control chip sends the ith identification command to the peripheral equipment, and the peripheral equipment sends reply information corresponding to the ith identification command to the main control chip under the condition that the peripheral equipment can receive the ith identification command; in the case where the peripheral device is unable to receive the i-th identification command, the i+1-th identification command is transmitted to the peripheral device.
In the embodiment of the present application, the i+1-th identification command is an identification command corresponding to the i+1-th function configuration information, and it should be noted that the i+1-th function configuration information may be other function information of at least two pins under a serial port type in the i-th function configuration information, or may be function information of at least two pins under another serial port type except for the serial port type in the i-th function configuration information.
For example, one multi-functional serial port has two pins, the serial port has 3 serial port types, wherein the two pins under the first serial port have 2 kinds of functional information, the two pins under the second serial port have 1 kind of functional information, and the two pins under the third serial port have 2 kinds of functional information, i.e., the multi-functional serial port has 5 kinds of functional configuration information.
The 1 st function configuration information is first function information under the first serial port, and the attribute information of the peripheral equipment is second function information under the third serial port. And sending a 1 st identification command corresponding to the 1 st function configuration information to the peripheral equipment, wherein the peripheral equipment cannot receive the 1 st identification command, and sending a2 nd identification command to the peripheral equipment, wherein the 2 nd identification command can be second type function information under the first serial port or first type function information under the second serial port.
In some embodiments, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command includes:
and obtaining the serial port type of the current configuration of the multifunctional serial port and the function information of at least two pins under the serial port type of the current configuration according to the function configuration information corresponding to the target identification command.
In the embodiment of the application, the serial port type in the function configuration information corresponding to the target identification command and the function information of at least two pins under the serial port type are configured as the attribute information of the multifunctional serial port, so that the communication between the main control chip and the peripheral equipment can be realized.
In some embodiments, the serial port type of the multi-function serial port includes: UART, SPI, and IIC.
In the embodiment of the application, the UART is a universal serial data bus, is used for asynchronous communication and can realize bidirectional communication. The data transmitter is provided with two pins, wherein pin 1 is TXD (Transmit Date) and is used for transmitting data; pin 2 bit RXD (Receive Date) for receiving data.
In the embodiment of the application, the SPI is a full duplex synchronous communication bus. Three pins are provided, pin 1 is SI (Slave Input), and is used for inputting data; pin 2 is SO (Slave Output) for inputting data; pin 3 is SCLK (Serial Clock) for generating a clock signal.
In the embodiment of the application, the IIC is a serial communication bus, and bidirectional and serial communication can be realized. With two pins, pin 1 is DATE for input/output data and pin 2 is CLK (Clock) for generating a Clock signal.
In the embodiment of the present application, the serial port type of the multifunctional serial port may also include other types, which is not limited to the present application.
In one example, a process of identifying attribute information of a serial port of a peripheral device by a multifunctional serial port of a main control chip is specifically described.
Referring to fig. 5, a main control chip of the home appliance has a multifunctional serial port with 5 pins, wherein pin 1 is connected with a power supply, pin 2 is grounded, and pins 3 to 5 are connected with 3I/O ports of the main control chip. The multifunctional serial port is used for connecting the main control chip and a plurality of different peripheral devices, wherein the peripheral devices comprise: total volatile organic compound (Total Volatile Organic Compounds, TVOC) sensor, formaldehyde sensor, carbon dioxide sensor, wherein, TVOC sensor adopts UART serial ports to be connected with main control chip, and formaldehyde sensor adopts IIC serial ports to be connected with main control chip, and carbon dioxide sensor adopts SPI serial ports to be connected with main control chip.
Further, the total of 6 kinds of functional information of the pins under UART serial port type is shown in table 1.
TABLE 1
The functional information of the pins under the IIC serial port type is 6 kinds in total, as shown in table 2.
TABLE 2
The function information of the pins under the SPI serial type is 6 kinds in total, as shown in table 3.
TABLE 3 Table 3
For example, the peripheral device is a carbon dioxide sensor, that is, the peripheral device needs to be connected to the carbon dioxide sensor through an SPI-type serial port to realize communication, and meanwhile, functional information of a pin of the carbon dioxide sensor is set as first pin functional information.
After the carbon dioxide sensor is connected with the multifunctional serial port of the main control chip, the main control chip starts initializing the multifunctional serial port, namely determining attribute information of the multifunctional serial port according to the function information of the UART serial port type, the IIC serial port type and the SPI serial port type pins in tables 1 to 3, so that 18 kinds of function configuration information can be determined. Accordingly, 18 recognition commands may be determined.
The 1 st function configuration information is first pin function information under UART serial port type, the 1 st identification command is identification command corresponding to the 1 st function configuration information, the 1 st identification command is sent to the carbon dioxide sensor, and the carbon dioxide sensor cannot receive the 1 st identification command and does not reply information to the main control chip because the carbon dioxide sensor is the first pin function information under SPI serial port type, and the 2 nd identification command is sent to the carbon dioxide sensor.
The 2 nd function configuration information is the second pin function information under the UART serial port type, the 2 nd identification command is the identification command corresponding to the 2 nd function configuration information, and the carbon dioxide sensor cannot receive the 2 nd identification command and does not reply information to the main control chip.
And by analogy, sending identification commands corresponding to the third pin function information, the fourth pin function information, the fifth pin function information and the sixth pin function information under the UART serial port type to the carbon dioxide sensor, namely a 3 rd identification command, a 4 th identification command, a 5 th identification command and a 6 th identification command. Because the carbon dioxide sensor is of an SPI serial port type, the carbon dioxide sensor cannot receive the identification command, and does not reply information to the main control chip, and the 7 th identification command is sent to the carbon dioxide sensor.
The 7 th function configuration information is the first pin function information under the IIC serial port type, the 7 th identification command is the identification command corresponding to the 7 th function configuration information, and the carbon dioxide sensor cannot receive the 7 th identification command and does not reply information to the main control chip.
Similarly, identification commands corresponding to the second pin function information, the third pin function information, the fourth pin function information, the fifth pin function information and the sixth pin function information under the IIC serial port type, namely an 8 th identification command, a 9 th identification command, a 10 th identification command, an 11 th identification command and a 12 th identification command, are sent to the carbon dioxide sensor. Because the carbon dioxide sensor is of an SPI serial port type, the carbon dioxide sensor cannot receive the identification command, and does not reply information to the main control chip, and the 13 th identification command is sent to the carbon dioxide sensor.
The 13 th function configuration information is first pin function information under the SPI serial port type, the 13 th identification command is an identification command corresponding to the 13 th function configuration information, and since the peripheral equipment is of the SPI serial port type and the pin function information is the first pin function information, the carbon dioxide sensor can receive the 13 th identification command, namely the 13 th identification command is a target identification command.
And the carbon dioxide sensor sends reply information corresponding to the target identification command to the main control chip. The main control chip configures the serial port type of the multifunctional serial port to be an SPI serial port according to the function configuration information corresponding to the target command, namely, the 13 th function configuration information, and configures the function information of a pin below the SPI serial port to be the function information of the first pin, so that the main control chip and the carbon dioxide sensor can realize communication.
Based on the same technical concept as the foregoing embodiments, referring to fig. 6, the serial port function identification device provided by the embodiment of the present application is applied to a main control chip of a home appliance, where the main control chip has a multifunctional serial port; the multifunctional serial port is provided with at least two pins; the device comprises at least:
the acquiring module 601 is configured to acquire attribute information of a multifunctional serial port of the main control chip, where the attribute information includes multiple kinds of function configuration information, and each kind of function configuration information in the multiple kinds of function configuration information is used to characterize functions of the at least two pins;
the sending module 602 is configured to send, to an external device, an identification command corresponding to the multiple function configuration information in sequence;
the determining module 603 is configured to determine, when receiving reply information corresponding to a target identification command, function information of the at least two pins according to function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
In one implementation, the attribute information includes at least one serial port type of the multi-functional serial port configuration and at least two kinds of functional configuration information corresponding to each serial port type.
In one implementation, the plurality of functional configuration information includes 1 st functional configuration information to n functional configuration information, n being an integer greater than 1; the sending module 602 is configured to send, to an external device, an identification command corresponding to the multiple functional configuration information in sequence, where the sending module includes:
after the ith identification command is sent to the peripheral equipment, the (i+1) th identification command is sent to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
In one implementation manner, the determining module 603 is configured to determine, according to the function configuration information corresponding to the target identification command, the function information of the at least two pins, including:
and the function configuration information is used for obtaining the serial port type of the current configuration of the multifunctional serial port and the function information of at least two pins under the serial port type of the current configuration according to the function configuration information corresponding to the target identification command.
In one implementation, the serial port type of the multifunctional serial port includes: UART, SPI, and IIC.
In practical applications, the acquiring module 601, the sending module 602, and the determining module 603 may all be implemented by a processor of a main control chip, where the processor may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, a controller, a microcontroller, and a microprocessor, which is not limited in this embodiment of the present application.
It should be noted that the description of the above device embodiments is similar to the description of the method embodiments described above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, please refer to the description of the embodiments of the method of the present application.
It should be noted that, in the embodiment of the present application, if the method is implemented in the form of a software functional module, and sold or used as a separate product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a terminal, a server, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
Correspondingly, the embodiment of the application further provides a household appliance, wherein the household appliance comprises the main control chip, and the main control chip can be used for realizing any serial port function identification method provided by the embodiment of the application.
Accordingly, an embodiment of the present application further provides a computer storage medium, where computer executable instructions are stored on the computer storage medium, where the computer executable instructions are configured to implement any one of the serial port function identification methods provided in the foregoing embodiments.
In some embodiments, the functions or modules included in the apparatus provided by the embodiments of the present application may be used to perform the methods described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
Based on the same technical concept as the foregoing embodiment, referring to fig. 7, a main control chip 700 provided in an embodiment of the present application may include: a memory 710 and a processor 720; wherein,,
a memory 710 for storing computer programs and data;
a processor 720 for executing a computer program stored in the memory to implement any one of the serial port function identification methods of the foregoing embodiments.
The foregoing description of the various embodiments is intended to emphasize the differences between the various embodiments, and the same or similar parts thereof may be referred to each other for brevity and will not be repeated herein.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the embodiments of the products provided by the application can be combined arbitrarily under the condition of no conflict to obtain new embodiments of the products.
The features disclosed in the embodiments of the method or the device provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new embodiment of the method or the device.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are merely illustrative, and exemplary, the division of units is merely a logical function division, and there may be other manners of division in actual implementation, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to a device or unit, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of grid units; the object of the present embodiment can be achieved according to the fact that some or all of the units thereof can be selected.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing module, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps of implementing the above method embodiments may be implemented by hardware associated with program instructions, and the above program may be stored in a computer readable storage medium, which when executed, performs steps including the above method embodiments.
The above description is not intended to limit the scope of the application, but is intended to cover any modifications, equivalents, and improvements within the spirit and principles of the application.

Claims (11)

1. The serial port function identification method is characterized by being applied to a main control chip of household appliances, wherein the main control chip is provided with a multifunctional serial port; the multifunctional serial port is provided with at least two pins; the method comprises the following steps:
acquiring attribute information of a multifunctional serial port of the main control chip, wherein the attribute information comprises a plurality of kinds of functional configuration information, and each kind of functional configuration information in the plurality of kinds of functional configuration information is used for representing the functions of the at least two pins;
sequentially sending identification commands corresponding to the multiple function configuration information to an external device;
under the condition that reply information corresponding to a target identification command is received, determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
2. The method of claim 1, wherein the attribute information includes at least one serial port type of the multi-function serial port configuration and at least two function configuration information corresponding to each serial port type.
3. The method according to claim 1 or 2, wherein the plurality of function configuration information includes 1 st to nth function configuration information, n being an integer greater than 1; the sending, in order, an identification command corresponding to the plurality of functional configuration information to the external device includes:
after an ith identification command is sent to the peripheral equipment, sending an (i+1) th identification command to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
4. The method according to claim 1 or 2, wherein the determining the function information of the at least two pins according to the function configuration information corresponding to the target recognition command includes:
and obtaining the serial port type of the current configuration of the multifunctional serial port and the function information of at least two pins under the serial port type of the current configuration according to the function configuration information corresponding to the target identification command.
5. The method of claim 2, wherein the serial port type of the multi-function serial port comprises: a universal asynchronous receiver/transmitter UART, a serial peripheral interface SPI, and an integrated circuit bus IIC.
6. The serial port function identification device is characterized in that the device is applied to a main control chip of household appliances, and the main control chip is provided with a multifunctional serial port; the multifunctional serial port is provided with at least two pins; the device comprises at least:
the device comprises an acquisition module and a control module, wherein the acquisition module is used for acquiring attribute information of a multifunctional serial port of the main control chip, the attribute information comprises a plurality of kinds of function configuration information, and each kind of function configuration information in the plurality of kinds of function configuration information is used for representing functions of at least two pins;
the sending module is used for sequentially sending identification commands corresponding to the multiple function configuration information to the external equipment;
the determining module is used for determining the function information of the at least two pins according to the function configuration information corresponding to the target identification command under the condition that the reply information corresponding to the target identification command is received; the target identification command is one of identification commands corresponding to the plurality of functional configuration information.
7. The apparatus of claim 6, wherein the attribute information comprises at least one serial port type of the multi-function serial port configuration and at least two function configuration information corresponding to each serial port type.
8. The apparatus according to claim 6 or 7, wherein the plurality of function configuration information includes 1 st to nth function configuration information, n being an integer greater than 1; the sending module is used for sequentially sending identification commands corresponding to the plurality of functional configuration information to the external equipment; wherein,,
after the ith identification command is sent to the peripheral equipment, the (i+1) th identification command is sent to the peripheral equipment under the condition that reply information corresponding to the ith identification command is not received; i is 1 to n, and the ith identification command represents an identification command corresponding to the ith function configuration information.
9. A main control chip, characterized in that the main control chip comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the serial port function identification method according to any one of claims 1-5 when executing the program.
10. An electrical home appliance comprising the main control chip of claim 9.
11. A computer storage medium storing a computer program; characterized in that the computer program, when executed, is capable of implementing the serial port function identification method of any one of claims 1-5.
CN202111272348.2A 2021-10-29 2021-10-29 Method and device for identifying serial port function, main control chip, household electrical appliance and medium Active CN114064545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111272348.2A CN114064545B (en) 2021-10-29 2021-10-29 Method and device for identifying serial port function, main control chip, household electrical appliance and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111272348.2A CN114064545B (en) 2021-10-29 2021-10-29 Method and device for identifying serial port function, main control chip, household electrical appliance and medium

Publications (2)

Publication Number Publication Date
CN114064545A CN114064545A (en) 2022-02-18
CN114064545B true CN114064545B (en) 2023-11-03

Family

ID=80236086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111272348.2A Active CN114064545B (en) 2021-10-29 2021-10-29 Method and device for identifying serial port function, main control chip, household electrical appliance and medium

Country Status (1)

Country Link
CN (1) CN114064545B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114942899B (en) * 2022-03-30 2024-01-05 深圳市广和通无线股份有限公司 Pin configuration method, module, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55103623A (en) * 1979-01-31 1980-08-08 Honeywell Inf Systems Data processing system having means to solve priority order of centralized buses
CN101989244A (en) * 2009-08-05 2011-03-23 华为技术有限公司 Signal conversion device and method as well as communication equipment
CN204087151U (en) * 2014-08-11 2015-01-07 鸿合科技有限公司 A kind of external assembly being exclusively used in touch display unit
CN106095704A (en) * 2016-08-05 2016-11-09 江苏星宇芯联电子科技有限公司 A kind of Multifunctional adapting box supporting USB OTG pattern
CN111538260A (en) * 2020-04-01 2020-08-14 深圳市汇顶科技股份有限公司 Pin configuration method and device and multi-pin interconnection system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9208008B2 (en) * 2013-07-24 2015-12-08 Qualcomm Incorporated Method and apparatus for multi-chip reduced pin cross triggering to enhance debug experience

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55103623A (en) * 1979-01-31 1980-08-08 Honeywell Inf Systems Data processing system having means to solve priority order of centralized buses
CN101989244A (en) * 2009-08-05 2011-03-23 华为技术有限公司 Signal conversion device and method as well as communication equipment
CN204087151U (en) * 2014-08-11 2015-01-07 鸿合科技有限公司 A kind of external assembly being exclusively used in touch display unit
CN106095704A (en) * 2016-08-05 2016-11-09 江苏星宇芯联电子科技有限公司 A kind of Multifunctional adapting box supporting USB OTG pattern
CN111538260A (en) * 2020-04-01 2020-08-14 深圳市汇顶科技股份有限公司 Pin configuration method and device and multi-pin interconnection system

Also Published As

Publication number Publication date
CN114064545A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
RU2682911C2 (en) Reversible connector for accessory devices
US8762587B2 (en) Data acquisition card, expansion control system for data acquisition card and method thereof
EP3697028B1 (en) Method and device for signal conversion, home bus system (hbs) circuit, and user equipment
CN109558371B (en) Method for communicating with a microcontroller, and computing system
US7872979B1 (en) System and method to access and address high-speed interface converter devices
US10776306B2 (en) Serial port communication mode conversion method, system, and circuit
CN108664429B (en) Master-slave configuration communication protocol, method for improving compatibility and electronic equipment
CN114064545B (en) Method and device for identifying serial port function, main control chip, household electrical appliance and medium
CN107943260A (en) Semiconductor equipment, the method and semiconductor system for controlling semiconductor equipment
KR100770856B1 (en) Device and method for performing multi- functions using unique port in wireless terminal
US20180097315A1 (en) Power adapter, terminal device, charging system, and charging method
US8295368B1 (en) Method and apparatus for improved interfacing of connections between a multiplicity of handheld devices
CN109164874B (en) Information processing method and electronic equipment
CN108055212B (en) Method and device compatible with PSE chip
CN110740085A (en) communication method, communication device and terminal based on parallel operation system
CN107155359A (en) Method, user equipment and the external equipment of multiplexing peripheral interface
CN115663549A (en) Multi-interface conversion device and vehicle
US20090185559A1 (en) Integration module for universal serial bus
CN116401199B (en) Signal conversion circuit, transmission method, device, electronic apparatus, and storage medium
US10602634B2 (en) Card module with multiple connector interfaces
CN111934859A (en) Cipher card communication method, cipher card and computer equipment
US20050097237A1 (en) Line-conducted interface arrangement and a method for operating a line-conducted interface arrangement between a host and a device
CN101303652B (en) Configuration setting method, electronic system, computer as well as general-purpose serial bus equipment
CN214954958U (en) Electronic device sharing universal sequence bus signal
US11513978B2 (en) Dual data ports with shared detection line

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
GR01 Patent grant
GR01 Patent grant