summaryrefslogtreecommitdiffstats
path: root/include/xas
diff options
context:
space:
mode:
authorXANTRONIX Development2022-03-08 19:51:59 -0500
committerXANTRONIX Development2022-03-08 19:51:59 -0500
commitd46847852d1446f4b64a0fd424cdea5fa1c0dbd4 (patch)
treee17acc9e2efe6e631108bdf2798bb5eec58ed071 /include/xas
parentaaff62e728a269893ef378534f6aca71643fe4cc (diff)
downloadxas-d46847852d1446f4b64a0fd424cdea5fa1c0dbd4.tar.gz
xas-d46847852d1446f4b64a0fd424cdea5fa1c0dbd4.tar.bz2
xas-d46847852d1446f4b64a0fd424cdea5fa1c0dbd4.zip
Implement setting square wave duty cycle
Diffstat (limited to 'include/xas')
-rw-r--r--include/xas/synth.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/xas/synth.h b/include/xas/synth.h
index ca83c69..cb0b3bd 100644
--- a/include/xas/synth.h
+++ b/include/xas/synth.h
@@ -8,6 +8,7 @@
#include <xas/audio.h>
#define XAS_SYNTH_DEFAULT_GAIN 1.0f
+#define XAS_SYNTH_DEFAULT_DUTY 1.0f
#define XAS_SYNTH_DEFAULT_FREQUENCY 2600 /* Hz */
enum xas_synth_type {
@@ -38,7 +39,8 @@ struct _xas_synth {
xas_synth_sample_callback sample;
float phase,
- gain;
+ gain,
+ duty;
size_t frequency;
};
@@ -51,6 +53,8 @@ void xas_synth_destroy(xas_synth *synth);
void xas_synth_set_gain(xas_synth *synth, float gain);
+void xas_synth_set_duty(xas_synth *synth, float duty);
+
void xas_synth_set_frequency(xas_synth *synth, size_t frequency);
void xas_synth_set_type(xas_synth *synth, enum xas_synth_type type);