The function validation of the input parameter ui32ClockDiv appears to be incorrect. The function prototype is:
ADCClockConfigSet(uint32_t ui32Base, uint32_t ui32Config,
uint32_t ui32ClockDiv)
The function sets the clock divisor (a 6 bit value) in ADC_O_CC to (ui32Config - 1) << ADC_CC_CLKDIV_S, which is correct, since the field occurs in bits (9-4) of the register. However, the function validates the input parameter using:
ASSERT(((ui32ClockDiv - 1) & ~ADC_CC_CLKDIV_M) == 0);
where ADC_CC_CLKDIV_M is 0x3f0 (that is, the shifted mask value). This test is not correct; certain valid input divisor values (17, 33) will be rejected, while other invalid values may be accepted. The test should be:
ASSERT((((ui32ClockDiv - 1) << ADC_CC_CLKDIV_S) & ~ADC_CC_CLKDIV_M) == 0);