def eDigitalIn(self, channel, idNum = None, demo = 0, readD=0):
        """
        Name: U12.eDigitalIn(channel, idNum = None, demo = 0, readD=0)
        Args: See section 4.4 of the User's Guide
        Desc: This is a simplified version of DigitalIO that reads the state of
              one digital input. Also configures the requested pin to input and
              leaves it that way.

        >>> import u12
        >>> d = u12.U12()
        >>> d.eDigitalIn(0)
        {'state': 0, 'idnum': 1}
        """

        # Check id num
        if idNum is None:
            idNum = self.id
        
        if ON_WINDOWS:
            ljid = ctypes.c_long(idNum)
            state = ctypes.c_long(999)
            
            ecode = staticLib.EDigitalIn(ctypes.byref(ljid), demo, channel, readD, ctypes.byref(state))
            
            if ecode != 0: raise U12Exception(ecode)
            
            return {"idnum":ljid.value, "state":state.value}
        else:
            oldstate = self.rawDIO()
            
            if readD:
                if channel > 7:
                    channel = channel-8
                    direction = BitField(rawByte = int(oldstate['D15toD8Directions']))
                    direction[7-channel] = 1
                    
                    results = self.rawDIO(D15toD8Directions = direction, UpdateDigital = True)
                    
                    state = results['D15toD8States'][7-channel]
                    
                else:
                    direction = BitField(rawByte = int(oldstate['D7toD0Directions']))
                    direction[7-channel] = 1
                    results = self.rawDIO(D7toD0Directions = direction, UpdateDigital = True)
                    
                    state = results['D7toD0States'][7-channel]
            else:
                results = self.rawDIO(IO3toIO0DirectionsAndStates = 255, UpdateDigital = True)
                state = results['IO3toIO0States'][3-channel]
            
            return {"idnum" : self.id, "state" : state}
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/labjack/_internal/u12.py/U12.eDigitalIn/original