Drivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout

Overview

Adafruit_nRF8001

Driver and example code for Adafruit's nRF8001 Bluetooth Low Energy Breakout.

PINOUT

The pin locations are defined in ble_system.h, the supported systems are defined in hal_aci_tl.cpp. The following pinout is used by default for the Arduino Uno:

  • SCK -> Pin 13
  • MISO -> Pin 12
  • MOSI -> Pin 11
  • REQ -> Pin 10
  • RDY -> Pin 2 (HW interrupt)
  • ACT -> Not connected
  • RST -> Pin 9
  • 3V0 - > Not connected
  • GND -> GND
  • VIN -> 5V

RDY must be on pin 2 since this pin requires a HW interrupt.

3V0 is an optional pin that exposes the output of the on-board 3.3V regulator. You can use this to supply 3.3V to other peripherals, but normally it will be left unconnected.

ACT is not currently used in any of the existing examples, and can be left unconnected if necessary.

Examples

The following examples are included for the Adafruit nRF8001 Breakout

UART

This example creates a UART-style bridge between the Arduino and any BLE capable device.

You can send and receive up to 20 bytes at a time between your BLE-enabled phone or tablet and the Arduino.

Any data sent to the Arduino will be displayed in the Serial Monitor output, and echo'ed back to the phone or tablet on the mobile device's RX channel.

This demo creates a custom UART service, with one characteristic for TX and one for RX using the following UUIDs:

  • 6E400001-B5A3-F393-E0A9-E50E24DCCA9E for the Service
  • 6E400002-B5A3-F393-E0A9-E50E24DCCA9E for the TX Characteristic (Property = Notify)
  • 6E400003-B5A3-F393-E0A9-E50E24DCCA9E for the RX Characteristic (Property = Write without response)

You can test the UART service with the free nRF UART apps from Nordic Semiconductors, available for both iOS and Android:

