Syntax
void setDataMode(
    uint8_t mode
);
ContentsIndex
PreviousUpNext
SPIClass::setDataMode Method
SPIClass Class | Example
Syntax
void setDataMode(
    uint8_t mode
);
Description

Sets up the SPI data transmission mode.

Parameters
Parameters 
Description 
uint8_t mode 
[IN] The SPI data transmission mode (SPI_MODE0 ~ SPI_MODE3). 
Example
#include <SPI.h>
#define SS_PIN    10

void setup()
{
    pinMode(SS_PIN, OUTPUT);
    SPI.begin(); 
    SPI.setDataMode(SPI_MODE1); 
}
void loop()
{
    byte ret_val;
    digitalWrite(SS_PIN, LOW);
    ret_val = SPI.transfer(100);
    digitalWrite(SS_PIN, HIGH);
    delay(1000);
}
File

SPI.h

Class