SPI.openAdvanced constructor

SPI.openAdvanced(
  1. int bus,
  2. int chip,
  3. SPImode mode,
  4. int maxSpeed,
  5. BitOrder bitOrder,
  6. int bitsPerWord,
  7. int extraFlags,
)

Opens the SPI device at the specified path ("/dev/spidevbus.chip"), with the specified SPI mode, maxSpeed in hertz, bitOrder, bitsPerWord, and extraFlags.

SPI mode can be 0, 1, 2, or 3. bitOrder can be BitOrder.msbFirst or BitOrder.msbLast, bitsPerWord specifies the transfer word size. extraFlags specified additional flags bitwise-ORed with the SPI mode.

Implementation

SPI.openAdvanced(this.bus, this.chip, this.mode, this.maxSpeed, this.bitOrder,
    this.bitsPerWord, this.extraFlags)
    : path = '/dev/spidev$bus.$chip' {
  _checkSPI(bus, chip);
  _spiHandle = _spiOpenAdvanced(
      path, mode, maxSpeed, bitOrder, bitsPerWord, extraFlags);
}