python - BeagleBone SPI using mmap -
i having trouble configuring bbb spi using python mmap.
rather rolling device tree overlay myself, i've been using adafruit_bbio.spi (a similar approach has been working adafruit_bbio.gpio). works well, , through spidev, can send data. use mmap spi_tx0, bus error.
i can resolve bus error turning on clock domain spi peripheral:
ctrl = struct.unpack('<l', cm_per[cm_per_spi0_clkctrl:cm_per_spi0_clkctrl+4])[0] ctrl &= ~(0b11 << 16 | 0b11) ctrl |= 2 cm_per[cm_per_spi0_clkctrl:cm_per_spi0_clkctrl+4] = struct.pack('<l', ctrl)
but don't understand why necessary; shouldn't adafruit_bbio have turned clock domain on?
more importantly, though, spi0[spi_tx0:spi_tx0+4] = struct.pack('<
l', data) nothing.
Comments
Post a Comment