aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/adc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/adc.h')
-rw-r--r--libmaple/adc.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/libmaple/adc.h b/libmaple/adc.h
index 776768e..fe1196f 100644
--- a/libmaple/adc.h
+++ b/libmaple/adc.h
@@ -25,7 +25,7 @@
/**
* @file adc.h
*
- * @brief ADC prototypes and defines
+ * @brief Analog-to-Digital Conversion (ADC) routines.
*/
#ifndef _ADC_H_
@@ -43,7 +43,8 @@ extern "C"{
*
* Need to up the sample time if otherwise... see datasheet */
-/* TODO: We'll only use ADC1 for now... */
+/* TODO: We'll only use ADC1 for now. See page 41 of the manual for
+ ADC2 and ADC3's real addresses. */
#define ADC1_BASE 0x40012400
#define ADC2_BASE 0x40012400
#define ADC3_BASE 0x40012400
@@ -74,17 +75,17 @@ void adc_init(void);
void adc_disable(void);
/**
- * Perform a single conversion on ADC[0-16],
+ * Perform a single conversion on ADC[0-15].
* PRECONDITIONS:
* adc initialized */
static inline int adc_read(int channel) {
- /* Set channel */
+ /* Set channel */
ADC_SQR3 = channel;
- /* Start the conversion */
+ /* Start the conversion */
CR2_SWSTART_BIT = 1;
- /* Wait for it to finish */
+ /* Wait for it to finish */
while(SR_EOC_BIT == 0)
;