def readU16(self, register, little_endian=True):
        """Read an unsigned 16-bit value from the specified register, with the
        specified endianness (default little endian, or least significant byte
        first)."""
        result = self._bus.read_word_data(self._address,register) & 0xFFFF
        self._logger.debug("Read 0x%04X from register pair 0x%02X, 0x%02X",
                           result, register, register+1)
        # Swap bytes if using big endian because read_word_data assumes little
        # endian on ARM (little endian) systems.
        if not little_endian:
            result = ((result << 8) & 0xFF00) + (result >> 8)
        return result
def readU16(self, register, little_endian=True):
        """Read an unsigned 16-bit value from the specified register, with the
        specified endianness (default little endian, or least significant byte
        first)."""
        result = self._bus.read_word_data(self._address,register) & 0xFFFF
        self._logger.debug("Read 0x%04X from register pair 0x%02X, 0x%02X",
                           result, register, register+1)
        # Swap bytes if using big endian because read_word_data assumes little
        # endian on ARM (little endian) systems.
        if not little_endian:
            result = ((result << 8) & 0xFF00) + (result >> 8)
        return result
def readU16 ( self , register , little_endian = True ) : result = self . _bus . read_word_data ( self . _address , register ) & 0xFFFF self . _logger . debug ( "Read 0x%04X from register pair 0x%02X, 0x%02X" , result , register , register + 1 ) # Swap bytes if using big endian because read_word_data assumes little # endian on ARM (little endian) systems. if not little_endian : result = ( ( result << 8 ) & 0xFF00 ) + ( result >> 8 ) return result
Read an unsigned 16-bit value from the specified register, with the
        specified endianness (default little endian, or least significant byte
        first).
Read an unsigned 16 - bit value from the specified register with the specified endianness ( default little endian or least significant byte first ) .