Пример #1
0
    def write(self, dataToSend):
        """Write data to the slave device.  Blocks until there is space in the
        output FIFO.

        If not running in output only mode, also saves the data received
        on the MISO input during the transfer into the receive FIFO.

        :param dataToSend: Data to send (bytes)
        """
        hal.spiWrite(self.port, dataToSend)
Пример #2
0
    def write(self, dataToSend):
        """Write data to the slave device.  Blocks until there is space in the
        output FIFO.

        If not running in output only mode, also saves the data received
        on the MISO input during the transfer into the receive FIFO.

        :param dataToSend: Data to send
        :type dataToSend: iterable of bytes
        
        :returns: Number of bytes written
        
        Usage::
        
            # send byte string
            writeCount = spi.write(b'stuff')
            
            # send list of integers
            writeCount = spi.write([0x01, 0x02])
        """
        return hal.spiWrite(self.port, dataToSend)
Пример #3
0
    def write(self, dataToSend):
        """Write data to the slave device.  Blocks until there is space in the
        output FIFO.

        If not running in output only mode, also saves the data received
        on the MISO input during the transfer into the receive FIFO.

        :param dataToSend: Data to send
        :type dataToSend: iterable of bytes
        
        :returns: Number of bytes written
        
        Usage::
        
            # send byte string
            writeCount = spi.write(b'stuff')
            
            # send list of integers
            writeCount = spi.write([0x01, 0x02])
        """
        return hal.spiWrite(self.port, dataToSend)