Bluetooth UART support for the Adafruit BluefruitLE SPI, for the University of York Engineering Stage 1 project

Committer:
ajp109
Date:
Sat Feb 06 20:58:22 2021 +0000
Revision:
0:a80552d32b80
Initial commit (not working)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ajp109 0:a80552d32b80 1 This library is for all nRF51 based Adafruit Bluefruit LE modules that use SPI or UART.
ajp109 0:a80552d32b80 2
ajp109 0:a80552d32b80 3 Current nRF51 based Bluefruit LE products include:
ajp109 0:a80552d32b80 4
ajp109 0:a80552d32b80 5 * [Bluefruit LE Friend](https://www.adafruit.com/product/2267)
ajp109 0:a80552d32b80 6 * [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479)
ajp109 0:a80552d32b80 7 * [Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)
ajp109 0:a80552d32b80 8 * [Bluefruit LE Shield](https://www.adafruit.com/products/2746)
ajp109 0:a80552d32b80 9 * [Bluefruit LE Micro](https://www.adafruit.com/product/2661)
ajp109 0:a80552d32b80 10 * [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829)
ajp109 0:a80552d32b80 11 * [Feather M0 Bluefruit LE](https://www.adafruit.com/products/2995)
ajp109 0:a80552d32b80 12
ajp109 0:a80552d32b80 13 # AT Commands
ajp109 0:a80552d32b80 14
ajp109 0:a80552d32b80 15 The Bluefruit LE modules this library talks to use AT-style commands and responses.
ajp109 0:a80552d32b80 16
ajp109 0:a80552d32b80 17 If you are using a UART board, the commands are sent directly as text using a SW serial transport.
ajp109 0:a80552d32b80 18
ajp109 0:a80552d32b80 19 If your are using an SPI board, the AT commands are wrapped in a thin **[SDEP](SDEP.md)** (Simple Data Exchange Protocol) wrapper to transmit and received text data over the binary SPI transport. Details of this SPI transport layer are detailed in [SDEP.md](SDEP.md) in this same folder.
ajp109 0:a80552d32b80 20
ajp109 0:a80552d32b80 21 # Hardware Setup
ajp109 0:a80552d32b80 22
ajp109 0:a80552d32b80 23 There are two variants of the nRF51 Bluefruit LE modules. One uses SPI to communicate, the other uses UART with flow control (TXD, RXD, CTS, RTS). The wiring you use will depend on the module you are trying to connect.
ajp109 0:a80552d32b80 24
ajp109 0:a80552d32b80 25 On both boards, power should be connected as shown below:
ajp109 0:a80552d32b80 26
ajp109 0:a80552d32b80 27 Bluefruit LE | Arduino Uno
ajp109 0:a80552d32b80 28 -------------|------------
ajp109 0:a80552d32b80 29 VIN | 5V (assuming a 5V board)
ajp109 0:a80552d32b80 30 GND | GND
ajp109 0:a80552d32b80 31
ajp109 0:a80552d32b80 32 ## Software UART Pinout
ajp109 0:a80552d32b80 33
ajp109 0:a80552d32b80 34 If you are using a UART Bluefruit LE board, your Arduino should be connected to the Bluefruit LE UART module using the following pinout:
ajp109 0:a80552d32b80 35
ajp109 0:a80552d32b80 36 Bluefruit LE UART | Arduino Uno
ajp109 0:a80552d32b80 37 ------------------|------------
ajp109 0:a80552d32b80 38 RTS | 8
ajp109 0:a80552d32b80 39 RXI | 9
ajp109 0:a80552d32b80 40 TXO | 10
ajp109 0:a80552d32b80 41 CTS | 11
ajp109 0:a80552d32b80 42
ajp109 0:a80552d32b80 43 Optional Pins
ajp109 0:a80552d32b80 44
ajp109 0:a80552d32b80 45 Bluefruit LE UART | Arduino Uno
ajp109 0:a80552d32b80 46 ------------------|------------
ajp109 0:a80552d32b80 47 MODE | 12
ajp109 0:a80552d32b80 48
ajp109 0:a80552d32b80 49 ## SPI Pinout
ajp109 0:a80552d32b80 50
ajp109 0:a80552d32b80 51 If you are using an SPI Bluefruit LE board, your Arduino should be connected to the Bluefruit LE SPI module using the following pinout:
ajp109 0:a80552d32b80 52
ajp109 0:a80552d32b80 53 Bluefruit LE SPI | Arduino Uno
ajp109 0:a80552d32b80 54 -----------------|------------
ajp109 0:a80552d32b80 55 SCLK | 13
ajp109 0:a80552d32b80 56 MISO | 12
ajp109 0:a80552d32b80 57 MOSI | 11
ajp109 0:a80552d32b80 58 CS | 8
ajp109 0:a80552d32b80 59 IRQ | 7
ajp109 0:a80552d32b80 60
ajp109 0:a80552d32b80 61 Optional Pins (enable these in the sample sketches)
ajp109 0:a80552d32b80 62
ajp109 0:a80552d32b80 63 Bluefruit LE SPI | Arduino Uno
ajp109 0:a80552d32b80 64 -----------------|------------
ajp109 0:a80552d32b80 65 RESET | 6