Spidev.fromBusDevNrs constructor

Spidev.fromBusDevNrs(
  1. int busNr,
  2. int devNr
)

Constructs a spidev from it's bus nr and device nr.

Basically a wrapper around fromPath. Device paths of spidevs typically have the form /dev/spidevBUSNUMBER.DEVICENUMBER. The busnumber selects the SCLK, MOSI and MISO pins. The device number selects the CS pin that will be set active at transimission.

Example:

final spidev = Spidev.fromBusDevNrs(0, 0);

Implementation

Spidev.fromBusDevNrs(this.busNr, this.devNr)
    : name = "spidev$busNr.$devNr",
      path = "/dev/spidev$busNr.$devNr";