diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2020-08-20 17:06:47 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2020-08-20 17:06:47 -0400 |
commit | 989f4038c6d2a3e5bbee04fa25df181810af621e (patch) | |
tree | 73987829cac7e15ab8763211bcef582ec885f3a2 /source/adc.hpp | |
parent | 2ceb20f4d48a8f163528f86fda484e977438bc80 (diff) | |
parent | 29e4b4cf091dd47c9f435ef1d315a1609b83fb19 (diff) |
merge elf loading and adc streaming
Diffstat (limited to 'source/adc.hpp')
-rw-r--r-- | source/adc.hpp | 37 |
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_ |