主权项 |
1. An electronic device, comprising:
a housing; a connector port embedded in the housing, electrically connecting to a peripheral device inserted therein; a processor comprising a detection pin and a 1-wire pin, electrically connected to the connector port; and a switching device coupled between the connector port and the processor, selectively connecting the connector port to one of the detection pin or the 1-wire pin, wherein when the peripheral device is inserted into the connector port, the processor controls the switching device to connect the connector port to the detection pin to determine whether the connected peripheral device is a 1-wire device, and wherein when the processor determines that the connected peripheral device is a 1-wire device, the processor controls the switching device to connect the connector port to the 1-wire pin and the processor executes 1-wire communication with the peripheral device via the 1-wire pin. |