Table of Contents

SPI


  • Spi.Write(arrayWrite, indexWrite, writeCount, chipselect) - Write data array to device
    arrayWrite: Array to send
    indexWrite: Index of data in the array (optional)
    writeCount: The number of bytes to write (optional)
    chipselect: Chip select pin (optional)

  • Spi.Read(arrayRead, indexRead, readCount, chipselect) - Read data from device
    arrayRead: Array to read
    indexRead: Index of data in the array (optional)
    readCount: The number of bytes to read (optional)
    chipselect: Chip select pin (optional)

  • Spi.WriteRead(arrayWrite, indexWrite, writeCount, arrayRead, indexRead, readCount, chipselect) - WriteRead data
    arrayWrite: Array to send
    indexWrite: Index of data in the array
    writeCount: The number of bytes to write
    arrayRead: Array to read
    indexRead: Index of data in the array
    readCount: The number of bytes to read
    chipselect: Chip select pin (optional)

arrayWrite = [ 0xAA, 0x55, 0xAA, 0x55 ]
arrayRead = [0] * 4
chipselect = 2

duelink.Spi.Write(arrayWrite)
duelink.Spi.Write(arrayWrite, 0, 2, chipselect)

duelink.Spi.Read(arrayRead)
duelink.Spi.Read(arrayRead, 0, 2, chipselect)

duelink.Spi.WriteRead(arrayWrite, 0, arrayWrite.Length, arrayRead, 0, arrayRead.Length, chipselect)