aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/source/periph/dac.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/source/periph/dac.hpp')
-rw-r--r--firmware/source/periph/dac.hpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/firmware/source/periph/dac.hpp b/firmware/source/periph/dac.hpp
index 7250a52..f4266c7 100644
--- a/firmware/source/periph/dac.hpp
+++ b/firmware/source/periph/dac.hpp
@@ -2,7 +2,7 @@
* @file dac.hpp
* @brief Manages signal creation using the DAC.
*
- * Copyright (C) 2021 Clyne Sullivan
+ * Copyright (C) 2023 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.
@@ -18,12 +18,35 @@
class DAC
{
public:
+ /**
+ * Initializes DAC output pins and peripheral.
+ */
static void begin();
+ /**
+ * Begins continuous DAC conversion on the given channel, running at the
+ * current SClock sampling rate.
+ * @param channel Selected output channel (0 = sig. out, 1 = sig. gen.).
+ * @param buffer Buffer of sample data to output.
+ * @param count Number of samples in sample buffer.
+ */
static void start(int channel, dacsample_t *buffer, size_t count);
+
+ /**
+ * Stops DAC conversion on the given channel.
+ */
static void stop(int channel);
+ /**
+ * Determines if signal generator needs more sample data for streamed
+ * output (i.e. audio file streaming).
+ * @return >0 if samples needed, <0 on initial run.
+ */
static int sigGenWantsMore();
+
+ /**
+ * Returns true if signal generator is currently running.
+ */
static int isSigGenRunning();
private: