Datasheet

reading the rest of the frame.
If a standard SDEP message type indicator (0x10, 0x20, 0x40 or 0x80) is encountered, keep reading as normal. There
are two other indicators that should be taken into account, though, which indicate a problem on the nRF51822 SPI
slave side:
0xFE: Slave device not ready (wait a bit and try again)
0xFF: Slave device read overflow indicator (you've read more data than is available)
This means there are six possible response bytes reading the message type indicator (the first byte read after an SDEP
command is sent): 0x10, 0x20, 0x40, 0x80, which indicate a valid message type, or 0xFE, 0xFF which indicate an error
condition.
Sample Transaction
The following image shows a sample SDEP response that is spread over two packets (since the response is > 20 bytes
in size). Notice that the IRQ line stays asserted between the packets since more than one packet was available in the
FIFO on the Bluefruit LE SPI side:
SDEP (Simple Data Exchange Protocol)
The Simple Data Exchange Protocol (SDEP) can be used to send and receive binary messages between two
connected devices using any binary serial bus (USB HID, USB Bulk, SPI, I2C, Wireless, etc.), exchanging data using one
of four distinct message types (Command, Response, Alert and Error messages).
The protocol is designed to be flexible and extensible, with the only requirement being that individual messages are
20 bytes or smaller, and that the first byte of every message is a one byte (U8) identifier that indicates the message
type, which defines the format for the remainder of the payload.
Endianness
All values larger than 8-bits are encoded in little endian format. Any deviation from this rule should be clearly
documented.
Message Type Indicator
The first byte of every message is an 8-bit identifier called the Message Type Indicator. This value indicates the type of
message being sent, and allows us to determine the format for the remainder of the message.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le Page 155 of 211