Transferred from: http://home.eeworld.com.cn/my/space-uid-80086-blogid-119198.html
SPI four mode SPI phase (CPHA) and polarity (Cpol) can be 0 or 1, respectively, the corresponding 4 combinations constitute the SPI 4 modes (mode)
Mode 0 cpol=0, cpha=0
Mode 1 cpol=0, cpha=1
Mode 2 cpol=1, cpha=0
Mode 3 cpol=1, cpha=1
Clock polarity Cpol: That is, SPI idle, the clock signal sclk level (1: Idle high level; 0: Idle low level)
Clock phase Cpha: That is, the SPI begins sampling at the edge of the SCLK (0: The first edge begins; 1: Start of the second edge)
SD card to the SPI commonly used is mode 0 and mode 3, both modes of the same place is the clock rising along the sample transmission data, the simple way to distinguish between the two ways is to see the idle, the clock level state, the low level is mode 0, the high level is mode 3.
Tip: SPI four modes differentiate "turn"