X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/6c1002e28a9740f16f028c64a9b080084fa6662e..102ba2251d6aa8f40d1475f1767b176b44cc745c:/src/adafruit_blinka/microcontroller/generic_linux/spi.py diff --git a/src/adafruit_blinka/microcontroller/generic_linux/spi.py b/src/adafruit_blinka/microcontroller/generic_linux/spi.py index 585bacc..f2ffa82 100755 --- a/src/adafruit_blinka/microcontroller/generic_linux/spi.py +++ b/src/adafruit_blinka/microcontroller/generic_linux/spi.py @@ -33,14 +33,12 @@ class SPI: self.chip = detector.chip def set_no_cs(self): - # Linux SPI driver for AM33XX chip in BeagleBone and PocketBeagle - # does not support setting SPI_NO_CS mode bit (issue #104) - if not self.chip.AM33XX and not self.chip.IMX8MX and not self.chip.SAMA5 \ - and not self.chip.APQ8016: - try: - self._spi.no_cs = True # this doesn't work but try anyways - except AttributeError: - pass + # No kernel seems to support this, so we're just going to pass + pass + + @property + def frequency(self): + return self.baudrate def write(self, buf, start=0, end=None): if not buf: @@ -53,7 +51,7 @@ class SPI: self._spi.max_speed_hz = self.baudrate self._spi.mode = self.mode self._spi.bits_per_word = self.bits - self._spi.writebytes([x for x in buf[start:end]]) + self._spi.writebytes2(buf[start:end]) self._spi.close() except FileNotFoundError as not_found: print("Could not open SPI device - check if SPI is enabled in kernel!")