setDataMode()

描述

設定 SPI Data 的模式:clock 極性及相位設定。詳見 Wikipedia article on SPI

語法


SPI.setDataMode(mode)

參數

mode: SPI_MODE0, SPI_MODE1, SPI_MODE2, or SPI_MODE3.

mode Clock Polarity (CPOL) Clock Phase (CPHA)
SPI_MODE0 0 0
SPI_MODE1 0 1
SPI_MODE2 1 0
SPI_MODE3 1 1

回傳

See also

setBitOrder()
setClockDivider()


函式庫參考主頁面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.