Added basic driver example use code to the library documentation.
[pub/lufa.git] / LUFA / Drivers / Peripheral / AVRU4U6U7 / ADC.h
index 4790668..3e73686 100644 (file)
  *  \note This file should not be included directly. It is automatically included as needed by the ADC driver
  *        dispatch header located in LUFA/Drivers/Peripheral/ADC.h.
  *
+ *  <b>Example Usage:</b>
+ *  \code
+ *      // Initialise the ADC driver before first use
+ *      ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_32);
+ *
+ *      // Must setup the ADC channel to read beforehand
+ *      ADC_SetupChannel(1);
+ *
+ *      // Perform a single conversion of the ADC channel 1
+ *      ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_CHANNEL1);
+ *      printf("Conversion Result: %d\r\n", ADC_GetResult());
+ *
+ *      // Start reading ADC channel 1 in free running (continuous conversion) mode
+ *      ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_CHANNEL1);
+ *      while (!(ADC_IsReadingComplete())) {};
+ *      printf("Conversion Result: %d\r\n", ADC_GetResult());
+ *  \endcode
+ *
  *  @{
  */