Dialog Semiconductor customer support - DA1468x USB attach charger https://support.dialog-semiconductor.com/resource-keywords/da1468x-usb-attach-charger en Detecting USB connection and charger events https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/detecting-usb-connection-and-charger

Hi,

Wondering how to detect when the user plugs in a USB cable, or when the battery charger starts or stops charging? I haven't seen this in the documentation yet, but it appears Dialog has provided us with a rich set of callbacks in sdk/cpm/sys_charger.c that applications can implement to handle USB and charger lifecycle events. For example:

usb_attach_cb(): Called when the user connects a USB cable (looks for a transition in the voltage on VBUS, I believe)
usb_detach_cb(): Called when the user removes the USB cable
usb_charging()
usb_charged()
usb_charger_battery_full()
...

Hope this helps others looking to adjust their applications' behavior on USB connection events and as the charger transitions states.

David

Device: 
Mon, 27 Mar 2017 17:16:31 +0000 david_33021 6479 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/detecting-usb-connection-and-charger#comments