Hi folks,
A customer is attempting to modify the PSP to use McASP0 for 4 inputs and McASP1 for 4 outputs, but he is running into some problems. I'm quoting his inquiry below:
I am using the C6747 PSP 1.30.01 with a Spectrum Digital L137 board with a Audio 4 in (stereo), 4 out audio board. I have modified the PSP audio example code (for the AIC codec) to handle the different A/D and D/A converters as well as 4 in and 4 out. Also I have changed the code to make the McASP a slave I2S device. Everything works fine but my target hardware uses McASP0 to get audio in and McASP1 to get audio out. I have been able to modify the 4 channel audio board to send the bit and word clocks to McASP0 (AFSR0 and ACLKR0). So now the reference hardware resembles my target hardware. My issue is that I am not able to modify the PSP audio example to use McASP0 for input and McASP1 for output. In particular I need to know how to define the driver creation in the .tci file as well as how the user defined initialization gets modified when I want to use two different McASPs. When I make the changes to the code I go into a halt state before main() is called. So which makes me think it is the user defined drivers that are in-correct.
Here is an example of the original .ti file:
/* Add Mcasp driver to DEV table */
bios.UDEV.create("mcasp1");
bios.UDEV.instance("mcasp1").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("mcasp1").initFxn = prog.extern("audioUserMcaspInit");
bios.UDEV.instance("mcasp1").params = prog.extern("audioMcaspParams");
bios.UDEV.instance("mcasp1").fxnTable = prog.extern("Mcasp_IOMFXNS");
bios.UDEV.instance("mcasp1").deviceId = 1;/* Add Audio driver to DEV table */
bios.UDEV.create("audio0");
bios.UDEV.instance("audio0").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("audio0").initFxn = prog.extern("audioUserAudioInit");
bios.UDEV.instance("audio0").params = prog.extern("audioParams");
bios.UDEV.instance("audio0").fxnTable = prog.extern("Audio_IOMFXNS");
var dioCodec = bios.DIO.create("dioAudioIN");
dioCodec.deviceName = prog.get("audio0");
dioCodec.useCallBackFxn = false;
dioCodec.chanParams = prog.extern("audioChanParamsIN");
var dioCodec = bios.DIO.create("dioAudioOUT");
dioCodec.deviceName = prog.get("audio0");
dioCodec.useCallBackFxn = false;
dioCodec.chanParams = prog.extern("audioChanParamsOUT");
I have changed this to
/* Add Mcasp driver (outputs) to DEV table */
bios.UDEV.create("mcasp1");
bios.UDEV.instance("mcasp1").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("mcasp1").initFxn = prog.extern("audioUserMcaspInit");
bios.UDEV.instance("mcasp1").params = prog.extern("audioMcaspParams");
bios.UDEV.instance("mcasp1").fxnTable = prog.extern("Mcasp_IOMFXNS");
bios.UDEV.instance("mcasp1").deviceId = 1;
/* Add Mcasp 0 (inputs) driver to DEV table */ ß---- new
bios.UDEV.create("mcasp0"); ß---- new
bios.UDEV.instance("mcasp0").fxnTableType = "IOM_Fxns";ß---- new
bios.UDEV.instance("mcasp0").initFxn = prog.extern("InputsaudioUserMcaspInit");ß---- new
bios.UDEV.instance("mcasp0").params = prog.extern("InputsaudioMcaspParams");ß---- new
bios.UDEV.instance("mcasp0").fxnTable = prog.extern("Mcasp_IOMFXNS");ß---- new
bios.UDEV.instance("mcasp0").deviceId = 0;
/* Add Audio driver to DEV table */
bios.UDEV.create("audio0");
bios.UDEV.instance("audio0").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("audio0").initFxn = prog.extern("audioUserAudioInit");
bios.UDEV.instance("audio0").params = prog.extern("audioParams");
bios.UDEV.instance("audio0").fxnTable = prog.extern("Audio_IOMFXNS");
/* Add Audio driver (for inputs) to DEV table */ß---- new
bios.UDEV.create("audio1");ß---- new
bios.UDEV.instance("audio1").fxnTableType = "IOM_Fxns";ß---- new
bios.UDEV.instance("audio1").initFxn = prog.extern("InputsaudioUserAudioInit");ß---- new
bios.UDEV.instance("audio1").params = prog.extern("InputsaudioParams");ß---- new
bios.UDEV.instance("audio1").fxnTable = prog.extern("Audio_IOMFXNS");ß---- new
var dioCodec = bios.DIO.create("dioAudioIN");ß---- changed
dioCodec.deviceName = prog.get("audio0");ß---- changed
dioCodec.useCallBackFxn = false;
dioCodec.chanParams = prog.extern("audioChanParamsIN");ß---- changedvar dioCodec = bios.DIO.create("dioAudioOUT"); ß---- changed
dioCodec.deviceName = prog.get("audio1"); ß---- changed
dioCodec.useCallBackFxn = false;
dioCodec.chanParams = prog.extern("audioChanParamsOUT");ß---- changed
is this the correct way to do it or am I doing something totally wrong here?