/* config the length of regular channel group or inserted channel group  */
void adc_channel_length_config(uint8_t adc_channel_group, uint8_t length)
/* config the length of regular channel group or inserted channel group  */
void adc_channel_length_config(uint8_t adc_channel_group, uint8_t length)
{
    switch(adc_channel_group){
    case ADC_REGULAR_CHANNEL:
        ADC_RSQ0 &= (uint32_t)~((length-1) << 20);
        ADC_RSQ0 |= (uint32_t)((length-1) << 20);
        break;
    case ADC_INSERTED_CHANNEL:
        ADC_ISQ &= (uint32_t)~((length-1) << 20);
        ADC_ISQ |= (uint32_t)((length-1) << 20);
        break;
    default:
        break;
    }
}