State detection method and state detection circuit of Type-C equipment
By utilizing the state transition of a multi-channel current source module and a comparator in the state detection method for Type-C devices, the power consumption of Type-C devices after a cable is connected is reduced, thus solving the high power consumption problem caused by cable type identification.
Patent Information
- Application Number
- CN202411115850.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2026-03-03
AI Technical Summary
Type-C devices experience increased power consumption after connecting cables because the type cannot be distinguished, especially when cables such as EMaker are connected. In such cases, the device enters a high-power phase, increasing standby power consumption.
In the state detection method of Type-C devices, the first and second connection channels are respectively connected to the first and second current source modules. The output of the comparator is used to jump to different detection states. By combining the current source modules in low-power and high-power modes, coarse and accurate connection detection is performed to avoid unnecessary high-power states.
It effectively reduces the power consumption caused by the connection of Type-C devices to the cable. By performing preliminary testing in low-power mode, it only switches to high-power mode when necessary, reducing unnecessary high-power phases and lowering the overall power consumption.
Smart Images

Figure CN121597499A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Type-C interface technology, and in particular relates to a status detection method and status detection circuit for a Type-C device. Background Technology
[0002] Due to its slim design and the fact that it doesn't require distinguishing between insertion directions, the Type-C interface is widely used in electronic devices such as mobile phones, digital cameras, and tablets. Type-C device connection detection technology is used to determine whether two Type-C interface devices have established a connection. Once a stable connection is established, functions such as PD protocol communication and USB data transfer can be achieved.
[0003] Type-C device connection detection determines whether a device is connected and its type by checking if the voltages of the CC1 and CC2 connection channels on the Type-C interface are within a certain range. Maintaining a high-precision current source allows for accurate detection of connection status and type, but it results in higher standby power consumption. To reduce power consumption, some devices divide connection detection into two stages: one stage uses a low-precision, low-power current source for a preliminary assessment of device connectivity, while the other stage uses a high-precision, high-power current source for a more precise determination of the connected device type.
[0004] In daily use, it is common to encounter situations where a Type-C device is connected to a cable but not to other devices. Such devices cannot distinguish their type in the low-power phase. When cables such as EMaker (Electronically Marked Cable) are connected, the device will exit the low-power phase and enter the high-power phase, increasing the device's power consumption. Summary of the Invention
[0005] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a status detection method and status detection circuit for Type-C devices, which can reduce the power consumption caused by connecting Type-C devices to cables.
[0006] In a first aspect, this application provides a state detection method for a Type-C device. The Type-C device has a first connection channel and a second connection channel. A first current source module is connected to the first connection channel, and a second current source module is connected to the second connection channel. A first input terminal of a comparator is selectively connected to a first reference voltage terminal and a second reference voltage terminal with higher power consumption than the first reference voltage terminal. The second input terminal of the comparator is selectively connected to either the first connection channel or the second connection channel. The method includes:
[0007] If, based on the output of the comparator, a target cable is determined to be connected to one of the first connection channel and the second connection channel, the system jumps to the first target detection state corresponding to the connection channel connected to the target cable. In the first target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel.
[0008] If the duration of the first target detection state exceeds the first duration threshold, the system switches to the second target detection state corresponding to the connection channel connected to the target cable. In the second target detection state, the current source module corresponding to the connection channel connected to the target cable stops operating, and the current source module corresponding to the connection channel not connected to the target cable operates in a low-power mode. The first input terminal is connected to the first reference voltage terminal, and the second input terminal is connected to the connection channel not connected to the target cable.
[0009] According to the Type-C device status detection method of this application, when the Type-C device is detected to be connected to the target cable, it jumps to the first target detection state, and after the first target detection state lasts for a certain period of time, it jumps to the second target detection state. This avoids the Type-C device from entering the high-power precision detection state when it is only connected to the target cable, and avoids the formation of a discharge circuit after the Type-C device is connected to the target cable, which increases the power consumption. This can effectively reduce the power consumption caused by the Type-C device being connected to the cable.
[0010] According to one embodiment of this application, after the jump to the second target detection state corresponding to the connection channel connecting the target cable, the method further includes:
[0011] If the duration of the second target detection state exceeds the second duration threshold, the system switches to the first target detection state corresponding to the connection channel connecting the target cable.
[0012] According to one embodiment of this application, the method further includes:
[0013] If, based on the output of the comparator, it is determined that the Type-C device is not connected or the target cable is unplugged, the system jumps to the third target detection state. In the third target detection state, the first current source module and the second current source module operate in a low-power mode, the first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel.
[0014] According to one embodiment of this application, the method further includes:
[0015] If, based on the output of the comparator, it is determined that the Type-C device is connected, the system jumps to the fourth target detection state. In the fourth target detection state, the first current source module and the second current source module operate in a high-power mode, the first input terminal is connected to the second reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel.
[0016] According to one embodiment of this application, after the jump to the fourth target detection state, the method further includes:
[0017] In the fourth target detection state, the voltage of the first connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the second connection channel;
[0018] Based on the connection type information of the first connection channel and the second connection channel, it is determined whether the Type-C device is connected to the target cable and the connection channel to which the target cable is connected.
[0019] According to one embodiment of this application, the method further includes:
[0020] When the first current source module and the second current source module are operating in low power mode, the first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel, the voltage of the first connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the second connection channel.
[0021] Based on the connection status information of the first connection channel and the second connection channel, it is determined whether the Type-C device is connected or whether the target cable is unplugged.
[0022] Secondly, this application provides a status detection circuit for a Type-C device, the Type-C device having a first connection channel and a second connection channel, the status detection circuit comprising:
[0023] A state control module, comprising a first current source module connected to the first connection channel and a second current source module connected to the second connection channel, wherein both the first current source module and the second current source module have a high power consumption mode and a low power consumption mode.
[0024] An input state detection module includes a comparator. The first input terminal of the comparator can be selectively connected to a first reference voltage terminal and a second reference voltage terminal with higher power consumption than the first reference voltage terminal. The second input terminal of the comparator can be selectively connected to either the first connection channel or the second connection channel.
[0025] A detection state machine is connected to the state control module and the input state detection module. The detection state machine is used to perform state transitions, instruct the actions of the state control module and the input state detection module, and execute the state detection method for the Type-C device as described in the first aspect above.
[0026] According to the status detection circuit of the Type-C device in this application, when the Type-C device is detected to be connected to the target cable, it jumps to the first target detection state, and after the first target detection state lasts for a certain period of time, it jumps to the second target detection state. This avoids the Type-C device from entering the high-power precision detection state when it is only connected to the target cable, and avoids the discharge circuit formed after the Type-C device is connected to the target cable, which increases the power consumption. This can effectively reduce the power consumption caused by the Type-C device being connected to the cable.
[0027] According to one embodiment of this application, the first current source module includes a first switch, a first low-power current source, and a first high-power current source. One end of the first switch is connected to the first connection channel, and the other end of the first switch can be selectively connected to the first high-power current source, the first low-power current source, or left floating.
[0028] When the first current source module operates in high-power mode, the other end of the first switch is connected to the first high-power current source; when the first current source module operates in low-power mode, the other end of the first switch is connected to the first low-power current source.
[0029] According to one embodiment of this application, the second current source module includes a second switch, a second low-power current source, and a second high-power current source. One end of the second switch is connected to the second connection channel, and the other end of the second switch can be selectively connected to the second high-power current source, the second low-power current source, or left floating.
[0030] When the second current source module operates in high power mode, the other end of the second switch is connected to the second high power current source. When the second current source module operates in low power mode, the other end of the second switch is connected to the second low power current source.
[0031] According to one embodiment of this application, the input state detection module further includes a third switch and a fourth switch. One end of the third switch is connected to the first input terminal, and the other end of the third switch can be selectively connected to the first reference voltage terminal and the second reference voltage terminal. One end of the fourth switch is connected to the second input terminal, and the other end of the fourth switch periodically switches between the first connection channel and the second connection channel.
[0032] Thirdly, this application provides a Type-C device, including the status detection circuit of the Type-C device as described in the second aspect above.
[0033] Fourthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the status detection method for a Type-C device as described in the first aspect.
[0034] Fifthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the state detection method for a Type-C device as described in the first aspect above.
[0035] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the state detection method for a Type-C device as described in the first aspect above.
[0036] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0037] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0038] Figure 1 This is one of the structural schematic diagrams of the status detection circuit of the Type-C device provided in the embodiments of this application;
[0039] Figure 2 This is a second schematic diagram of the status detection circuit of the Type-C device provided in the embodiments of this application;
[0040] Figure 3This is a schematic diagram of the state transition of the state detection circuit of the Type-C device provided in the embodiments of this application;
[0041] Figure 4 This is one of the flowcharts illustrating the status detection method for a Type-C device provided in this application embodiment;
[0042] Figure 5 This is a second schematic flowchart of the status detection method for a Type-C device provided in the embodiments of this application;
[0043] Figure 6 This is the third flowchart illustrating the status detection method for a Type-C device provided in this application embodiment.
[0044] Figure label:
[0045] The system includes a state control module 110, a first low-power current source 111, a first high-power current source 112, a second low-power current source 113, a second high-power current source 114, an input state detection module 120, a comparator 121, and a detection state machine 130. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0047] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0048] The following description, in conjunction with the accompanying drawings, details specific embodiments and application scenarios of the Type-C device status detection circuit, Type-C device status detection method, Type-C device, chip, and readable storage medium provided in this application.
[0049] Among them, Type-C devices can be electronic devices with a Type-C interface.
[0050] Type-C devices have a first connection channel and a second connection channel, which are connection channels of the Type-C interface. For example, the first connection channel is CC1 and the second connection channel is CC2.
[0051] In this application embodiment, Type-C devices include, but are not limited to, mobile phones, tablets, computers, cameras, power banks, and wearable devices.
[0052] like Figure 1 As shown, the status detection circuit of the Type-C device includes: a status control module 110, an input status detection module 120, and a detection status machine 130.
[0053] The status control module 110 is used to control the Type-C role that the Type-C device displays to the outside world. It can be represented as an output port (Upstream Facing Port, UFP), an input port (Downstream Facing Port, DFP), a dual role port (DRP), etc. Among them, the DRP can act as a DFP or UFP as needed.
[0054] In this embodiment, the state control module 110 includes a first current source module connected to the first connection channel and a second current source module connected to the second connection channel. Both the first current source module and the second current source module have a high power consumption mode and a low power consumption mode.
[0055] In actual implementation, the state control module 110 is equipped with a first current source module and a second current source module. The first current source module can provide a current source for the first connection channel, and the second current source module can provide a current source for the second connection channel. The first current source module and the second current source module operate in a high power consumption mode or a low power consumption mode, and can provide current sources of different precision for the first connection channel and the second connection channel to realize different connection detection functions.
[0056] In this embodiment, the input state detection module 120 includes a comparator 121. The first input terminal of the comparator 121 can be selectively connected to a first reference voltage terminal and a second reference voltage terminal with higher power consumption than the first reference voltage terminal. The second input terminal of the comparator 121 can be selectively connected to a first connection channel or a second connection channel.
[0057] It is understandable that the input of the input status detection module 120 is the first connection channel and the second connection channel of the Type-C interface, and the input status detection module 120 can output the voltage range of the first connection channel and the second connection channel.
[0058] In actual implementation, the input state detection module 120 is equipped with a comparator 121. The first input terminal of the comparator 121 is the reference voltage value provided by the reference voltage terminal, and the second input terminal of the comparator 121 is the voltage of the first connection channel or the second connection channel. By comparison, the voltage range of the first connection channel and the second connection channel can be output.
[0059] It should be noted that the first input terminal of comparator 121 can be selectively connected to a first reference voltage terminal and a second reference voltage terminal. The power consumption of the first reference voltage terminal is lower than that of the second reference voltage terminal, and the accuracy of the first reference voltage terminal is also lower than that of the second reference voltage terminal. The reference voltage provided by the first reference voltage terminal can be used for coarse detection, while the reference voltage provided by the second reference voltage terminal can be used for precise detection.
[0060] In practice, the second reference voltage terminal can provide two or more reference voltages.
[0061] For example, the first reference voltage terminal can provide a reference voltage of 1.6V, and the second reference voltage terminal can provide reference voltages of 0.8V and 2.6V.
[0062] In this embodiment, when the first input terminal of comparator 121 is connected to the first reference voltage terminal, the voltage of the first connection channel or the second connection channel is compared with the 1.6V reference voltage. When the first input terminal of comparator 121 is connected to the second reference voltage terminal, the voltage of the first connection channel or the second connection channel is compared with the 0.8V and 2.6V reference voltages.
[0063] The detection state machine 130 is connected to the state control module 110 and the input state detection module 120. The detection state machine 130 is used to perform state transitions and indicate the actions of the state control module 110 and the input state detection module 120.
[0064] A state machine is a mathematical model used to describe the behavior or functional behavior of a system by simulating the system's behavior through transitions between different states.
[0065] In this embodiment, the detection state machine 130 can perform state transitions based on the comparison result output by the comparator 121 in the input state detection module 120, the state in which the detection state machine 130 is located, and other conditions, thereby instructing the state control module 110 and the input state detection module 120 to perform actions.
[0066] Understandably, the detection state machine 130 can jump to different detection states, the first current source module and the second current source module of the state control module 110 can operate in different power consumption modes as the detection state changes, and the comparator 121 of the input state detection module 120 can be connected to different reference voltage terminals as the detection state changes.
[0067] In this embodiment, the detection state machine 130 is used to jump to the first target detection state corresponding to the connection channel of the target cable when the target cable is determined to be one of the connection target cables in the first connection channel and the second connection channel based on the output result of the comparator 121.
[0068] The target cable can be a Type-C cable such as an EMarker cable. The end of the EMarker cable is embedded with a USB electronic tag chip (Electrically Marked Cable), which serves as an electronic identification tag for the cable and can store and transmit various attribute information of the cable.
[0069] The tag chip can be used to read information such as the target cable's power transmission capability, data transmission capability, video transmission capability, and ID.
[0070] In this actual implementation, based on the comparison result between the first connection channel output by comparator 121 and the reference voltage, it can be determined whether the first connection channel is connected to the target cable. Based on the comparison result between the second connection channel output by comparator 121 and the reference voltage, it can be determined whether the second connection channel is connected to the target cable.
[0071] When a target cable is connected to the first or second connection channel of the Type-C device, the detection state machine 130 jumps to the first target detection state. In the first target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal of the comparator 121 is connected to the first reference voltage terminal, and the second input terminal of the comparator 121 periodically switches between the first connection channel and the second connection channel.
[0072] In this embodiment, when the Type-C device is connected to the target cable, the first current source module and the second current source module operate in a low-power mode. The first input terminal of the comparator 121 is connected to the first reference voltage terminal, and the second input terminal of the comparator 121 periodically switches between the first connection channel and the second connection channel. Through the low-power coarse detection state of the two current source modules and the first reference voltage terminal, it is possible to detect whether the cable in the connection channel connected to the target cable is unplugged, and to detect whether a device is connected in the connection channel where the target cable is not connected. This avoids the Type-C device entering a high-power precise detection state when only the target cable is connected, effectively reducing the power consumption caused by the Type-C device connecting the cable.
[0073] Understandably, based on the output of comparator 121, the connection channel connecting the target cable in the first connection channel and the second connection channel can be determined. The first target detection state that the detection state machine 130 jumps to can be divided into the first target detection state corresponding to the first connection channel connecting the target cable and the first target detection state corresponding to the second connection channel connecting the target cable.
[0074] For example, based on the output of comparator 121, it is determined that the first connection channel is connected to the target cable. The detection state machine 130 jumps to the corresponding first target detection state, namely the T_CC2 state. The first current source module and the second current source module operate in low power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal. The second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0075] When the detection state machine 130 is in the T_CC2 state, it indicates that only the target cable is connected to the Type-C device and the pull-down resistor Ra in the target cable is located in the first connection channel. In the first target detection state, it detects whether the device is connected on the second connection channel and whether the cable is unplugged on the first connection channel.
[0076] The first reference voltage terminal provides a 1.6V reference voltage. When the voltage of the first connection channel is greater than 1.6V, it is determined that the cable of the first connection channel is unplugged. When the voltage of the second connection channel is less than 1.6V, it is determined that a device is connected to the second connection channel.
[0077] For example, based on the output of comparator 121, it is determined that the second connection channel is connected to the target cable. The detection state machine 130 jumps to the corresponding first target detection state, namely the T_CC1 state. The first current source module and the second current source module operate in low power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal. The second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0078] When the detection state machine 130 is in the T_CC1 state, it means that only the target cable is connected to the Type-C device and the pull-down resistor Ra in the target cable is located in the second connection channel. In the first target detection state, it detects whether the device is connected in the first connection channel and detects whether the cable is unplugged in the second connection channel.
[0079] The first reference voltage terminal provides a 1.6V reference voltage. When the voltage of the second connection channel is greater than 1.6V, it is determined that the cable of the second connection channel is unplugged. When the voltage of the first connection channel is less than 1.6V, it is determined that a device is connected to the first connection channel.
[0080] The detection state machine 130 of the state detection circuit is also used to switch to the second target detection state corresponding to the connection channel of the target cable when the duration of the first target detection state is greater than the first duration threshold.
[0081] In the second target detection state, the current source module corresponding to the connection channel connected to the target cable stops operating, and the current source module corresponding to the connection channel not connected to the target cable operates in low power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 is connected to the connection channel not connected to the target cable.
[0082] The first duration threshold is a pre-set duration threshold, for example, the first duration threshold can be 15ms.
[0083] In actual implementation, after the detection state machine 130 maintains the first target detection state for a first duration threshold, the detection state machine 130 jumps to the second target detection state to further reduce power consumption. The second target detection state to which the detection state machine 130 jumps can be divided into the second target detection state corresponding to the first connection channel connecting the target cable and the second target detection state corresponding to the second connection channel connecting the target cable.
[0084] If the connection channel for the target cable is the first connection channel, in the second target detection state, the first current source module stops operating, the second current source module operates in low power mode, the first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 is connected to the second connection channel to detect whether there is a device connected to the second connection channel.
[0085] For example, when the first connection channel is connected to the target cable, the detection state machine 130 jumps to the corresponding second target detection state, namely the T_CC2_Wait state. The first current source module stops running, and the pull-down resistor Ra in the target cable is disconnected from the loop of the first connection channel. When the voltage of the second connection channel is less than 1.6V, it is determined that a device is connected to the second connection channel.
[0086] If the connection channel for the target cable is the second connection channel, in the second target detection state, the second current source module stops operating, the first current source module operates in low power mode, the first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 is connected to the first connection channel to detect whether there is a device connected to the first connection channel.
[0087] For example, when the second connection channel is connected to the target cable, the detection state machine 130 jumps to the corresponding second target detection state, namely the T_CC1_Wait state. The second current source module stops running, and the pull-down resistor Ra in the target cable is disconnected from the loop of the second connection channel. When the voltage of the first connection channel is less than 1.6V, it is determined that a device is connected to the first connection channel.
[0088] In this embodiment, under the second target detection state, by operating only one current source module and a low-power first reference voltage terminal, it only detects whether a device is connected in the connection channel where the target cable is not connected, and no longer detects whether the cable in the connection channel where the target cable is connected is unplugged. The current source module corresponding to the connection channel where the target cable is connected stops operating, which can avoid the formation of a discharge circuit after the Type-C device is connected to the target cable, thus avoiding increased power consumption.
[0089] In related technologies, some devices enter a low-power coarse detection state after connecting a Type-C cable. However, the connection of a Type-C device with a cable creates a discharge circuit, leading to increased power consumption. Compared to when there is no cable connection, the power consumption of the electronic tag chip often increases several times.
[0090] In this embodiment, when a Type-C device is detected to be connected to a target cable, the system jumps to a first target detection state. A low-power coarse detection state is used to detect whether the cable in the connection channel connected to the target cable is unplugged and whether a device is connected in the connection channel where the target cable is not connected. This avoids the Type-C device from entering a high-power precise detection state when it is only connected to the target cable. After the first target detection state lasts for a certain period of time, the system jumps to a second target detection state. A low-power coarse detection state is used to detect whether a device is connected in the connection channel where the target cable is not connected. This avoids the formation of a discharge circuit after the Type-C device is connected to the target cable, which would increase power consumption and effectively reduce the power consumption caused by the Type-C device being connected to the target cable.
[0091] According to the status detection circuit of the Type-C device provided in the embodiments of this application, when the Type-C device is detected to be connected to the target cable, it jumps to the first target detection state, and after the first target detection state lasts for a certain period of time, it jumps to the second target detection state. This avoids the Type-C device from entering the high-power precision detection state when it is only connected to the target cable, and avoids the increase in power consumption caused by the formation of a discharge circuit after the Type-C device is connected to the target cable. This can effectively reduce the power consumption caused by the Type-C device being connected to the cable.
[0092] In some embodiments, the detection state machine 130 is further configured to switch to the first target detection state corresponding to the connection channel of the target cable if the duration of the second target detection state is greater than the second duration threshold.
[0093] The second duration threshold is a pre-set duration threshold, for example, the second duration threshold can be 250ms.
[0094] In this embodiment, when the duration of the detection state machine 130 in the second target detection state exceeds the second duration threshold, it jumps back to the first target detection state to detect whether the target cable has been unplugged, ensuring the accuracy and real-time performance of the detection results of the state detection circuit. After the duration of the detection state machine 130 in the first target detection state exceeds the first duration threshold, it jumps back to the second target detection state to only detect whether a device is connected.
[0095] It should be noted that the detection state machine 130 is in the first target detection state, indicating that the state detection circuit has not detected the device being connected or the target cable being unplugged. The detection state machine 130 is in the second target detection state, indicating that the state detection circuit has not detected the device being connected. If a device being connected or the target cable being unplugged occurs in the first target detection state or the second target detection state, the detection state machine 130 will jump to other detection states, and the duration of the first target detection state or the second target detection state will stop counting.
[0096] In practice, the second duration threshold can be greater than the first duration threshold, meaning that when the Type-C device is only connected to the target cable, the second target detection state lasts for a longer period of time.
[0097] Understandably, in the second target detection state, one current source module stops working, while in the first target detection state, both current source modules operate in low-power mode. The power consumption of the Type-C device in the second target detection state is lower than that in the first target detection state.
[0098] Taking a first duration threshold of 15ms and a second duration threshold of 250ms as an example.
[0099] When the target cable is connected to the first connection channel, the working time of the first current source module in the first target detection state is 15ms. In the second target detection state, the first current source module stops running. Within one cycle formed by the first target detection state and the second target detection state, the first current source module only runs at low power for 15ms.
[0100] In related technologies, after connecting the Type-C cable, it enters a low-power coarse detection state. The low-precision current source will run for 265ms in the same cycle. Compared with related technologies, the power consumption of the embodiment of this application is greatly reduced, 15ms / 265ms=6%. It periodically jumps between the first target detection state and the second target detection state, which is about 6% of the power consumption of the normally open low-precision current source.
[0101] In some embodiments, the detection state machine 130 is further configured to jump to a third target detection state if, based on the output of the comparator 121, it is determined that the Type-C device is not connected or the target cable is unplugged.
[0102] In the third target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0103] In this embodiment, based on the output of comparator 121, when it is determined that the Type-C device is not connected or the target cable originally connected to the Type-C device is unplugged, the detection state machine 130 jumps to the third target detection state, indicating that no access event has been detected on the first connection channel and the second connection channel. The access event on the first connection channel and the second connection channel is continuously monitored through the third target detection state.
[0104] For example, based on the output of comparator 121, if it is determined that the Type-C device is not connected or the target cable is unplugged, the detection state machine 130 jumps to the third target detection state, namely the T_CC1CC2 state. The first current source module and the second current source module operate in low power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0105] The first reference voltage terminal provides a 1.6V reference voltage. When the voltages of both the first and second connection channels are greater than 1.6V, it is assumed that no device is connected and the device remains in the T_CC1CC2 state. By utilizing the low-power first reference voltage terminal and with both current source modules operating in low-power mode, the power consumption of the Type-C device is kept low.
[0106] It should be noted that in the T_CC1 or T_CC2 state, the first reference voltage terminal with low power consumption is used, and the two current source modules also operate in low power consumption mode. One current source module forms a loop with the pull-down resistor of the target cable to discharge. The power of the T_CC1 or T_CC2 state is higher than that of the T_CC1CC2 state.
[0107] In the T_CC1_Wait or T_CC2_Wait state, the first reference voltage terminal with low power consumption is used, only one current source module operates in low power mode, the current source module corresponding to the connection channel of the target cable is turned off, and the power of T_CC1_Wait or T_CC2_Wait is less than or equal to the power of T_CC1CC2 state.
[0108] In some embodiments, the detection state machine 130 is further configured to switch to the fourth target detection state if it is determined, based on the output of the comparator 121, that a Type-C device is connected.
[0109] In the fourth target detection state, the first current source module and the second current source module operate in a high power consumption mode. The first input terminal of comparator 121 is connected to the second reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0110] In this embodiment, based on the output of comparator 121, a Type-C device is initially detected to be connected. The detection state machine 130 then jumps to the fourth target detection state, using a high-power, high-precision detection state to determine whether a device has actually been connected and the type of the connected device.
[0111] For example, based on the output of comparator 121, it is determined that a Type-C device is connected, and the detection state machine 130 jumps to the fourth target detection state, namely CC1CC2 state. The first current source module and the second current source module operate in high power mode. The first input terminal of comparator 121 is connected to the second reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0112] The second reference voltage terminal provides 0.8V and 2.6V reference voltages. The second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel to obtain the magnitude relationship between the two channels and 0.8V and 2.6V. It determines whether a device is actually connected and the type of the connected device according to the protocol specified by the Type-C device.
[0113] In some embodiments, in the fourth target detection state, comparator 121 is used to compare the voltage of the first connection channel with the voltage of the second reference voltage terminal and output the connection type information of the first connection channel. Comparator 121 is also used to compare the voltage of the second connection channel with the voltage of the second reference voltage terminal and output the connection type information of the second connection channel. Detection state machine 130 is used to determine whether the Type-C device is connected to the target cable and the connection channel to which the target cable is connected, based on the connection type information of the first connection channel and the second connection channel.
[0114] In this embodiment, the connection type information of the connection channel can be determined based on the comparison result between the voltage of the connection channel and the voltage of the second reference voltage terminal. The connection type of the connection channel may include SRC.Open, SRC.Rd, SRC.Ra, etc.
[0115] For example, if a Type-C device is a Source device, the connection type of a connection channel is SRC.Open when the voltage of a certain connection channel is greater than 2.6V; the connection type of a connection channel is SRC.Ra when the voltage of a certain connection channel is less than 0.8V; and the connection type of a connection channel is SRC.Rd when the voltage of a certain connection channel is greater than 0.8V and less than 2.6V.
[0116] In the CC1CC2 state, when both the first and second connection channels are SRC.Open, it indicates that no device is connected or the connected device is a non-target cable. The detection state machine 130 can return to the T_CC1CC2 state to wait for device access.
[0117] In the CC1CC2 state, when the first connection channel is SRC.Open and the second connection channel is SRC.Ra, it indicates that a target cable is connected and the pull-down resistor Ra in the target cable is connected in the second connection channel. The detection state machine 130 jumps to the T_CC1 state to detect whether the target cable is unplugged or the device is connected.
[0118] In the CC1CC2 state, when the second connection channel is SRC.Open and the first connection channel is SRC.Ra, it indicates that a target cable is connected and the pull-down resistor Ra in the target cable is connected in the first connection channel. The detection state machine 130 jumps to the T_CC2 state to detect whether the target cable is unplugged or the device is connected.
[0119] In some embodiments, when the first current source module and the second current source module are operating in a low-power mode, the first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel, comparator 121 is used to compare the voltage of the first connection channel with the voltage of the first reference voltage terminal and output the connection status information of the first connection channel. Comparator 121 is also used to compare the voltage of the second connection channel with the voltage of the first reference voltage terminal and output the connection status information of the second connection channel. The detection state machine 130 is used to determine whether the Type-C device is connected or the target cable is unplugged based on the connection status information of the first connection channel and the second connection channel.
[0120] In this embodiment, when the detection state machine 130 is in the first target detection state or the third target detection state, it can determine the connection status information of the connection channel based on the comparison result between the voltage of the connection channel and the voltage of the first reference voltage terminal, that is, determine whether the connection channel has an access event or a disconnection event.
[0121] For example, in the T_CC2 state, the first connection channel is connected to the target cable. When the voltage of the first connection channel is greater than 1.6V, the target cable is considered to be unplugged.
[0122] For example, in the T_CC1CC2 state, if the voltage of both the first and second connection channels is greater than 1.6V, it indicates that no device is connected.
[0123] The following section provides a detailed description of the structure of each module in the status detection circuit of a Type-C device.
[0124] In some embodiments, the first current source module includes a first switch, a first low-power current source 111 and a first high-power current source 112. One end of the first switch is connected to a first connection channel, and the other end of the first switch can be selectively connected to the first high-power current source 112, the first low-power current source 111 or left floating.
[0125] In this embodiment, the first current source module operates in a high-power mode where the other end of the first switch is connected to the first high-power current source 112, and the first current source module operates in a low-power mode where the other end of the first switch is connected to the first low-power current source 111.
[0126] In some embodiments, the second current source module includes a second switch, a second low-power current source 113 and a second high-power current source 114. One end of the second switch is connected to the second connection channel, and the other end of the second switch can be selectively connected to the second high-power current source 114, the second low-power current source 113 or left floating.
[0127] In this embodiment, the second current source module operates in a high-power mode where the other end of the second switch is connected to the second high-power current source 114, and operates in a low-power mode where the other end of the second switch is connected to the second low-power current source 113.
[0128] like Figure 2 As shown, the first switch is K1. One end of K1 is connected to the first connection channel, and the other end of K1 can be selectively connected to the first high-power current source 112, the first low-power current source 111, or left floating.
[0129] The second switch is K2. One end of K2 is connected to the second connection channel, and the other end of K2 can be selectively connected to the second high-power current source 114, the second low-power current source 113, or left floating.
[0130] It is understandable that the first high-power current source 112 and the second high-power current source 114 are high-power, high-precision current sources, and the current provided can be 330uA. When the first high-power current source 112 and the second high-power current source 114 are connected, the current source module operates in high-power mode and can detect the type information of the device connected to the corresponding channel.
[0131] The first low-power current source 111 and the second low-power current source 113 are low-power, low-precision current sources that can provide a current of up to 80uA. When the first low-power current source 111 and the second low-power current source 113 are connected, the current source module operates in low-power mode and can detect whether an access event has occurred in the corresponding connection channel.
[0132] In some embodiments, the input state detection module 120 further includes a third switch and a fourth switch. One end of the third switch is connected to the first input terminal of the comparator 121, and the other end of the third switch can be selectively connected to the first reference voltage terminal and the second reference voltage terminal. One end of the fourth switch is connected to the second input terminal, and the other end of the fourth switch periodically switches between the first connection channel and the second connection channel.
[0133] like Figure 2 As shown, the first reference voltage terminal, which is low in power consumption and low in precision, can provide a reference voltage of 1.6V. The second reference voltage terminal can provide reference voltages of 0.8V and 2.6V. The third switch is K3, one end of which is connected to the first input terminal, and the other end of which is connected to one of the 0.8V, 1.6V or 2.6V reference voltages.
[0134] The fourth switch is K4. One end of K4 is connected to the second input terminal of comparator 121, and the other end of K4 periodically switches between the first connection channel and the second connection channel. Comparator 121 compares the voltage of the first connection channel and the second connection channel with the magnitude of the reference voltages of 0.8V, 1.6V and 2.6V, and outputs the result to the detection state machine 130 so that the detection state machine 130 can perform state transitions and indicate the actions of K1, K2, K3 and K4.
[0135] It should be noted that the magnitude and number of reference voltage values provided by the reference voltage terminal in the input status detection module 120 can be adjusted according to different Type-C devices. They can be 0.8V, 1.6V, and 2.6V, or other reference voltage values.
[0136] The 1.6V reference voltage provided by the first reference voltage terminal is an empirical value and can be replaced with other reference voltages. The goal is to ensure that the voltage of the connection channel is less than the reference voltage of the first reference voltage terminal when the pull-down resistor Rd of the Sink terminal is connected, so that the state detection circuit can exit the low-power state.
[0137] The following describes a specific embodiment of a detection state machine 130 performing state transitions.
[0138] like Figure 3 As shown, the Type-C device is in its initial state with no device connected. The detection state machine 130 is in the T_CC1CC2 state. K1 and K2 are connected to the corresponding low-power current sources, K3 is connected to the 1.6V reference voltage, and K4 periodically switches between the first connection channel and the second connection channel to obtain the magnitude relationship between the two connection channels and 1.6V.
[0139] When the voltage of both connection channels is greater than 1.6V, it is determined that no device is connected, the detection state machine 130 remains in the T_CC1CC2 state, and the Type-C device remains in a lower state.
[0140] At a certain moment, if the voltage of the first connection channel or the second connection channel is less than 1.6V, a device is connected. The detection state machine 130 jumps to the CC1CC2 state to determine the type of the connected device. At this time, K1 and K2 are connected to the corresponding high-power current sources, K3 periodically switches between 0.8V and 2.6V, and K4 periodically switches between the first connection channel and the second connection channel.
[0141] In the CC1CC2 state, when both the first and second connection channels are in the SRC.Open state, it indicates that no device is connected or the connected device is a non-EMaker cable. The detection state machine 130 returns to the T_CC1CC2 state to wait for device access.
[0142] When the first connection channel is SRC.Open and the second connection channel is SRC.Ra, it is determined that only the Emaker cable is connected, and the pull-down resistor Ra in the EMaker cable is connected in the second connection channel. The detection state machine 130 jumps to the T_CC1 state to detect whether the EMaker cable is unplugged or the device is connected.
[0143] When the second connection channel is SRC.Open and the first connection channel is SRC.Ra, it is determined that only the Emaker cable is connected, and the pull-down resistor Ra in the EMaker cable is connected in the first connection channel. The detection state machine 130 jumps to the T_CC2 state to detect whether the EMaker cable is unplugged or the device is connected.
[0144] In either T_CC1 or T_CC2 state, K1 and K2 are connected to the corresponding low-power current sources, K3 is connected to the 1.6V reference voltage, and K4 periodically switches between the first and second connection channels to detect whether a device is connected and whether the EMaker cable is unplugged.
[0145] In the T_CC1 state, when the voltage of the second connection channel is greater than 1.6V, it is determined that the EMaker cable has been unplugged, and the detection state machine 130 returns to the T_CC1CC2 state to wait for the device to be connected; when the voltage of the first connection channel is less than 1.6V, it is determined that a new device has been connected to the first connection channel, and the detection state machine 130 jumps to the CC1CC2 state to determine the type of the connected device.
[0146] If no device is detected or the EMaker cable is unplugged after waiting 15ms in the T_CC1 state, the system will switch to the T_CC1_Wait state to further reduce power consumption.
[0147] In the T_CC1_Wait state, K1 is connected to a low-power current source, K2 is left floating, K3 is connected to a 1.6V reference voltage, and K4 is connected to the first connection channel to obtain the magnitude relationship between the first connection channel and the 1.6V reference voltage. In the T_CC1_Wait state, the EMaker cable is not unplugged, which can effectively reduce the power consumption of the device.
[0148] In the T_CC1_Wait state, when the voltage of the first connection channel is less than 1.6V, it is determined that a new device has been connected to the first connection channel, and the detection state machine 130 jumps to the CC1CC2 state to determine the type of the connected device.
[0149] After waiting for 250ms in the T_CC1_Wait state and still not detecting any device connection, the system jumps to the T_CC1 state to check if the EMaker cable has been unplugged.
[0150] In the T_CC2 state, when the voltage of the first connection channel is greater than 1.6V, it is determined that the EMaker cable has been unplugged, and the detection state machine 130 returns to the T_CC1CC2 state to wait for the device to be connected; when the voltage of the second connection channel is less than 1.6V, it is determined that a new device has been connected to the second connection channel, and the detection state machine 130 jumps to the CC1CC2 state to determine the type of the connected device.
[0151] If no device is detected or the EMaker cable is unplugged after waiting 15ms in the T_CC2 state, the system will switch to the T_CC2_Wait state to further reduce power consumption.
[0152] In the T_CC2_Wait state, K2 is connected to a low-power current source, K1 is left floating, K3 is connected to a 1.6V reference voltage, and K4 is connected to the first connection channel to obtain the magnitude relationship between the first connection channel and the 1.6V reference voltage. In the T_CC2_Wait state, the EMaker cable is not detected for being pulled out, which can effectively reduce the power consumption of the device.
[0153] In the T_CC2_Wait state, when the voltage of the second connection channel is less than 1.6V, it is determined that a new device has been connected to the second connection channel, and the detection state machine 130 jumps to the CC1CC2 state to determine the type of the connected device.
[0154] After waiting for 250ms in the T_CC2_Wait state and still not detecting any device connection, it jumps to the T_CC2 state to check if the EMaker cable has been unplugged.
[0155] It should be noted that in the T_CC1 or T_CC2 state, the first reference voltage terminal with low power consumption is used, and the two current source modules also operate in low power consumption mode. One current source module forms a loop with the pull-down resistor of the target cable to discharge. The power of the T_CC1 or T_CC2 state is higher than that of the T_CC1CC2 state.
[0156] In the T_CC1_Wait or T_CC2_Wait state, the first reference voltage terminal with low power consumption is used, only one current source module operates in low power mode, the current source module corresponding to the connection channel of the target cable is turned off, and the power of T_CC1_Wait or T_CC2_Wait is less than or equal to the power of T_CC1CC2 state.
[0157] In this embodiment, by switching between different detection states through the detection state machine 130, the high-power precision detection state is avoided when the Type-C device is only connected to the target cable, and the power consumption is reduced by forming a discharge circuit after the Type-C device is connected to the target cable. This can effectively reduce the power consumption caused by the Type-C device being connected to the cable.
[0158] This application also provides a state detection method for a Type-C device. The Type-C device has a first connection channel and a second connection channel. A first current source module is connected to the first connection channel, and a second current source module is connected to the second connection channel. The first input terminal of a comparator can be selectively connected to a first reference voltage terminal and a second reference voltage terminal with power consumption higher than the first reference voltage terminal. The second input terminal of the comparator can be selectively connected to the first connection channel or the second connection channel.
[0159] The status detection method for this Type-C device can be applied to the status detection circuit of the aforementioned Type-C device.
[0160] like Figure 4 As shown, the status detection method for a Type-C device in this application embodiment may include steps 410 and 420.
[0161] Step 410: If, based on the output of comparator 121, a target cable is determined to be connected in one of the first connection channel and the second connection channel, the process jumps to the first target detection state corresponding to the connection channel of the target cable.
[0162] In the first target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0163] In this embodiment, when the Type-C device is connected to the target cable, the first current source module and the second current source module operate in a low-power mode. The first input terminal of the comparator 121 is connected to the first reference voltage terminal, and the second input terminal of the comparator 121 periodically switches between the first connection channel and the second connection channel. Through the low-power coarse detection state of the two current source modules and the first reference voltage terminal, it is possible to detect whether the cable in the connection channel connected to the target cable is unplugged, and to detect whether a device is connected in the connection channel where the target cable is not connected. This avoids the Type-C device entering a high-power precise detection state when only the target cable is connected, effectively reducing the power consumption caused by the Type-C device connecting the cable.
[0164] For example, based on the output of comparator 121, it is determined that the first connection channel is connected to the target cable, and the detection state machine 130 jumps to the corresponding first target detection state, namely the T_CC2 state.
[0165] In T_CC2 state, the system detects whether a device is connected on the second connection channel and whether the cable is unplugged on the first connection channel. When the voltage of the first connection channel is greater than 1.6V, it is determined that the cable of the first connection channel is unplugged. When the voltage of the second connection channel is less than 1.6V, it is determined that a device is connected on the second connection channel.
[0166] For example, based on the output of comparator 121, it is determined that the second connection channel is connected to the target cable, and the detection state machine 130 jumps to the corresponding first target detection state, namely the T_CC1 state.
[0167] In the T_CC1 state, it checks whether a device is connected on the first connection channel and whether the cable is unplugged on the second connection channel. When the voltage of the second connection channel is greater than 1.6V, it is determined that the cable of the second connection channel is unplugged. When the voltage of the first connection channel is less than 1.6V, it is determined that a device is connected on the first connection channel.
[0168] Step 420: If the duration of the first target detection state is greater than the first duration threshold, jump to the second target detection state corresponding to the connection channel of the target cable.
[0169] In the second target detection state, the current source module corresponding to the connection channel connected to the target cable stops operating, and the current source module corresponding to the connection channel not connected to the target cable operates in low power mode. The first input terminal is connected to the first reference voltage terminal, and the second input terminal is connected to the connection channel not connected to the target cable.
[0170] For example, when the first connection channel is connected to the target cable, the detection state machine 130 jumps to the corresponding second target detection state, namely the T_CC2_Wait state. The first current source module stops running, and the pull-down resistor Ra in the target cable is disconnected from the loop of the first connection channel. When the voltage of the second connection channel is less than 1.6V, it is determined that a device is connected to the second connection channel.
[0171] For example, when the second connection channel is connected to the target cable, the detection state machine 130 jumps to the corresponding second target detection state, namely the T_CC1_Wait state. The second current source module stops running, and the pull-down resistor Ra in the target cable is disconnected from the loop of the second connection channel. When the voltage of the first connection channel is less than 1.6V, it is determined that a device is connected to the first connection channel.
[0172] In this embodiment, under the second target detection state, by operating only one current source module and a low-power first reference voltage terminal, it only detects whether a device is connected in the connection channel where the target cable is not connected, and no longer detects whether the cable in the connection channel where the target cable is connected is unplugged. The current source module corresponding to the connection channel where the target cable is connected stops operating, which can avoid the formation of a discharge circuit after the Type-C device is connected to the target cable, thus avoiding increased power consumption.
[0173] According to the Type-C device status detection method provided in the embodiments of this application, when the Type-C device is detected to be connected to the target cable, it jumps to the first target detection state, and after the first target detection state lasts for a certain period of time, it jumps to the second target detection state. This avoids the Type-C device from entering the high-power precision detection state when it is only connected to the target cable, and avoids the formation of a discharge circuit after the Type-C device is connected to the target cable, which increases the power consumption. This can effectively reduce the power consumption caused by the Type-C device being connected to the cable.
[0174] In some embodiments, such as Figure 5 As shown, after switching to the second target detection state corresponding to the connection channel of the target cable, the status detection method of the Type-C device may further include:
[0175] Step 430: If the duration of the second target detection state is greater than the second duration threshold, jump to the first target detection state corresponding to the connection channel of the target cable.
[0176] In this embodiment, when the duration of the detection state machine 130 in the second target detection state exceeds the second duration threshold, it jumps back to the first target detection state to detect whether the target cable has been pulled out, thus ensuring the accuracy and real-time performance of the detection results of the state detection circuit.
[0177] In practice, the second duration threshold can be greater than the first duration threshold, meaning that when the Type-C device is only connected to the target cable, the second target detection state lasts for a longer period of time.
[0178] Understandably, in the second target detection state, one current source module stops working, while in the first target detection state, both current source modules operate in low-power mode. The power consumption of the Type-C device in the second target detection state is lower than that in the first target detection state.
[0179] Taking a first duration threshold of 15ms and a second duration threshold of 250ms as an example.
[0180] When the target cable is connected to the first connection channel, the working time of the first current source module in the first target detection state is 15ms. In the second target detection state, the first current source module stops running. Within one cycle formed by the first target detection state and the second target detection state, the first current source module only runs at low power for 15ms.
[0181] In related technologies, after connecting the Type-C cable, it enters a low-power coarse detection state. The low-precision current source will run for 265ms in the same cycle. Compared with related technologies, the power consumption of the embodiment of this application is greatly reduced, 15ms / 265ms=6%. It periodically jumps between the first target detection state and the second target detection state, which is about 6% of the power consumption of the normally open low-precision current source.
[0182] In some embodiments, the state detection method for a Type-C device further includes:
[0183] If, based on the output of comparator 121, it is determined that the Type-C device is not connected or the target cable is unplugged, the process jumps to the third target detection state.
[0184] In the third target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0185] In this embodiment, based on the output of comparator 121, when it is determined that the Type-C device is not connected or the target cable originally connected to the Type-C device is unplugged, the detection state machine 130 jumps to the third target detection state, indicating that no access event has been detected on the first connection channel and the second connection channel. The access event on the first connection channel and the second connection channel is continuously monitored through the third target detection state.
[0186] In some embodiments, the state detection method for a Type-C device further includes:
[0187] If the output of comparator 121 determines that a Type-C device is connected, the system jumps to the fourth target detection state.
[0188] In the fourth target detection state, the first current source module and the second current source module operate in a high power consumption mode. The first input terminal of comparator 121 is connected to the second reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel.
[0189] In this embodiment, based on the output of comparator 121, a Type-C device is initially detected to be connected. The detection state machine 130 then jumps to the fourth target detection state, using a high-power, high-precision detection state to determine whether a device has actually been connected and the type of the connected device.
[0190] In some embodiments, after hopping to the fourth target detection state, the state detection method for the Type-C device further includes:
[0191] The voltage of the first connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the second connection channel.
[0192] Based on the connection type information of the first connection channel and the second connection channel, it is determined whether the Type-C device is connected to the target cable and the connection channel to which the target cable is connected.
[0193] In this embodiment, the connection type information of the connection channel can be determined based on the comparison result between the voltage of the connection channel and the voltage of the second reference voltage terminal. The connection type of the connection channel may include SRC.Open, SRC.Rd, SRC.Ra, etc.
[0194] In some embodiments, the state detection method for a Type-C device may further include:
[0195] When the first current source module and the second current source module are operating in low power mode, the first input terminal of comparator 121 is connected to the first reference voltage terminal, and the second input terminal of comparator 121 periodically switches between the first connection channel and the second connection channel, the voltage of the first connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the second connection channel.
[0196] Based on the connection status information of the first and second connection channels, determine whether the Type-C device is connected or whether the target cable is unplugged.
[0197] In this embodiment, when in the first target detection state or the third target detection state, the connection status information of the connection channel can be determined based on the comparison result between the voltage of the connection channel and the voltage of the first reference voltage terminal, that is, whether an access event or a disconnection event has occurred in the connection channel. A specific embodiment is described below.
[0198] like Figure 6 As shown, in step 610, based on the voltage of the CC1 and CC2 pins of the Type-C device, determine whether CC1 and CC2 are connected to the device.
[0199] In this step, the detection state machine 130 can be in the T_CC1CC2 state to detect whether a device is connected, but not to detect the type of the connected device, thus reducing power consumption.
[0200] Step 620: After detecting a device connection on the CC channel of the Type-C device, further determine the type of the connected device. When one channel is in the SRC.Open state and the other channel is in the SRC.Ra state, determine that the Emaker cable is connected.
[0201] In this step, the detection state machine 130 can switch from the T_CC1CC2 state to the CC1CC2 state, and further determine the type of connected device by using precise reference voltage and current sources.
[0202] Step 630: After confirming that the only connected device is the Emaker cable, periodically detect the Emaker cable being unplugged on the CC channel connected to Ra, and continuously monitor for new device connections on the CC channel not connected to Ra.
[0203] In this step, after confirming that the only connected device is the Emaker cable, the detection state machine 130 jumps to the T_CC1 or T_CC2 state. On the CC channel connected to Ra, the EMaker cable is periodically detected for being unplugged, and on the CC channel not connected to Ra, new devices are continuously detected for being connected.
[0204] After a certain period of time, the power is reduced further by switching to the T_CC1_Wait or T_CC2_Wait state depending on the channel in which Ra is located.
[0205] This application also provides a Type-C device.
[0206] Among them, Type-C devices can be electronic devices with a Type-C interface.
[0207] The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, in-vehicle electronic device, charging device, etc., and can also be a server, network attached storage (NAS), personal computer (PC), television (TV), etc. The embodiments of this application do not specifically limit it.
[0208] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described Type-C device state detection method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0209] The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0210] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described Type-C device status detection method.
[0211] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described Type-C device status detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0212] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0213] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0215] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0216] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0217] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for detecting the status of a Type-C device, characterized in that, The Type-C device has a first connection channel and a second connection channel. A first current source module is connected to the first connection channel, and a second current source module is connected to the second connection channel. A first input terminal of a comparator can be selectively connected to a first reference voltage terminal and a second reference voltage terminal with higher power consumption than the first reference voltage terminal. A second input terminal of the comparator can be selectively connected to either the first connection channel or the second connection channel. The method includes: If, based on the output of the comparator, a target cable is determined to be connected to one of the first connection channel and the second connection channel, the system jumps to the first target detection state corresponding to the connection channel connected to the target cable. In the first target detection state, the first current source module and the second current source module operate in a low-power mode. The first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel. If the duration of the first target detection state exceeds the first duration threshold, the system switches to the second target detection state corresponding to the connection channel connected to the target cable. In the second target detection state, the current source module corresponding to the connection channel connected to the target cable stops operating, and the current source module corresponding to the connection channel not connected to the target cable operates in a low-power mode. The first input terminal is connected to the first reference voltage terminal, and the second input terminal is connected to the connection channel not connected to the target cable.
2. The status detection method for a Type-C device according to claim 1, characterized in that, After swiping to the second target detection state corresponding to the connection channel connecting the target cable, the method further includes: If the duration of the second target detection state exceeds the second duration threshold, the system switches to the first target detection state corresponding to the connection channel connecting the target cable.
3. The status detection method for a Type-C device according to claim 1, characterized in that, The method further includes: If, based on the output of the comparator, it is determined that the Type-C device is not connected or the target cable is unplugged, the system jumps to the third target detection state. In the third target detection state, the first current source module and the second current source module operate in a low-power mode, the first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel.
4. The status detection method for a Type-C device according to any one of claims 1-3, characterized in that, The method further includes: If, based on the output of the comparator, it is determined that the Type-C device is connected, the system jumps to the fourth target detection state. In the fourth target detection state, the first current source module and the second current source module operate in a high-power mode, the first input terminal is connected to the second reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel.
5. The status detection method for a Type-C device according to claim 4, characterized in that, After the jump to the fourth target detection state, the method further includes: In the fourth target detection state, the voltage of the first connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the second reference voltage terminal to determine the connection type information of the second connection channel; Based on the connection type information of the first connection channel and the second connection channel, it is determined whether the Type-C device is connected to the target cable and the connection channel to which the target cable is connected.
6. The status detection method for a Type-C device according to any one of claims 1-3, characterized in that, The method further includes: When the first current source module and the second current source module are operating in low power mode, the first input terminal is connected to the first reference voltage terminal, and the second input terminal periodically switches between the first connection channel and the second connection channel, the voltage of the first connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the first connection channel, and the voltage of the second connection channel is compared with the voltage of the first reference voltage terminal to determine the connection status information of the second connection channel. Based on the connection status information of the first connection channel and the second connection channel, it is determined whether the Type-C device is connected or whether the target cable is unplugged.
7. A status detection circuit for a Type-C device, characterized in that, The Type-C device has a first connection channel and a second connection channel, and the status detection circuit includes: A state control module, comprising a first current source module connected to the first connection channel and a second current source module connected to the second connection channel, wherein both the first current source module and the second current source module have a high power consumption mode and a low power consumption mode. An input state detection module includes a comparator. The first input terminal of the comparator can be selectively connected to a first reference voltage terminal and a second reference voltage terminal with higher power consumption than the first reference voltage terminal. The second input terminal of the comparator can be selectively connected to either the first connection channel or the second connection channel. A detection state machine is provided, which is connected to the state control module and the input state detection module. The detection state machine is used to perform state transitions, instruct the actions of the state control module and the input state detection module, and execute the state detection method for a Type-C device as described in any one of claims 1-6.
8. The status detection circuit for a Type-C device according to claim 7, characterized in that, The first current source module includes a first switch, a first low-power current source, and a first high-power current source. One end of the first switch is connected to the first connection channel, and the other end of the first switch can be selectively connected to the first high-power current source, the first low-power current source, or left floating. When the first current source module operates in high-power mode, the other end of the first switch is connected to the first high-power current source; when the first current source module operates in low-power mode, the other end of the first switch is connected to the first low-power current source.
9. The status detection circuit for a Type-C device according to claim 7, characterized in that, The second current source module includes a second switch, a second low-power current source, and a second high-power current source. One end of the second switch is connected to the second connection channel, and the other end of the second switch can be selectively connected to the second high-power current source, the second low-power current source, or left floating. When the second current source module operates in high power mode, the other end of the second switch is connected to the second high power current source. When the second current source module operates in low power mode, the other end of the second switch is connected to the second low power current source.
10. The status detection circuit for a Type-C device according to any one of claims 7-9, characterized in that, The input state detection module further includes a third switch and a fourth switch. One end of the third switch is connected to the first input terminal, and the other end of the third switch can be selectively connected to the first reference voltage terminal and the second reference voltage terminal. One end of the fourth switch is connected to the second input terminal, and the other end of the fourth switch periodically switches between the first connection channel and the second connection channel.
11. A Type-C device, characterized in that, Includes the status detection circuit of the Type-C device as described in any one of claims 7-10.
12. A chip, the chip comprising a processor and a communication interface, the communication interface being coupled to the processor, characterized in that, The processor is used to run programs or instructions to implement the status detection method for a Type-C device as described in any one of claims 1-6.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the status detection method for a Type-C device as described in any one of claims 1-6.