1 of 1 people found this helpful
You can detect the USB connection from the VBUS detection. It is possible to disable the USB lock using firmware. CySysClkImoDisableUsbLock() disables USB lock.
Just went and read the function description. It sounds like that function modifies the IMO clock trimming, is that right? I need to swap between IMO and PLL1 for the HFCLk, luckily though I scrolled down just a little bit after reading that function you suggested and found another function that I think does what I want to do:
void CySysClkWriteHfclkDirect(uint32 clkSelect)
* Selects the direct source for the HFCLK.
* \param clkSelect One of the available HFCLK direct sources.
* CY_SYS_CLK_HFCLK_IMO IMO.
* CY_SYS_CLK_HFCLK_EXTCLK External clock pin.
* CY_SYS_CLK_HFCLK_ECO External crystal oscillator. Applicable for
* PSoC 4100 BLE / PSoC 4200 BLE / PSoC 4200L.
* CY_SYS_CLK_HFCLK_PLL0 PLL#0. Applicable for PSoC 4200L.
* CY_SYS_CLK_HFCLK_PLL1 PLL#1. Applicable for PSoC 4200L.