File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -849,3 +849,42 @@ class KeyPad(object):
849849
850850 :return: 0 - Successful execution; -1 - Failed execution
851851 """
852+
853+
854+ class OneWire (object ):
855+ """Single-Wire Bus Communication
856+
857+ https://developer.quectel.com/doc/quecpython/API_reference/zh/peripherals/machine.OneWire.html
858+
859+ This class provides single-wire (1-Wire) communication functionality.
860+ Currently only supported on EC200U/EC600U/EG912U/EG915U series modules.
861+ """
862+
863+ def __init__ (self , GPIO ):
864+ """
865+ Create a OneWire object.
866+
867+ :param GPIO: int type. The GPIO pin number to use (e.g., OneWire.GPIO19).
868+ """
869+
870+ def reset (self ):
871+ """Reset the bus and check device response
872+
873+ Usage note: This method must be called before any read/write operations.
874+
875+ :return: Integer value. 0 indicates proper response from device, -1 indicates no response.
876+ """
877+
878+ def read (self , len ):
879+ """Read data from the bus
880+
881+ :param len: int type. Length of data to read.
882+ :return: bytes object containing the read data.
883+ """
884+
885+ def write (self , data ):
886+ """Write data to the bus
887+
888+ :param data: bytes type. Data to be written.
889+ :return: Integer value 0.
890+ """
You can’t perform that action at this time.
0 commit comments