setDataMode() sets the SPI data mode, which defines the clock polarity (CPOL) and clock phase (CPHA). See the Wikipedia article on SPI for details.
This function is part of the SPI library. See the SPI main page for more information.
SPI.setDataMode(mode)SPI.setDataMode(chipSelectPin, mode) (Arduino Due only)mode: the SPI data mode. Allowed values:SPI_MODE0: CPOL = 0, CPHA = 0SPI_MODE1: CPOL = 0, CPHA = 1SPI_MODE2: CPOL = 1, CPHA = 0SPI_MODE3: CPOL = 1, CPHA = 1chipSelectPin: peripheral device chip select pin (Arduino Due only).Nothing.
This function is deprecated and should not be used in new projects. Use SPISettings with SPI.beginTransaction() to configure SPI parameters.