aboutsummaryrefslogtreecommitdiffstats
path: root/source/adc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/adc.hpp')
-rw-r--r--source/adc.hpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/source/adc.hpp b/source/adc.hpp
index 15e343a..376b156 100644
--- a/source/adc.hpp
+++ b/source/adc.hpp
@@ -14,24 +14,27 @@
#include "hal.h"
-enum class ADCRate {
- R2P5,
- R6P5,
- R12P5,
- R24P5,
- R47P5,
- R92P5,
- R247P5,
- R640P5
-};
+namespace adc
+{
+ using operation_t = void (*)(adcsample_t *buffer, size_t count);
-using adc_operation_t = void (*)(adcsample_t *buffer, size_t count);
-
-void adc_init();
-adcsample_t *adc_read(adcsample_t *buffer, size_t count);
-void adc_read_start(adc_operation_t operation_func, adcsample_t *buffer, size_t count);
-void adc_read_stop();
-void adc_set_rate(ADCRate rate);
+ enum class rate {
+ R2P5,
+ R6P5,
+ R12P5,
+ R24P5,
+ R47P5,
+ R92P5,
+ R247P5,
+ R640P5
+ };
+
+ void init();
+ adcsample_t *read(adcsample_t *buffer, size_t count);
+ void read_start(operation_t operation_func, adcsample_t *buffer, size_t count);
+ void read_stop();
+ void set_rate(rate r);
+}
#endif // STMDSP_ADC_HPP_