How to perform an Analog reset on portenta H7

Hi I would like to use some force resistor of pololu on mbed system of portenta. The github code is made for an AVR system fslp-led-strip-arduino-demo/FslpLedStripDemo.ino at master · pololu/fslp-led-strip-arduino-demo · GitHub. I m here to understand how to generate the code relative to a MBED system. I would like to be guided to the solution through the datasheet and understand the rational.

// Performs an ADC reading on the internal GND channel in order
// to clear any voltage that might be leftover on the ADC.
// Only works on AVR boards and silently fails on others.
void analogReset()
#if defined(ADMUX)
#if defined(ADCSRB) && defined(MUX5)
    // Code for the ATmega2560 and ATmega32U4
    ADCSRB |= (1 << MUX5);
    ADMUX = 0x1F;

    // Start the conversion and wait for it to finish.
    ADCSRA |= (1 << ADSC);
    loop_until_bit_is_clear(ADCSRA, ADSC);