]> code.bitgloo.com Git - clyne/stmdsp.git/commitdiff
adc/dac passthrough
authorClyne Sullivan <clyne@bitgloo.com>
Sat, 22 Aug 2020 20:56:47 +0000 (16:56 -0400)
committerClyne Sullivan <clyne@bitgloo.com>
Sat, 22 Aug 2020 20:56:47 +0000 (16:56 -0400)
cfg/mcuconf.h
source/adc.cpp
source/dac.cpp

index e1e50c3b2bbf126852cdb84f6c647754135783c0..d346e022eddd132dfb94413156d4c42b295e0332 100644 (file)
 #define STM32_GPT_USE_TIM2                  FALSE\r
 #define STM32_GPT_USE_TIM3                  FALSE\r
 #define STM32_GPT_USE_TIM4                  TRUE\r
-#define STM32_GPT_USE_TIM5                  TRUE\r
-#define STM32_GPT_USE_TIM6                  FALSE\r
+#define STM32_GPT_USE_TIM5                  FALSE\r
+#define STM32_GPT_USE_TIM6                  TRUE\r
 #define STM32_GPT_USE_TIM7                  FALSE\r
 #define STM32_GPT_USE_TIM8                  FALSE\r
 #define STM32_GPT_USE_TIM15                 FALSE\r
index 9e0491e829e16576aa6065c7932e6879abe4cfa3..1f65e685ee55095449be8e7dc4908d9a8296236b 100644 (file)
@@ -77,7 +77,7 @@ namespace adc
         adc_operation_func = operation_func;
         adc_group_config.circular = true;
         adcStartConversion(adcd, &adc_group_config, buffer, count);
-        gptStartContinuous(gptd, 1000); // 10kHz
+        gptStartContinuous(gptd, 100); // 10kHz
     }
     
     void read_stop()
index 6096d8e0b57f3a10d593dcf02644abd3317ad81c..644689e87c5db335197ade99806fe043f8bee275 100644 (file)
@@ -12,7 +12,7 @@
 #include "dac.hpp"
 
 constexpr static const auto dacd = &DACD1;
-constexpr static const auto gptd = &GPTD5;
+constexpr static const auto gptd = &GPTD6;
 
 constexpr static const DACConfig dac_config = {
     .init = 0,
@@ -24,11 +24,11 @@ constexpr static const DACConversionGroup dac_group_config = {
   .num_channels = 1,
   .end_cb = nullptr,
   .error_cb = nullptr,
-  .trigger = DAC_TRG(3)
+  .trigger = DAC_TRG(0)
 };
 
 constexpr static const GPTConfig gpt_config = {
-  .frequency = 500000,
+  .frequency = 1000000,
   .callback = nullptr,
   .cr2 = TIM_CR2_MMS_1, /* TRGO */
   .dier = 0
@@ -48,7 +48,7 @@ namespace dac
     void write_start(dacsample_t *buffer, size_t count)
     {
         dacStartConversion(dacd, &dac_group_config, buffer, count);
-        gptStartContinuous(gptd, 1);
+        gptStartContinuous(gptd, 100);
     }
     
     void write_stop()