Interface SpiBus

SPI总线

Remarks

通过SPI控制器 open() 方法打开并建立,返回SPI总线对象。也可通过SPI控制器的 handle() 方法获取指定控制器上已打开的总线。

Hierarchy

  • SpiBus

Properties

Methods

Properties

dmaMaxTransSize: number

DMA最大传输字节. 0表示未启用DMA

id: SpiId

SPI控制器ID

Methods

  • 在SPI总线上添加一个设备

    Parameters

    • options: {
          baudrate?: number;
          cs?: null | Byte;
          csKeepActive?: boolean;
          mode?: 0 | 2 | 1 | 3;
          writeOnly?: boolean;
      }
      • Optional baudrate?: number
      • Optional cs?: null | Byte

        设备CS引脚

      • Optional csKeepActive?: boolean

        设备CS引脚是否保持一直有效,默认false

      • Optional mode?: 0 | 2 | 1 | 3

        模式 0: CPOL = 0, CPHA = 0 (default); 1: CPOL = 0, CPHA = 1; 2: CPOL = 1, CPHA = 0; 3: CPOL = 1, CPHA = 1

      • Optional writeOnly?: boolean

    Returns SpiDevice