]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/generic_linux/spi.py
Merge pull request #146 from paulcrawford/master
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / generic_linux / spi.py
index 9ef05fc14d4cc089cc68663a4e8e7070c3837d77..71f74c8b931577efb655c8ef42efd1f54ce5093b 100755 (executable)
@@ -35,7 +35,8 @@ class SPI:
     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:
+        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:
@@ -52,7 +53,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!")