def _get_extra_flags(self):
        # Get mode
        buf = array.array('B', [0])
        try:
            fcntl.ioctl(self._fd, SPI._SPI_IOC_RD_MODE, buf, True)
        except __HOLE__ as e:
            raise SPIError(e.errno, "Getting SPI mode: " + e.strerror)

        return buf[0] & ~(SPI._SPI_LSB_FIRST | SPI._SPI_CPHA | SPI._SPI_CPOL)
dataset/ETHPy150Open vsergeev/python-periphery/periphery/spi.py/SPI._get_extra_flags