aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/includes
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-12 23:30:51 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-12 23:30:51 +0200
commit74f34510c6f51b5510a80431369fe61c384c72c1 (patch)
treec5a4d412ebf216447e23f423634a9ed9e805eaf3 /src/common/includes
parent66f0e1af5b1f79ccb66909ce57f7d73ea7194a53 (diff)
downloadglutte-o-matic-74f34510c6f51b5510a80431369fe61c384c72c1.tar.gz
glutte-o-matic-74f34510c6f51b5510a80431369fe61c384c72c1.tar.bz2
glutte-o-matic-74f34510c6f51b5510a80431369fe61c384c72c1.zip
Implement DTMF sequence decoding and FSM activation of tone detector (untested)
Diffstat (limited to 'src/common/includes')
-rw-r--r--src/common/includes/Audio/audio_in.h3
-rw-r--r--src/common/includes/Audio/tone.h10
-rw-r--r--src/common/includes/Core/fsm.h2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/common/includes/Audio/audio_in.h b/src/common/includes/Audio/audio_in.h
index a543a69..40482d9 100644
--- a/src/common/includes/Audio/audio_in.h
+++ b/src/common/includes/Audio/audio_in.h
@@ -32,6 +32,9 @@
void audio_in_initialize(void);
+/* Enable or disable the audio input */
+void audio_in_enable(int enable);
+
// After calling this function, *buffer will point to new audio data.
// Returns the number of times filling the internal buffer failed.
int32_t audio_in_get_buffer(int16_t **buffer /*of length AUDIO_IN_BUF_LEN*/ );
diff --git a/src/common/includes/Audio/tone.h b/src/common/includes/Audio/tone.h
index b8a7f72..a4692df 100644
--- a/src/common/includes/Audio/tone.h
+++ b/src/common/includes/Audio/tone.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018 Matthias P. Braendli, Maximilien Cuony
+ * Copyright (c) 2019 Matthias P. Braendli, Maximilien Cuony
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -42,10 +42,14 @@ struct tone_detector {
void tone_init(void);
+void tone_detector_enable(int enable);
+
/* Return 1 when 1750 detected, 0 otherwise */
int tone_1750_status(void);
-/* Update 1750 tone detection status */
-void tone_detect_1750(const int16_t *samples, int len);
+int tone_fax_status(void);
+
+/* Update all tone detection status */
+void tone_detect_push_samples(const int16_t *samples, int len);
#endif
diff --git a/src/common/includes/Core/fsm.h b/src/common/includes/Core/fsm.h
index f8a800c..91bb231 100644
--- a/src/common/includes/Core/fsm.h
+++ b/src/common/includes/Core/fsm.h
@@ -105,6 +105,8 @@ struct fsm_output_signals_t {
int cw_psk31_trigger; // Set to true to trigger a CW or PSK31 transmission.
// PSK31 is sent if cw_dit_duration is 0
+ /* Tone detector */
+ int require_tone_detector; // Enables audio input and detector for DTMF and 1750
};
// Initialise local structures