/* Set the Length of ADC Converter Regular and Injected Conversion Sequence. */
void ADCConverLenSet(unsigned long ulBase, unsigned long ulSeqRegLen, unsigned long ulSeqInjLen)
/* Set the Length of ADC Converter Regular and Injected Conversion Sequence. */
void ADCConverLenSet(unsigned long ulBase, unsigned long ulSeqRegLen, unsigned long ulSeqInjLen)
{
    xASSERT((ulBase == ADC1_BASE) || (ulBase == ADC2_BASE) || (ulBase == ADC3_BASE));
    xASSERT((ulSeqRegLen > 0) && (ulSeqRegLen < 17));
    xASSERT((ulSeqInjLen > 0) && (ulSeqInjLen < 5));
    xHWREG(ulBase + ADC_SRQ1) &= ~ADC_SQR1_LEN_M;
    xHWREG(ulBase + ADC_SRQ1) |= ((ulSeqRegLen - 1)<<ADC_SQR1_LEN_S);
    xHWREG(ulBase + ADC_JSQR) &= ~ADC_JSQR_LEN_M;
    xHWREG(ulBase + ADC_JSQR) |= ((ulSeqInjLen - 1)<<ADC_JSQR_LEN_S);
}