GS2101M IP2WiFi Adapter Command Reference Guide
1VV0301499
Rev. 2.0
37
2019-08-05
3.2.2 SPI Interface and Configuration
For higher throughput application, we make use of SPI interface between MCU and GS
node.
SPI mode is a combination of clock polarity and clock phase with respect to the data. There
are four types of SPI modes:
•
SPI Mode 0
•
SPI Mode 1
•
SPI Mode 2
•
SPI Mode 3
For SPI Mode 0 and SPI Mode 2, the SPI Master should toggle Chip Select (CS) or Slave
Select (SS) for every byte.
For SPI Mode 1 and SPI Mode 3, the SPI Master should not toggle Chip Select (CS) or
Slave Select (SS) for every byte; but should be toggled for every byte stream.
The following command is used to set the SPI clock polarity and clock phase parameters.
The new SPI parameters take effect after node reset/restart. However, they are stored in
RAM and will be lost when power is lost unless they are saved to a profile using AT&W
). The profile used in that command must also be set as the
power-on profile using AT&Y (see
4.3.4 Select Default Profile, page 67
).
Command Syntax
AT+SPICONF=<clockpolarity>,<clockphase>
Parameter Description
describes the SPI Interface Configuration parameters.
Table 16 SPI Interface Configuration Parameters
Parameter
Optional/Mandatory
Value
Description
clockpolarity
Mandatory
0 (default)
Inactive state of serial clock is low.
1
Inactive state of serial clock is high.
clockphase
Mandatory
0 (default)
Data is captured on the first edge of the serial
clock (clock phase zero), after the falling edge
of slave select signal.
1
Data is captured on the second edge of the
serial clock (clock phase 180), after the falling
edge of slave select signal.