summaryrefslogtreecommitdiff
path: root/ucoo/hal/adc/test
diff options
context:
space:
mode:
Diffstat (limited to 'ucoo/hal/adc/test')
-rw-r--r--ucoo/hal/adc/test/Makefile2
-rw-r--r--ucoo/hal/adc/test/test_adc.cc9
2 files changed, 5 insertions, 6 deletions
diff --git a/ucoo/hal/adc/test/Makefile b/ucoo/hal/adc/test/Makefile
index c6c8a3c..603093d 100644
--- a/ucoo/hal/adc/test/Makefile
+++ b/ucoo/hal/adc/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f4
stm32f4_PROGS = test_adc
test_adc_SOURCES = test_adc.cc
-MODULES = ucoo/hal/adc ucoo/base/test ucoo/hal/usb ucoo/utils
+MODULES = ucoo/hal/adc ucoo/base/test ucoo/hal/usb ucoo/hal/gpio ucoo/utils
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/adc/test/test_adc.cc b/ucoo/hal/adc/test/test_adc.cc
index 58cca96..03825da 100644
--- a/ucoo/hal/adc/test/test_adc.cc
+++ b/ucoo/hal/adc/test/test_adc.cc
@@ -26,9 +26,8 @@
#include "ucoo/arch/arch.hh"
#include "ucoo/base/test/test.hh"
#include "ucoo/utils/delay.hh"
-
-#include <libopencm3/stm32/adc.h>
#include "ucoo/hal/gpio/gpio.hh"
+#include "ucoo/arch/reg.hh"
#include <cstdio>
@@ -38,10 +37,10 @@ main (int argc, const char **argv)
ucoo::arch_init (argc, argv);
ucoo::test_stream_setup ();
// Have fun with temperature sensor.
- ucoo::AdcHard adc (0);
+ ucoo::AdcHard adc (ucoo::AdcHard::Instance::ADC1);
adc.enable ();
- ADC_CCR = ADC_CCR_TSVREFE;
- ucoo::AdcHardChannel c (adc, 16);
+ ucoo::reg::ADC->CCR = ADC_CCR_TSVREFE;
+ ucoo::AdcHardChannel c = adc[16];
while (1)
{
int r = c.read ();