/* Get the ADC pin corresponding to the specified ADC channel.  */
uint8_t ADC_GetChPin(const CM_ADC_TypeDef *ADCx, uint8_t u8Ch)
/* Get the ADC pin corresponding to the specified ADC channel.  */
uint8_t ADC_GetChPin(const CM_ADC_TypeDef *ADCx, uint8_t u8Ch)
{
    uint8_t u8RetPin;
    uint8_t u8FieldOfs;
    uint8_t u8RegIdx;
    __IO uint16_t *regCHMUXR;
    DDL_ASSERT(IS_ADC_REMAP_CH(ADCx, u8Ch));
    regCHMUXR  = (__IO uint16_t *)((uint32_t)&ADCx->CHMUXR0);
    u8RegIdx   = u8Ch / 4U;
    u8FieldOfs = (u8Ch % 4U) * 4U;
    u8RetPin   = ((uint8_t)(regCHMUXR[u8RegIdx] >> u8FieldOfs)) & 0xFU;
    return u8RetPin;
}