NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
MCSDK OMAPL138 User Guide Chapter Developing
|
MCSDK User Guide for OMAP-L138:
Developing with the MCSDK |
Last updated: 11/07/2013
Contents
MCASP Sample App customisation[edit]
The MCASP audio sample application can be customised for a variety of applications. The following example is an illustration of the changes required for supporting 16/24/32 bit I2S data from the AIC1306 The data structures to be modified are as follows:
In Aic31.c
/* -------- constants -------- */ const Aic31_Params Aic31_PARAMS = { ICodec_CodecType_AIC31, /* acType */ ICodec_ControlBusType_I2C, /* acControlBusType */ "NONE", /* acCtrlBusName */ ICodec_OpMode_MASTER, /* acOpMode */ ICodec_DataType_I2S, /* acSerialDataType */ (Uint32)ICodec_SlotWidth_24, /* acSlotWidth ICodec_SlotWidth_16 for 16 bit/ICodec_SlotWidth_32 for 32 bit */ ICodec_DataPath_TXRX, /* acDataPath */ 0, /* isRxTxClockIndependent */ };
In audioSample_io.c
Mcasp_HwSetupData mcaspRcvSetup = { /* .rmask = */ 0xffffFFff, /* All the data bits are to be used */ /* .rfmt = */ 0x000180b0, /* 0x00018070 for 16, 0x000180b0 for 24, 0x000180f0 for 32 */ * 1 bit delay from framsync * MSB first * No extra bit padding * Padding bit (ignore) * slot Size is 24 * Reads from DMA port * NO rotation */ /* .afsrctl = */ 0x00000111, /* burst mode, * Frame sync is frame * Rising edge is start of frame * externally generated frame sync */ /* .rtdm = */ 0x00000003, /* slot 1 and 2 is active (I2S) */ /* .rintctl = */ 0x00000003, /* sync error and overrun error */ /* .rstat = */ 0x000001FF, /* reset any existing status bits */ /* .revtctl = */ 0x00000000, /* DMA request is enabled or disabled */ { /* .aclkrctl = */ 0x00000000, /* .ahclkrctl = */ 0x00000000, /* .rclkchk = */ 0x00000000 } } ; Mcasp_HwSetupData mcaspXmtSetup = { /* .xmask = */ 0xffffFFff, /* All the data bits are to be used */ /* .xfmt = */ 0x000180b6, /* 0x00018074 for 16, 0x000180b6 for 24, 0x000180f0 for 32 */ * 1 bit delay from framsync * MSB first * No extra bit padding * Padding bit (ignore) * slot Size is 24 * Reads from DMA port * 24 bit rotation */ /* .afsxctl = */ 0x00000111, /* burst mode, * Frame sync is frame * Rising edge is start of frame * externally generated frame sync */ /* .xtdm = */ 0x00000003, /* slot 1 and 2 is active (I2S) */ /* .xintctl = */ 0x00000007, /* sync error,overrun error,clK error */ /* .xstat = */ 0x000001FF, /* reset any existing status bits */ /* .xevtctl = */ 0x00000000, /* DMA request is enabled or disabled */ { /* .aclkxctl = */ 0x00000080, /* .ahclkxctl = */ 0x00000000, /* .xclkchk = */ 0x00000000 }, }; Mcasp_ChanParams mcasp_chanparam[Audio_NUM_CHANS]= { { 0x0001, /* number of serialisers */ {Mcasp_SerializerNum_14, }, /* serialiser index */ &mcaspRcvSetup, TRUE, Mcasp_OpMode_TDM, /* Mode (TDM/DIT) */ Mcasp_WordLength_24, /* Mcasp_WordLength_16 for 16 bit/Mcasp_WordLength_32 for 32 bit */ NULL, 0, NULL, GblErr, 2, /* number of TDM channels */ Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED, TRUE, TRUE }, { 0x0001, /* number of serialisers */ {Mcasp_SerializerNum_13,}, &mcaspXmtSetup, TRUE, Mcasp_OpMode_TDM, Mcasp_WordLength_24, /* Mcasp_WordLength_16 for 16 bit/Mcasp_WordLength_32 for 32 bit */ NULL, 0, NULL, GblErr, 2, /* number of TDM channels */ Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED, TRUE, TRUE } };