2.8.2.2.2 Workflow

  1. Enable global interrupts, so that callbacks can be generated by the driver.
    system_interrupt_enable_global();
    
  2. Start an asynchronous ADC conversion, to store ADC samples into the global buffer and generate a callback when complete.
    adc_read_buffer_job(&adc_instance, adc_result_buffer, ADC_SAMPLES);
    
  3. Wait until the asynchronous conversion is complete.
    while (adc_read_done == false) {
        /* Wait for asynchronous ADC read to complete */
    }
    
  4. Enter an infinite loop once the conversion is complete.
    while (1) {
        /* Infinite loop */
    }