Reference for Wiring version 0027+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

setDataMode()

Examples
// set data mode to SPI_MODE3 
// (leading edge Setup falling, trailing edge Sample rising)
SPI.setDataMode(SPI_MODE3);
Description The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard named by Motorola that operates in full duplex mode. Devices communicate in a master/slave mode where the master device initiates the data frame. Multiple slave devices are allowed with individual slave select (chip select) lines using a pin for each device. The setDataMode() method sets the SPI communication mode: SPI_MODE0 (leading edge Sample rising, trailing edge Setup falling), SPI_MODE1 (leading edge Setup rising, trailing edge Sample falling), SPI_MODE2 (leading edge Sample falling, trailing edge Setup rising), SPI_MODE3 (leading edge Setup falling, trailing edge Sample rising). SPI_MODE3 is the default data mode for SPI.begin() with no parameters.
Syntax
SPI.setDataMode(dataMode)
Parameters
dataMode constant for the data mode: SPI_MODE0 (leading edge Sample rising, trailing edge Setup falling), SPI_MODE1 (leading edge Setup rising, trailing edge Sample falling), SPI_MODE2 (leading edge Sample falling, trailing edge Setup rising), SPI_MODE3 (leading edge Setup falling, trailing edge Sample rising)
Returns None
Usage Application
Updated on September 16, 2010 10:32:08pm PDT

Creative Commons License