I have a nRF52840 based product prototype which includes a power management integrated chip (PMIC) and a Li-Po battery.
The product recharges via a USB connector. The USB data lines from this connector are connected to both the PMIC and the nRF52840.
If the product is plugged into a dedicated USB charger, the PMIC will detect the short-circuit between the USB data lines and will start fast-charging the LiPo battery at 500mA.
If the product is plugged into a PC's USB port, the PMIC will detect this and will default to start charging the Li-Po battery at 100mA.
However, this 100mA charge rate should then be overridden (to 500mA) by a command from the nRF52840 to the PMIC if the nRF52840 does USB enumeration with the PC and successfully negotiates with the PC that the nRF52840 is a "bus powered" device that needs 500mA.
My question is how exactly do I go about programming the nRF52840 to USB-enumerate with a PC, and then negotiate this "bus powered" status.
Thank you.