BluefruitConfig.h
 1  // SPDX-FileCopyrightText: 2018 Limor Fried for Adafruit Industries
 2  //
 3  // SPDX-License-Identifier: MIT
 4  
 5  // COMMON SETTINGS
 6  // ----------------------------------------------------------------------------------------------
 7  // These settings are used in both SW UART, HW UART and SPI mode
 8  // ----------------------------------------------------------------------------------------------
 9  #define BUFSIZE                        128   // Size of the read buffer for incoming data
10  #define VERBOSE_MODE                   true  // If set to 'true' enables debug output
11  #define BLE_READPACKET_TIMEOUT         500   // Timeout in ms waiting to read a response
12  
13  
14  // SOFTWARE UART SETTINGS
15  // ----------------------------------------------------------------------------------------------
16  // The following macros declare the pins that will be used for 'SW' serial.
17  // You should use this option if you are connecting the UART Friend to an UNO
18  // ----------------------------------------------------------------------------------------------
19  #define BLUEFRUIT_SWUART_RXD_PIN       9    // Required for software serial!
20  #define BLUEFRUIT_SWUART_TXD_PIN       10   // Required for software serial!
21  #define BLUEFRUIT_UART_CTS_PIN         11   // Required for software serial!
22  #define BLUEFRUIT_UART_RTS_PIN         -1   // Optional, set to -1 if unused
23  
24  
25  // HARDWARE UART SETTINGS
26  // ----------------------------------------------------------------------------------------------
27  // The following macros declare the HW serial port you are using. Uncomment
28  // this line if you are connecting the BLE to Leonardo/Micro or Flora
29  // ----------------------------------------------------------------------------------------------
30  #ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
31    #define BLUEFRUIT_HWSERIAL_NAME      Serial1
32  #endif
33  
34  
35  // SHARED UART SETTINGS
36  // ----------------------------------------------------------------------------------------------
37  // The following sets the optional Mode pin, its recommended but not required
38  // ----------------------------------------------------------------------------------------------
39  #define BLUEFRUIT_UART_MODE_PIN        12    // Set to -1 if unused
40  
41  
42  // SHARED SPI SETTINGS
43  // ----------------------------------------------------------------------------------------------
44  // The following macros declare the pins to use for HW and SW SPI communication.
45  // SCK, MISO and MOSI should be connected to the HW SPI pins on the Uno when
46  // using HW SPI.  This should be used with nRF51822 based Bluefruit LE modules
47  // that use SPI (Bluefruit LE SPI Friend).
48  // ----------------------------------------------------------------------------------------------
49  #define BLUEFRUIT_SPI_CS               8
50  #define BLUEFRUIT_SPI_IRQ              7
51  #define BLUEFRUIT_SPI_RST              4    // Optional but recommended, set to -1 if unused
52  
53  // SOFTWARE SPI SETTINGS
54  // ----------------------------------------------------------------------------------------------
55  // The following macros declare the pins to use for SW SPI communication.
56  // This should be used with nRF51822 based Bluefruit LE modules that use SPI
57  // (Bluefruit LE SPI Friend).
58  // ----------------------------------------------------------------------------------------------
59  #define BLUEFRUIT_SPI_SCK              13
60  #define BLUEFRUIT_SPI_MISO             12
61  #define BLUEFRUIT_SPI_MOSI             11