SPI

Reads and writes the SPI bus (as Controller).

Reads and writes the SPI bus (as Controller).

Constants

Initialization and termination

The procedure for using the SPI bus depends on the begin() method.

Reads and writes the SPI bus (MASTER).

begin()

void begin(uint8_t slave_select, SPISettings settings)
SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)

Initialize hardware.

This process is also required after sleep recovery.

Example

void setup() {
  ...
  SPI.begin(0, SPISettings(2000000, SPI_CONF::MSBFIRST, SPI_CONF::SPI_MODE3));
  ...
}

void wakeip() {
  ...
  SPI.begin(0, SPISettings(2000000, SPI_CONF::MSBFIRST, SPI_CONF::SPI_MODE3));
  ...
}

end()

void end()

Terminate the use of SPI hardware.

Reading and Writing

There are two types of read/write procedures. Select and use one of them.

最終更新