SPI
Reads and writes the SPI bus (as Controller).
Reads and writes the SPI bus (as Controller).
Constants
Constant | Meaning |
---|---|
| MSB as the first bit |
| make LSB the first bit |
| set SPI MODE 0 |
| set to SPI MODE 1 |
| set to SPI MODE 2 |
| set to SPI MODE 3 |
Initialization and termination
The procedure for using the SPI bus depends on the begin()
method.
Reads and writes the SPI bus (MASTER).
begin()
Initialize hardware.
This process is also required after sleep recovery.
Parameters | Description |
---|---|
| Specify the SPI slave select pin to be used. |
| Specifies the SPI bus setting.
The |
Example
end()
Terminate the use of SPI hardware.
Reading and Writing
There are two types of read/write procedures. Select and use one of them.
Member function version (input/output using the following member functions)
beginTransaction(), endTransaction(), transfer(), transfer16(), transfer32()
Helper class version (stream function available)
transceiver
最終更新