Skip to content

Add HCI support #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 8, 2020
Merged

Add HCI support #103

merged 3 commits into from
Sep 8, 2020

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Aug 30, 2020

Goes with adafruit/circuitpython#3310.

Add code to initialize a Bluetooth HCI adapter. The current pins should work for the on-board adapter on Metro M4 AirLift, PyPortals, and PyBadge AirLift.

[EDITED]

For an onboard adapter using standard pins:

from adafruit_ble import BLERadio
from adafruit_airlift.esp32 import ESP32

esp32 = ESP32()
adapter = esp32.start_bluetooth()
ble = BLERadio(adapter)

For an offboard AirLift breakout, which will use different pins, the kind of code below works:

import board
import busio
from adafruit_ble import BLERadio
from adafruit_airlift.esp32 import ESP32

# Sample offboard pins: could be different.
esp32 = ESP32(
    reset=board.D12,
    gpio0=board.D10,
    busy=board.D11,
    chip_select=board.D13,
)

# Bluetooth needs a UART for communication.
uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=0, receiver _buffer_size=512)
adapter = esp32.start_bluetooth(uart=uart)
ble = BLERadio(adapter)

@dhalbert dhalbert requested a review from tannewt September 4, 2020 19:25
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

@tannewt tannewt merged commit b6ad8c9 into adafruit:master Sep 8, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 11, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90640 to 1.2.0 from 1.1.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#21 from adafruit/fix-pylint
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#18 from fgervais/broken-pixels

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 3.4.0 from 3.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#83 from cjsieh/scard_vs_sdcardio

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 7.3.0 from 7.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#103 from dhalbert/hci

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter#4 from dhalbert/up-to-date-data

Updating https://github.com/adafruit/Adafruit_CircuitPython_framebuf to 1.4.1 from 1.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#35 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#34 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#33 from jsharper/fix/jsharper/image-rotate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants