Hi,
I am looking for some assistance with locating documentation regarding use of the error callback functions under CCS5.5 and SYS/BIOS 6.35 with an L137 device target. .
The McASP peripheral allows for a function pointer to an error callback function to be defined when initiialising the driver and device.
The guidance I am looking for here is what is the purpose of the Int32 value parameter in the callback? What errors cause the callback to be initiated. From my own study of operation it would seem that the error callback is invoked whenever the XSTAT register has a bit set and there are corresponding bits set in the XINTCTL register.
Once invoked what is the correct mechanism for clearing the error. I seem to have mixed success by clearing the XINTCTL bits but I'd like to locate documentation about how to use the error callback for the McASP in the context of the L138 and SYS/BIOS 6.35.
From my own project here are the relevant code snippets:
a) definition of error callback
extern Void errorFnx( Int32 value );
:
:
b) reference to callback initialised in channel parameters:
Mcasp_ChanParams chanParams =
{
0x0001, /* Number of serialisers */
{Mcasp_SerializerNum_15, }, /* Serialiser index: AXR[15] is PCM Tx from Codec(s) */
&audio_info.mcaspXmtSetup, /* HW Config */
TRUE, /* DMA Driven */
Mcasp_OpMode_TDM, /* Mode (TDM/DIT) */
Mcasp_WordLength_16, /* Data Transfer Size */
NULL, /* Loop Job Buffer */
0, /* Loop Buffer Length */
NULL, /* EDMA Driver Handle - filled in during Init */
&errorFnx, /* Error Callback fn pointer */
16, /* Number of TDM channels */
Mcasp_BufferFormat_1SER_MULTISLOT_NON_INTERLEAVED,
TRUE, /* Enable HW FIFO */
TRUE /* Buffer Data Packed */
}
:
:
c) Establishing the IO channel to the McASP:
/* ** Create Output Stream */ ioParams.chanParams = &chanParams; ioParams.model = GIO_Model_ISSUERECLAIM; chanParams.edmaHandle = hEdma; outStream = GIO_create("/mcasp0", GIO_OUTPUT, &ioParams, &eb); if(outStream == NULL) { System_printf("LOG:: Audio: Create Output stream FAILED\n"); return(STATUS_FAIL); } : :
d) Declaring the error callback function:
extern Void errorFnx( Int32 value ) { #define SETBIT(dest,mask) (dest|=mask) #define CLRBIT(dest,mask) (dest&=~mask) #define CHKBIT(dest,mask) (dest&=mask) CSL_McaspRegsOvly mcaspRegs = (CSL_McaspRegsOvly) CSL_MCASP_0_CTRL_REGS; //OMAP-L138 McASP Configuration Register Pointer Instance CLRBIT( mcaspRegs->XSTAT, (CSL_MCASP_XSTAT_XCKFAIL_MASK |CSL_MCASP_XSTAT_XSYNCERR_MASK|CSL_MCASP_XSTAT_XUNDRN_MASK) ); mcasp_fault = 1; }
Thanks for any help and particularly pointers to the appropriate documentation/examples that details how to use the error call back. The SRUFM1.pdf does not seem to describe how the callback should be used, the meaning of the value parameters, etc.
Duncan.