Skip to content

Conversation

dhalbert
Copy link
Collaborator

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. That is, all you need is:

ble = BLERadio()

For an offboard AirLift breakout, the kind of code below works for now. We can think about changing this API to pass the pins to BLERadio(). I haven't thought about this API in detail yet.

import _bleio
import board

hci.esp32_hci_init(
    esp_reset=board.D12,
    esp_gpio0=board.D10,
    esp_busy=board.D11,
    esp_cs=board.D13,
    esp_tx=board.TX,
    esp_rx=board.RX,
    debug=True)

# Must use initialized adapter explicitly.
ble = BLERadio(_bleio.adapter)

@dhalbert dhalbert requested a review from tannewt August 21, 2020 15:32
@dhalbert
Copy link
Collaborator Author

Closing to replace with updated PR.

@dhalbert dhalbert closed this Aug 30, 2020
@dhalbert dhalbert deleted the hci-support branch August 30, 2020 19:17
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