Issues
  • Fixes for 32 bit ARM compatibility

    Fixes for 32 bit ARM compatibility

    These changes fix problems on 32 bit ARM. I tested with Teensy 3.1, Arduino Uno, and Teensy 2.0. One customer also verified it works. :-)

    The packed attribute is needed on all the event structs. The library collects incoming bytes into a buffer, then casts a pointer to the buffer to these structs. On 8 bit AVR, all structs are automatically packed, so this has no effect on AVR. On 32 bit platforms, the compiler defaults to aligning 16 and 32 bit data types to 2 and 4 byte boundaries. The packed attribute is needed to make the code work the same as AVR.

    The other minor change is 2 delays added. They're only compiled for ARM chips. I didn't want to take any chance of altering how the library works on AVR.

    opened by PaulStoffregen 4
  • when ever i try to upload or verify the file i keep getting this

    when ever i try to upload or verify the file i keep getting this

    home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘void hal_aci_tl_init()’: /home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:323:9: error: ‘class SPIClass’ has no member named ‘usingInterrupt’ SPI.usingInterrupt(HAL_IO_RADIO_IRQ); // add checking for spi conflicts ^ /home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘hal_aci_data_t* hal_aci_tl_poll_get()’: /home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:7: error: ‘class SPIClass’ has no member named ‘beginTransaction’ SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus ^ /home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:64: error: ‘SPISettings’ was not declared in this scope SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus ^ /home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:407:7: error: ‘class SPIClass’ has no member named ‘endTransaction’ SPI.endTransaction(); // release the SPI bus ^

    opened by disappear123df 2
  • Multiple BTLEserial.write() inside an Arduino Loop

    Multiple BTLEserial.write() inside an Arduino Loop

    Hi everyone, i'm having a problem using multiple write() inside a loop void with Arduino Mega. I need to send data over BLE to external devices and the limit of 20 char is a problem for my project. To avoid this i thought to split my data in multiple messages and sending them inside the same loop but after 5-6 loop the write doesn't work anymore. Can you help me? Thanks in advance!

    opened by simar88 2
  • Added more print() functions for Strings, Integers and FlashStringHelpers

    Added more print() functions for Strings, Integers and FlashStringHelpers

    Hello, I added new functions into the library to make it more like the Serial library of Arduino. I added print() functions for Integers, Strings and FlashStringHelper. Please review the changes, thanks. I tested it with my Adafruit BLE breakout board and it works well.

    opened by marcoschwartz 2
  • Use size_t for write & print return, for non-AVR compatibility

    Use size_t for write & print return, for non-AVR compatibility

    Arduino's Print.h uses "size_t" as the return type for print(), println() and write().

    On AVR, uint16_t and size_t are the same. But on 32 bit platforms, size_t is 32 bits, which causes a compile error because the return types to not match Arduino's Print base class.

    As a double check, I compiled this copy and the original for Arduino Uno. The HEX files match exactly.

    opened by PaulStoffregen 2
  • Multiple connection not available when module advertising!

    Multiple connection not available when module advertising!

    I use Adafruit Bluefruit LE SPI Friend module in my device, when I create my custom services and characteristics and then advertising the services. During advertising the services I want to connect via some mobile devices (iOS and Android). but when one device find the service and connect to module (when blue led on module turn on), others cannot find module. Is it possible to connect to module via more than one devices?

    opened by Parsakarami 1
  • Having SPIClass' has no member named 'endTransaction' problem

    Having SPIClass' has no member named 'endTransaction' problem

    I only got one code file in my library

    screen shot 2015-05-05 at 11 38 50 pm

      This report would have more information with
      "Show verbose output during compilation"
      enabled in File > Preferences.
    Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'void hal_aci_tl_init()':
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:317: error: 'class SPIClass' has no member named 'usingInterrupt'
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'hal_aci_data_t* hal_aci_tl_poll_get()':
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'class SPIClass' has no member named 'beginTransaction'
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'SPISettings' was not declared in this scope
    /Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:401: error: 'class SPIClass' has no member named 'endTransaction'
    
    opened by wizztjh 1
  • Updated Spi implementation to use conflict free

    Updated Spi implementation to use conflict free "SpiSettings" bus configuration

    Spi implementation has been updated to eliminate Spi conflicts by using the recent "SPISettings" implementation of the Arduino SPi library. Library now plays nice with other SPI Arduino libraries that use this method and is processor clock speed independent as well. (Spi speed for nRF ic is now always 2 mhz )

    opened by Teslafly 1
  • A stray `break` in write(uint8_t * buffer, uint8_t len) prevents any data from sending.

    A stray `break` in write(uint8_t * buffer, uint8_t len) prevents any data from sending.

    This break on this line in write(uint8_t * buffer, uint8_t len): https://github.com/adafruit/Adafruit_nRF8001/blob/master/Adafruit_BLE_UART.cpp#L211

    It seems to break out of the while loop when it shouldn't, preventing any data from sending.

    if(!lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX))
    {
      pollACI();
      break; // Breaks universe
    }
    

    The implementation of the single byte write(uint8_t buffer) method has no such short circuit and seems to work just fine.

    After removing the offending break from the library, my data is actually coming through to my iPhone.

    I'm no expert on the libraries used here, but it seems this line should be removed. Whatever it's supposed to be guarding against doesn't seem to be working as intended.

    opened by AlexJWayne 1
  • Fix issue with setDeviceName() not copying null terminator of string.

    Fix issue with setDeviceName() not copying null terminator of string.

    This meant if a longer device name was previously set, then a shorter one, the end of the previous device name would still be visible. Copying 1 byte more than "strlen()" ensures the null terminator is in place, fixing the issue.

    opened by berry120 0
  • Add support for Atmega644P when used with Bobuino pinout of MightyCore.

    Add support for Atmega644P when used with Bobuino pinout of MightyCore.

    This is just a single file change to add support for the Atmega644p.
    It only modifies hal_acl_tl.cpp for users with either of these defined:

    defined(AVR_ATmega644P) || defined(AVR_ATmega644)

    So the scope is pretty small. I've only tested this on the pin 6 INT2 version for my board using MightyCore's:

    Board: Atmega644 Variant: 644P/644PA Pinout: Bobuino

    I can confirm that it works.
    Pin 2 INT0 and Pin 3 INT1 are just based on the data sheet, and should also work, but I have not tested them directly.

    opened by kurt-schaefer 0
  • Properly override Stream multi-byte write() method

    Properly override Stream multi-byte write() method

    Previously, the write() method for uint8_t buffers didn't quite have the right signature to override the method in the Stream class, which made it impossible to call from a Stream pointer.

    Also, C++11 override keywords were added to make overriding Stream methods more explicit and compiler-checked.

    One possible complication that may arise is that in order to accept a const uint8_t* argument, write() must cast it to uint8_t* to pass it to the aci library, which may modify the buffer as unexpected by the new const method signature.

    opened by alexozer 0
  • Add timeout option to write().

    Add timeout option to write().

    This change borrows from the Adafruit_PN532 library to add a timeout to the write() call. If the timeout is activated, the write() call still returns the actual number of bytes sent. The default is no timeout to ensure compatibility with existing code.

    opened by ckthorp 0
  • Adds disconnect function.

    Adds disconnect function.

    I exposed the disconnect function to the API because I encountered a use case where I want the peripheral to terminate from the central.

    There was some white-space clean up too.

    opened by jbdatko 0
