aboutsummaryrefslogtreecommitdiffstats
path: root/source/samples.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-04-30 08:41:56 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-04-30 08:42:45 -0400
commite164629b3839eee0fda0be0e0a9842e78cf02f2b (patch)
treeb72b58665b85a104e5b953af45f00579341b2802 /source/samples.cpp
parent162dd6de8a0d883962b0b1475f47cbb08e0958d4 (diff)
parent3dd57491b1e81a9d93054eff19ca0e6c65c85b9b (diff)
merge in branch devel
Diffstat (limited to 'source/samples.cpp')
-rw-r--r--source/samples.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/samples.cpp b/source/samples.cpp
new file mode 100644
index 0000000..cfbf835
--- /dev/null
+++ b/source/samples.cpp
@@ -0,0 +1,35 @@
+/**
+ * @file samples.cpp
+ * @brief Provides sample buffers for inputs and outputs.
+ *
+ * Copyright (C) 2021 Clyne Sullivan
+ *
+ * Distributed under the GNU GPL v3 or later. You should have received a copy of
+ * the GNU General Public License along with this program.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "samples.hpp"
+
+#include "ch.h"
+#include "hal.h"
+
+#include <cstdint>
+
+static_assert(sizeof(adcsample_t) == sizeof(uint16_t));
+static_assert(sizeof(dacsample_t) == sizeof(uint16_t));
+
+#if defined(TARGET_PLATFORM_H7)
+__attribute__((section(".convdata")))
+SampleBuffer Samples::In (reinterpret_cast<Sample *>(0x38000000)); // 16k
+__attribute__((section(".convdata")))
+SampleBuffer Samples::Out (reinterpret_cast<Sample *>(0x30004000)); // 16k
+SampleBuffer Samples::SigGen (reinterpret_cast<Sample *>(0x30000000)); // 16k
+#else
+__attribute__((section(".convdata")))
+SampleBuffer Samples::In (reinterpret_cast<Sample *>(0x20008000)); // 16k
+__attribute__((section(".convdata")))
+SampleBuffer Samples::Out (reinterpret_cast<Sample *>(0x2000C000)); // 16k
+SampleBuffer Samples::Generator (reinterpret_cast<Sample *>(0x20010000)); // 16k
+#endif
+