4
SPI protocol
By setting to 0 the configuration variable "console_enabled", the module is enabled to use the SPI interface in
place of the UART.
The data transferred over the MISO and MOSI signals are packed using a well-defined API packet format as
represented below.
Figure 4.
SPI packet formats
Table 2.
KindOfEvent Byte SubField
Bits
Event type
Bits 0:3
Status variable wifi_state values range. Refer to
.
Bits 4:7
Allowed values are:
•
0x01 for common indications like WIND or action
confirmations
•
0x02 for critical error notifications
•
0x03 for incoming data sent over the SPI (in this case
normally data are filled into payload field)
Table 3.
Indication number field
Event type Bits 4:7
Indication number
0x01
Refer to
0x02
Refer to
Table 10. AT-S.ERROR:=ERROR ID= =ERROR
.
0x03
Data payload.
Commands over the SPI have a max length of 512 bytes.
To map an AT command in the equivalent SPI command, the following procedure applies:
1.
Use the corresponding CMD ID specified in
th
bytes of the
master packet.
2.
If optional parameters are available, count the number of comma-separated items after the “=” character and
with that number the 6
th
byte of the message. Starting from the 7
th
byte, start to write 1 byte containing the
field lengths and then copy the field bytes. Then continue with the remaining parameters.
UM2114
SPI protocol
UM2114
-
Rev 3
page 8/66