Releases(1.1.1)
Owner
Adafruit Industries
Adafruit Industries
Bluetooth low energy (BLE) tracker for ESP32

BLEcker Bluetooth low energy (BLE) tracker for ESP32 This software is written for ESP32 boards to track BLE devices. It can be used for your smart hom

Vörös Ákos 39 Jun 23, 2022
A static analysis tool that helps security researchers scan a list of Windows kernel drivers for common vulnerability patterns in drivers (CVE makers!)

Driver Analyzer A static analysis tool that helps security researchers scan a list of Windows kernel drivers for common vulnerability patterns in driv

BehroozAbbassi 41 Jun 13, 2022
Exploits the Wii U's bluetooth stack to gain IOSU kernel access via bluetooth.

BluuBomb Exploits the Wii U's bluetooth stack to gain IOSU kernel access via bluetooth. For a more detailed write-up see WRITEUP.md. Not to be confuse

null 92 Jun 24, 2022
Bluetooth Joystick : A wireless joystick with ESP-32 microcontroller and Dual Axis Joystick Module using the Bluetooth connectivity.

BluetoothJoystick Bluetooth Joystick : A wireless joystick with ESP-32 microcontroller and Dual Axis Joystick Module using the Bluetooth connectivity.

null 9 Feb 24, 2022
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

null 18 Jan 17, 2022
Breakout detection for Ruby

Breakout ?? BreakoutDetection for Ruby Learn how it works Installation Add this line to your application’s Gemfile: gem 'breakout-detection' Getting S

Andrew Kane 31 Feb 4, 2022
Pure C Arcade game. Cross between pong and breakout, made it by accident

LameBall I accidentally made this game while testing some code. It's kind of a cross between Pong and Breakout, mixed with Squash/Racquetball. >> DOWN

Phil Bagshaw 2 Sep 17, 2021
Control Heidelberg Wallbox Energy Control over WiFi using ESP8266 and configure your own local load management

< scroll down for English version and additional information > wbec WLAN-Anbindung der Heidelberg WallBox Energy Control über ESP8266 Die Heidelberg W

null 69 Jun 21, 2022
Perimeter is a real-time strategy video game with unique gameplay elements such as terraforming deformable terrain, morphing units, energy network, protective shield and surreal worlds.

Периметр | Perimeter About Perimeter is a real-time strategy video game with unique gameplay elements such as terraforming deformable terrain, morphin

null 386 Jun 24, 2022
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.

Legion-LLRI Legion-LLRI, or “Legion Low Level Rendering Interface” is a rendering API that aims to provide a graphics API agnostic approach to graphic

Rythe Interactive 25 Mar 8, 2022
CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf

esp-idf-cc2500 CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf. I ported from this. 2.00mm pitch External Antena 1.27mm pitch PCB

null 3 May 29, 2022
Intel Wi-Fi Drivers for macOS

