// The DiceDriver module needs to be able to tell us what is happening. The most // important information is the request for a change of clock rate or source. // The eDDR_MSG_CLOCK_CHG is the only one we are required to handle. // The other messages are used to show the connection status on some LED's, // and those are of course application dependent. static HRESULT myDiceDriverCallBack (DICE_DRIVER_MSG_ENUM msg, DICE_DRIVER_CB_DATA * pData) { // why did the driver call us? switch (msg) { case eDDR_MSG_CLOCK_CHG: // The computer has requested a change of clock and source //SYS_TRACE1(SYSDEBUG_TRACE_GENERAL, pData->rate); myAppChangeSR(pData); break; case eDDR_MSG_ATTACH: // The computer attached itself to this device // this typically happens after the computer boots, but also after // bus resets or the first time the driver is installed // In this application we don't care //SYS_TRACE1(SYSDEBUG_TRACE_GENERAL, 0); break; case eDDR_MSG_DETACH: // The computer detached itself from this device // this typically happens when the computer shuts down // or at a bus reset. // In this application we don't care //SYS_TRACE1(SYSDEBUG_TRACE_GENERAL, 0); break; case eDDR_MSG_ENABLE: // The computer has enabled streaming //SYS_TRACE1(SYSDEBUG_TRACE_GENERAL, 0); driverAttached = true; updateStatusLEDs(); break; case eDDR_MSG_DISABLE: // The computer has disabled streaming //SYS_TRACE1(SYSDEBUG_TRACE_GENERAL, 0); driverAttached = false; updateStatusLEDs(); break; case eDDR_MSG_AC3_CHG: //AC3 flags for one of the transmitter or receiver has changed sysDebugPrintf("AC3 Enable Change\r\n"); sysDebugPrintf("Stream0: 0x%04x\r\nStream1: 0x%04x\r\n", diceDriverGetState()->RxParameters.IsocReceiver[0].AC3Enable, diceDriverGetState()->RxParameters.IsocReceiver[1].AC3Enable); break; } return NO_ERROR; }
HRESULT myAvcDriverCallBack (AVC_DRIVER_MSG_ENUM msg, AVC_DRIVER_CB_DATA * pData) { uint32 notify; // why did the driver call us? switch (msg) { case eAVCDR_MSG_CLOCK_CHG: // The computer has requested a change of clock and source. We // should honour that by issuing a call to "dal" //Check if DAL needs to be changed notify = myAppChangeSR(pData); //Change the Clock Now dalSetClockSource (eDAL_INTERFACE_1, pData->source, pData->rate); break; case eAVCDR_MSG_ATTACH: // The computer attached itself to this device // this typically happens after the computer boots, but also after // bus resets or the first time the driver is installed // In this application we don't care LED_ON(DRIVER_ATCH_LED_ID); break; case eAVCDR_MSG_DETACH: // The computer detached itself from this device // this typically happens when the computer shuts down // or at a bus reset. // In this application we don't care LED_OFF(DRIVER_ATCH_LED_ID); break; case eAVCDR_MSG_ENABLE: // The computer has enabled streaming LED_ON(DRIVER_EN_LED_ID); break; case eAVCDR_MSG_DISABLE: // The computer has disabled streaming LED_OFF(DRIVER_EN_LED_ID); break; } return NO_ERROR; }