aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/adc.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@mit.edu>2010-10-22 21:13:02 -0400
committerMarti Bolivar <mbolivar@mit.edu>2010-10-22 21:13:02 -0400
commit6c956a383834b66c29591294f0926ced22f3e3b7 (patch)
tree00214f59655cf96d747228d9ffb8f6059b63b31c /libmaple/adc.h
parentdd7e6ecdafcb8938e23dfd18a36d70628fbc74bd (diff)
downloadlibrambutan-6c956a383834b66c29591294f0926ced22f3e3b7.tar.gz
librambutan-6c956a383834b66c29591294f0926ced22f3e3b7.zip
maple mini runs blinky now.
still need usb descriptors to improve, and also nothing else is tested.
Diffstat (limited to 'libmaple/adc.h')
-rw-r--r--libmaple/adc.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/libmaple/adc.h b/libmaple/adc.h
index 9b61821..ce67116 100644
--- a/libmaple/adc.h
+++ b/libmaple/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
@@ -73,17 +74,17 @@ extern "C"{
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)
;