diff src/g23m-aci/aci/ati_audio.c @ 292:85b38e37810b

AT@SPKR and AT@VPATH ported over to aci3
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 02 Sep 2017 17:05:04 +0000
parents 294c26c07561
children 8473cabf491d
line wrap: on
line diff
--- a/src/g23m-aci/aci/ati_audio.c	Thu Aug 31 06:01:10 2017 +0000
+++ b/src/g23m-aci/aci/ati_audio.c	Sat Sep 02 17:05:04 2017 +0000
@@ -66,6 +66,43 @@
 #include "audio/audio_api.h"
 #include "audio.h"	/* Condat */
 
+#include "fc-target.cfg"
+#include "armio.h"
+
+#ifdef CONFIG_TARGET_FCDEV3B
+/* AT@SPKR - turn loudspeaker amplifier on or off */
+GLOBAL T_ATI_RSLT atAtSPKR ( char *cl, UBYTE srcId )
+{
+	int state;
+
+	TRACE_FUNCTION("atAtSPKR()");
+
+	cl = parse(cl, "D", &state);
+	if (!cl)
+		return (ATI_FAIL);
+	if (state)
+		AI_SetBit(1);
+	else
+		AI_ResetBit(1);
+	return (ATI_CMPL);
+}
+
+GLOBAL T_ATI_RSLT queatAtSPKR (char *cl, UBYTE srcId)
+{
+	char *me="@SPKR: ";
+	int state;
+
+	TRACE_FUNCTION("queatAtSPKR()");
+
+	state = AI_ReadBit(1);
+	sprintf(g_sa, "%s%d", me, state);
+
+	io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
+
+	return (ATI_CMPL);
+}
+#endif
+
 /* AT@SND - emit sound through Condat API */
 GLOBAL T_ATI_RSLT atAtSND ( char *cl, UBYTE srcId )
 {
@@ -130,6 +167,53 @@
 	return (ATI_CMPL);
 }
 
+#ifdef CONFIG_TARGET_FCDEV3B
+/* AT@VPATH - configure digital voice path */
+GLOBAL T_ATI_RSLT atAtVPATH ( char *cl, UBYTE srcId )
+{
+	int vpath_int;
+	T_AUDIO_VOICE_PATH_SETTING vpath;
+	T_AUDIO_FULL_ACCESS_WRITE audio_param;
+	T_RV_RETURN return_path;
+
+	TRACE_FUNCTION("atAtVPATH()");
+
+	cl = parse(cl, "D", &vpath_int);
+	if (!cl)
+		return (ATI_FAIL);
+	vpath = vpath_int;
+	audio_param.variable_indentifier = AUDIO_PATH_USED;
+	audio_param.data = &vpath;
+
+	return_path.addr_id        = NULL;
+	return_path.callback_func  = audio_callback;
+	if (audio_full_access_write(&audio_param, return_path) == AUDIO_OK)
+		return (ATI_CMPL);
+	else
+		return (ATI_FAIL);
+}
+
+GLOBAL T_ATI_RSLT queatAtVPATH (char *cl, UBYTE srcId)
+{
+	char *me="@VPATH: ";
+	T_AUDIO_VOICE_PATH_SETTING vpath;
+	T_AUDIO_FULL_ACCESS_READ audio_param;
+
+	TRACE_FUNCTION("queatAtVPATH()");
+
+	audio_param.variable_indentifier = AUDIO_PATH_USED;
+	audio_param.data = &vpath;
+	if (audio_full_access_read(&audio_param) != AUDIO_OK)
+		return (ATI_FAIL);
+
+	sprintf(g_sa, "%s%d", me, vpath);
+
+	io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
+
+	return (ATI_CMPL);
+}
+#endif
+
 /* AT@E1 - play an E1 format melody */
 GLOBAL T_ATI_RSLT atAtE1 ( char *cl, UBYTE srcId )
 {