tinygo-org / bluetooth

Cross-platform Bluetooth API for Go and TinyGo. Supports Linux, macOS, Windows, and bare metal using Nordic SoftDevice or HCI
https://tinygo.org
Other
744 stars 137 forks source link

cyw43439: HCI implementation #271

Closed deadprogram closed 4 months ago

deadprogram commented 5 months ago

This PR is work in progress on support for the CYW43439 as used on the Raspberry Pi RP2040-W

To compile:

tinygo build -o test.uf2 -size=short -target=pico -tags=cyw43439 ./examples/scanner

UPDATE: this is now working! Just awaiting some updates to https://github.com/soypat/cyw43439 and it can be completed.

deadprogram commented 5 months ago

This PR is now working once https://github.com/soypat/cyw43439/pull/50 is merged into https://github.com/soypat/cyw43439/pull/47 and that is merged into main.

$ tinygo flash -size=short -target=pico -tags="cyw43439" -monitor -ldflags="-X main.DeviceAddress=48:9E:47:66:90:8B" ./examples/heartrate-monitor/
   code    data     bss |   flash     ram                                                                
 432504   16356    3352 |  448860   19708                                                                                                                                                                          
Connected to /dev/ttyACM0. Press Ctrl-C to exit.                                                         
Enabling CYW43439 device                                                                                 
Enabled CYW43439 device                                                                                  
scanning...                                                                                              
found device: 48:9E:47:66:90:8B -70 Pixel 7a                                                             
connected to  48:9E:47:66:90:8B                                                                                                                                                                                    
discovering services/characteristics
found service 0000180d-0000-1000-8000-00805f9b34fb
found characteristic 00002a37-0000-1000-8000-00805f9b34fb
data: 90
data: 90
data: 90
data: 91
data: 91
data: 92
...
deadprogram commented 4 months ago

The cyw43439 package was updated, so this PR is now ready for review and is working!

deadprogram commented 4 months ago

Added docs. NOW it is ready :smile_cat:

deadprogram commented 4 months ago

Thanks for review @aykevl changes made so now merging.