diff options
author | Perry Hung <iperry@gmail.com> | 2011-02-27 03:07:31 -0500 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-02-27 04:58:43 -0500 |
commit | def4173e683c3538388aabceeb08e5336c2bdadf (patch) | |
tree | 54e2571fb12b31d6730eb1a1b33d09fc53e003a8 /wirish/wirish.c | |
parent | c8ca7a2eb7528462677c80497854b940931eab16 (diff) | |
download | librambutan-def4173e683c3538388aabceeb08e5336c2bdadf.tar.gz librambutan-def4173e683c3538388aabceeb08e5336c2bdadf.zip |
libmaple: Refactor ADC routines
ADC routines rewritten, support for ADC2, 3, added.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish/wirish.c')
-rw-r--r-- | wirish/wirish.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wirish/wirish.c b/wirish/wirish.c index aaae9d4..1ea4863 100644 --- a/wirish/wirish.c +++ b/wirish/wirish.c @@ -64,9 +64,12 @@ void init(void) { nvic_init(); systick_init(SYSTICK_RELOAD_VAL); gpio_init(); + /* Initialize the ADC for slow conversions, to allow for high impedance inputs. */ - adc_init(ADC_SMPR_55_5); + adc_init(ADC1, 0); + adc_set_sample_rate(ADC1->regs, ADC_SMPR_55_5); + timer_init(TIMER1, 1); timer_init(TIMER2, 1); timer_init(TIMER3, 1); |