Datasheet

packets (of up to 20 bytes each).
The SPI commands must be setup to transmit MSB (most significant bit) first (not LSB
first)
IRQ Pin
The IRQ line is asserted by the Bluefruit LE SPI Friend/Shield as long as an entire SDEP
packet is available in the buffer on the nRF51822, at which point you should read the packet,
keeping the CS line asserted for the entire transaction (as detailed above).
The IRQ line will remain asserted as long as one or more packets are available, so the line
may stay high after reading a packet, meaning that more packets are still available in the
FIFO on the SPI slave side.
SDEP Packet and SPI Error Identifier
Once CS has been asserted and the mandatory 100us delay has passed, a single byte
should be read from the SPI bus which will indicate the type of payload available on the
nRF51822 (see Message Type Indicator below for more information on SDEP message
types). Keep CS asserted after this byte has been read in case you need to continue 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:
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le Page 198 of 238