An Intel Wi-Fi Adapter Kernel Extension for macOS, based on the OpenBSD Project.

OpenIntelWireless 5.5k Jun 24, 2022
A framework for implementing block device drivers in user space

BDUS is a Linux 4.0+ framework for developing block devices in user space. More specifically, it enables you to implement block device drivers as regu

Alberto Faria 26 May 24, 2022
J2534 drivers for various Macchina hardware

Macchina-J2534 J2534 drivers for various Macchina hardware This is a experimental driver which is built in Rust, and is unofficially ported to Linux a

Ashcon Mohseninia 31 Jun 25, 2022
Synology DSM 7 USB serial drivers

Missing USB serial drivers for DSM 7 Supported drivers cp210x ch341 Supported platforms apollolake (linux-4.4.x) armada38x (linux-3.10.x-bsp) armadaxp

Robert Klep 81 Jun 16, 2022
Open Redragon drivers for Linux. Currently only supporting some mice.

OpenDragon Open Redragon drivers for Linux. Currently only supporting some mice. Table of contents Support Installation Building from source Usage Sou

Alexa Ognjanovic 70 May 19, 2022
An AutoHotkey library that enables AHK to send keystrokes by drivers.

An AutoHotkey library that enables AHK to send keystrokes by drivers.

null 37 Jun 25, 2022
Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.

Espressif Systems 1.2k Jun 29, 2022
fortnite cheat external that uses efi drivers and is updated

fortnite-external-efi-drivers fortnite cheat external that uses efi drivers and is updated ALL CREDITS TO CHASE: https://github.com/Chase1803 i just u

null 11 Jun 5, 2022
Generic force-feedback vibrator HAL for upstream haptics drivers

vibrator-ff, a generic vibrator HAL for force feedback haptics. Most downstream haptics / vibrator drivers are implemented as LED class devices, this

AOSP Mainline 4 Feb 2, 2022
BSOD: Binary-only Scalable fuzzing Of device Drivers

bsod-kernel-fuzzing This repository contains the implementations described in "BSOD: Binary-only Scalable fuzzing Of device Drivers". The paper and th

Fabian Toepfer 128 May 24, 2022
Full Firmware Package for the STM32WB series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects

STM32Cube is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.

STMicroelectronics 120 Jun 30, 2022
Free and Open Source API and drivers for immersive technology.

OpenHMD This project aims to provide a Free and Open Source API and drivers for immersive technology, such as head mounted displays with built in head

null 1.1k Jun 22, 2022
Aims to be an accurate C port of Impulse Tracker 2.15's IT replayer (with selectable IT2 sound drivers)

it2play Aims to be an accurate C port of Impulse Tracker 2.15's IT replayer (with selectable IT2 sound drivers). This is a direct port of the original

Olav Sørensen 17 May 21, 2022
GraphicsFuzz provides tools for automatically finding and simplifying bugs in graphics drivers, specifically graphics shader compilers.

GraphicsFuzz GraphicsFuzz is a set of tools for testing shader compilers GraphicsFuzz provides tools for automatically finding and simplifying bugs in

Google 499 Jun 22, 2022
Collection of additional Ethernet drivers for ESP-IDF

Collection of additional Ethernet drivers for ESP-IDF This repository aims to store additional Ethernet drivers which are not available directly in ES

Espressif Systems 3 May 9, 2022
Dongle to connect a bluetooth PS3 controller to the Gamecube 🎮

GamecubeBT An arduino based bridge to connect a bluetooth PS3 controller to the Gamecube. Homemade Wavebirds, because the TV is too far from the couch

Jeannot 18 Jun 18, 2022
Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.

TF4Micro Motion Kit This repo contains the Arduino Sketch and a Web Bluetooth API for loading models and running inference on the device. Install and

Google Creative Lab 46 Jun 24, 2022
The littlest Bluetooth macro pad

The littlest wireless macro pad! AWWWWW!!! (c) 2021 Zack Freedman and Voidstar Lab. Licensed CC-BY-NC (credit me and don't sell it) Built partially on

Zack Freedman 11 Feb 26, 2022