/* Duplicate implementation of CLOCK_SetDiv() provided by SDK. This function must be linked to ITCM, as it will be used to change the clocks of the FLEXSPI and SEMC peripherals. Any function called from this function must also reside in ITCM  */
static void clock_set_div(clock_div_t divider, uint32_t value)
/* Duplicate implementation of CLOCK_SetDiv() provided by SDK. This function must be linked to ITCM, as it will be used to change the clocks of the FLEXSPI and SEMC peripherals. Any function called from this function must also reside in ITCM  */
static void clock_set_div(clock_div_t divider, uint32_t value)
{
	uint32_t busy_shift;
	busy_shift = CCM_TUPLE_BUSY_SHIFT(divider);
	CCM_TUPLE_REG(CCM, divider) = (CCM_TUPLE_REG(CCM, divider) & (~CCM_TUPLE_MASK(divider))) |
		(((uint32_t)((value) << CCM_TUPLE_SHIFT(divider))) & CCM_TUPLE_MASK(divider));
	if (busy_shift != CCM_NO_BUSY_WAIT) {
		while ((CCM->CDHIPR & ((uint32_t)(1UL << busy_shift))) != 0UL) {
		}
	}
}