Hi all,
I try to merge audioSample.pjt with mmcsdSample.pjt because i want to record the sound and store the data in SD card.
As stated in: http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/51523/183305.aspx#183305
i2c0 are used both for AIC31 and the SD control, so i have to set different device address for these two divice.
First, i check the init function:
Void mmcsdUserI2cInit()
{
I2c_init();
mmcsdI2cParams = I2c_PARAMS;
mmcsdI2cParams.busFreq = 200000u;
mmcsdI2cParams.hwiNumber = 8u;
/* configure I2c for edma mode */
mmcsdI2cParams.opMode = I2c_OpMode_INTERRUPT;
/* power on the MMCSD device in the Power sleep controller */
Psc_ModuleClkCtrl(Psc_DevId_1, CSL_PSC_MMCSD0, TRUE);
/* Bring the GPIO module out of sleep state */
Psc_ModuleClkCtrl(Psc_DevId_1, CSL_PSC_GPIO, TRUE);
}
and
void audioUserI2cInit()
{
I2c_init();
audioI2cParams = I2c_PARAMS;
audioI2cParams.hwiNumber = 8u;
audioI2cParams.opMode = I2c_OpMode_INTERRUPT;
}
I did not find where to set the slave device (here they are AIC31 and that for mmcsd part) address.
I found:(in Aic31.h)
static Bool aic31I2cRead(Aic31_Object *instHandle,
Uint32 deviceId,
ICodec_RegData *rdRegData)
{
Uint8 count; /* Local count variable */
Uint32 regIndex; /* Register index to be written */
Uint8 *regData; /* Pointer to array of register write data */
Uint8 data[10]; /* Temporary data */
I2c_DataParam dataBuffer;
IOM_Packet ioPacket;
......
/* Read all the registers */
for (count = 0; count < rdRegData->regCount; count++)
{
/* The following the procedure to read data from Aic31 codec
Step A: Write the address of the register to be read.
Note: The I2C stop should not be issued.
Step B: Issue I2C restart.
Step C: Read the value of the register. */
data[0] = regIndex;
/* Prepare the data to be written to the audio codec */
dataBuffer.slaveAddr = deviceId;
dataBuffer.buffer = &data[0];
.......
But i don't known when function aic31I2cRead() was called in audioSample.pjt and how the parameter deviceId was passed.
is this deviceId the same as that "device id" which is set during create user defined device object i2c0 in Tconf?
Will anyone list a abstract what i need to modify? Some helpful hints will also be welcomed.
Bo Li