alexmoon / nrf-sdc

Rust bindings for the nRF SoftDevice Controller
8 stars 5 forks source link

SoftwareVBusDetect for USB peripheral #36

Open pperanich opened 2 days ago

pperanich commented 2 days ago

Hi, I am starting to use trouble with a custom device that uses an nrf52840, and would like to have the ability to support both BLE and USB comms. Currently, the main blocker is that both nrf-sdc and embassy-nrf usb vbus both require binding the POWER_CLOCK. There is a SoftwareVbusDetect implementation available that has previously shown working with nrf-softdevice at https://github.com/embassy-rs/nrf-softdevice/issues/194#issuecomment-1744893871. Would it be feasible to do something similar in nrf-sdc, and expose a SoftwareVbusDetect static that the library manges? See also https://github.com/embassy-rs/embassy/pull/810

alexmoon commented 20 hours ago

You can bind the POWER_CLOCK interrupt to multiple handlers using the bind_interrupts! macro. There's no need for SoftwareVbusDetect for the softdevice controller.