How to use the pfio.send function in pfio

To help you get started, we’ve selected a few pfio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thomasmacpherson / piface / python / piface / spivisualiser.py View on Github external
# check we are three bytes long
            if len(hex(spi_message)[2:]) > 6:
                raise ValueError()

        except ValueError:
            msg = "Invalid SPI message"
            self.error_text = msg
            print msg
            return


        cmd  = (spi_message >> 16) & 0xff
        port = (spi_message >> 8) & 0xff
        data = (spi_message) & 0xff
        pfio.send([(cmd, port, data)], True)