Complete the code to start the ADC conversion.
ADC_StartConversion([1]);The function ADC_StartConversion requires the channel number to start conversion. Here, channel 1 is used.
Complete the code to enable the ADC sample and hold feature.
ADC_ControlRegister |= [1];To enable sample and hold, the ADC_SAMPLE_HOLD_ENABLE bit must be set in the control register.
Fix the error in the code to wait until ADC conversion is complete.
while (!(ADC_StatusRegister & [1])) {}
The loop waits until the conversion complete flag is set in the status register.
Complete the code to correctly read the ADC result and clear the conversion flag.
uint16_t result = ADC_ResultRegister;
ADC_StatusRegister &= ~[1];The ADC result is read directly from the result register without modification. The conversion complete flag is cleared by ANDing with its complement.
Fill all three blanks to configure ADC for sample and hold with 10-bit resolution and start conversion.
ADC_ControlRegister = [1] | [2]; ADC_StartConversion([3]);
The control register is set to enable sample and hold and 10-bit resolution. Then conversion starts on channel 2.