Added tone function

Added tone function.
Syntax:
radio.tone(x, y, z);

x = length in mS
y = Amplitude in dB, -30 to 0
z = Frequency in Hertz. (10 to 20000)

Note. After this command the audio is set to Unmute.
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-06-01 20:56:22 +02:00
parent ed302d83ec
commit d6f9562a93
5 changed files with 24 additions and 1 deletions
+11
View File
@@ -221,3 +221,14 @@ bool devTEF_Radio_Get_Identification (uint16_t *device, uint16_t *hw_version, ui
*sw_version = Convert8bto16b(buf + 4);
return r;
}
bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq)
{
if (mode == true) {
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 240);
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 5, 0, amplitude*10, freq, amplitude*10 , freq);
} else {
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 0);
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 0);
}
}