static void dumpADAT(void) { BOOL bEnable; BOOL bLocked; BOOL bLocked_aux; uADATRX_STATUS error, error_aux; adatRxGetEnable (&bEnable); bLocked = adatIsLocked (0); bLocked_aux = adatIsLocked (1); adatRxGetError(0,&error, TRUE); adatRxGetError(1,&error_aux, TRUE); cliPrintf("ADAT Rx:\n\r"); cliPrintf("\tState : %s\n\r", bEnable ? (bLocked ? "Locked" : "Unlocked") : "Disabled"); cliPrintf("ADAT Errors L=No Lock, S=No Sync\n\r"); cliPrintf("\tErrors : %c%c%\n\r", error.bit.no_lock ? 'L' : ' ', error.bit.no_sync ? 'S' : ' '); cliPrintf("ADAT Rx registers:\n\r"); cliPrintf("\tSTATUS : 0x%04x\n\r", pDiceADATRx->status.reg); cliPrintf("ADAT Tx registers:\n\r"); cliPrintf("\tUSER_SETUP : 0x%04x\n\r", pDiceADATTx->userSetup.reg & 0x0f); cliPrintf("\tCH_MUTE : 0x%04x\n\r", pDiceADATTx->chMute.reg); cliPrintf("ADAT AUX Rx:\n\r"); cliPrintf("\tState : %s\n\r", bEnable ? (bLocked_aux ? "Locked" : "Unlocked") : "Disabled"); cliPrintf("ADAT AUX Errors L=No Lock, S=No Sync\n\r"); cliPrintf("\tErrors : %c%c%\n\r", error_aux.bit.no_lock ? 'L' : ' ', error_aux.bit.no_sync ? 'S' : ' '); cliPrintf("ADAT AUX Rx registers:\n\r"); cliPrintf("\tSTATUS : 0x%04x\n\r", pDiceADATRx->statusAux.reg); cliPrintf("ADAT AUX Tx registers:\n\r"); cliPrintf("\tUSER_SETUP : 0x%04x\n\r", (pDiceADATTx->userSetup.reg>>4)); cliPrintf("\tCH_MUTE : 0x%04x\n\r", pDiceADATTx->chMuteAux.reg); }
// This function updates the status LED's, this way we can get the status // back after leaving Meter mode. static void updateStatusLEDs(void) { if (LEDmode) return; targetSetLED (TGT_LED2, driverAttached ? TGT_LED_ON : TGT_LED_OFF); targetSetLED (TGT_LED3, isLocked ? TGT_LED_ON : TGT_LED_OFF); targetSetLED (TGT_LED4, aesIsMasterLocked () ? TGT_LED_ON : TGT_LED_OFF); targetSetLED (TGT_LED5, adatIsLocked() ? TGT_LED_ON : TGT_LED_OFF); }
// The actual callback function called by DAL static HRESULT myDalCallBack (DAL_CB_EVENT_MASK events, DAL_EVENTS * pExtEvents, uint32 data) { uint16 aesStatus; uint32 extStatus=0; //extended status to the driver DAL_STATUS dalStatus; // We want to tell the diceDriver about the locked status of the clock domain // and sample rate etc. // let's collect AES/ADAT/AVS interface lock status. // We pass this on to the driver. It is not needed for the driver/streaming operation // but it can be obtained by control panels to provide visual feedback to the user aesGetStatus (&aesStatus); if (aesStatus & AES_STAT_LOCK0) extStatus |= DD_EXT_STATUS_AES0_LOCKED; if (aesStatus & AES_STAT_LOCK1) extStatus |= DD_EXT_STATUS_AES1_LOCKED; if (aesStatus & AES_STAT_LOCK2) extStatus |= DD_EXT_STATUS_AES2_LOCKED; if (aesStatus & AES_STAT_LOCK3) extStatus |= DD_EXT_STATUS_AES3_LOCKED; //let's update the slip information if (pExtEvents->aes_events & (DAL_CB_AES0_SLIP | DAL_CB_AES0_RPT)) extStatus |= DD_EXT_STATUS_AES0_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES1_SLIP | DAL_CB_AES1_RPT)) extStatus |= DD_EXT_STATUS_AES1_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES2_SLIP | DAL_CB_AES2_RPT)) extStatus |= DD_EXT_STATUS_AES2_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES3_SLIP | DAL_CB_AES3_RPT)) extStatus |= DD_EXT_STATUS_AES3_SLIP; //let's collect ADAT interface lock status. if (adatIsLocked()) extStatus |= DD_EXT_STATUS_ADAT_LOCKED; //let's update the slip information //if (pExtEvents->adat_events & (DAL_CB_ADAT_SLIP | DAL_CB_ADAT_RPT)) extStatus |= DD_EXT_STATUS_ADAT_SLIP; //let's collect AVS interface lock status (for debuggin purposes) if (avsRxIsLocked(AVS_PLUG_ID1)) extStatus |= DD_EXT_STATUS_ARX1_LOCKED; if (avsRxIsLocked(AVS_PLUG_ID2)) extStatus |= DD_EXT_STATUS_ARX2_LOCKED; //let's update the slip information if (pExtEvents->avs_events & (DAL_CB_AVS1_SLIP | DAL_CB_AVS1_RPT)) extStatus |= DD_EXT_STATUS_ARX1_SLIP; if (pExtEvents->avs_events & (DAL_CB_AVS2_SLIP | DAL_CB_AVS2_RPT)) extStatus |= DD_EXT_STATUS_ARX2_SLIP; // At last the most important thing, get the "dal" status and call diceDriver // The diceDriver must know when the device is unlocked and locked so it can perform // proper synchronization of streams. dalGetCurrentStatus (eDAL_INTERFACE_1, &dalStatus); diceDriverSetStatus (dalStatus.state == eDAL_STATE_LOCKED, dalStatus.lockedNominalRate, dalStatus.lockedRateHz, extStatus); // And make sure the codecs gets updated, see function defined above. updateCodec(&dalStatus); // Now some application specific stuff, we do the LED's updateStatusLEDs(); return NO_ERROR; }
static HRESULT myDalCallBack (DAL_CB_EVENT_MASK events, DAL_EVENTS * pExtEvents, uint32 data) { uint16 aesStatus; uint32 extStatus=0; //extended status to the driver DAL_STATUS dalStatus; // We want to tell the avcDriver about the locked status of the clock domain // and sample rate etc. //let's collect AES interface lock status. aesGetStatus (&aesStatus); if (aesStatus & AES_STAT_LOCK0) extStatus |= DD_EXT_STATUS_AES0_LOCKED; if (aesStatus & AES_STAT_LOCK1) extStatus |= DD_EXT_STATUS_AES1_LOCKED; if (aesStatus & AES_STAT_LOCK2) extStatus |= DD_EXT_STATUS_AES2_LOCKED; if (aesStatus & AES_STAT_LOCK3) extStatus |= DD_EXT_STATUS_AES3_LOCKED; //let's update the slip information if (pExtEvents->aes_events & (DAL_CB_AES0_SLIP | DAL_CB_AES0_RPT)) extStatus |= DD_EXT_STATUS_AES0_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES1_SLIP | DAL_CB_AES1_RPT)) extStatus |= DD_EXT_STATUS_AES1_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES2_SLIP | DAL_CB_AES2_RPT)) extStatus |= DD_EXT_STATUS_AES2_SLIP; if (pExtEvents->aes_events & (DAL_CB_AES3_SLIP | DAL_CB_AES3_RPT)) extStatus |= DD_EXT_STATUS_AES3_SLIP; //let's collect ADAT interface lock status. if (adatIsLocked()) extStatus |= DD_EXT_STATUS_ADAT_LOCKED; //let's update the slip information if (pExtEvents->adat_events & (DAL_CB_ADAT_SLIP | DAL_CB_ADAT_RPT)) extStatus |= DD_EXT_STATUS_ADAT_SLIP; //let's collect AVS interface lock status if (avsRxIsLocked(AVS_PLUG_ID1)) extStatus |= DD_EXT_STATUS_ARX1_LOCKED; if (avsRxIsLocked(AVS_PLUG_ID2)) extStatus |= DD_EXT_STATUS_ARX2_LOCKED; if (avsRxIsLocked(AVS_PLUG_ID3)) extStatus |= DD_EXT_STATUS_ARX3_LOCKED; if (avsRxIsLocked(AVS_PLUG_ID4)) extStatus |= DD_EXT_STATUS_ARX4_LOCKED; //let's update the slip information if (pExtEvents->avs_events & (DAL_CB_AVS1_SLIP | DAL_CB_AVS1_RPT)) extStatus |= DD_EXT_STATUS_ARX1_SLIP; if (pExtEvents->avs_events & (DAL_CB_AVS2_SLIP | DAL_CB_AVS2_RPT)) extStatus |= DD_EXT_STATUS_ARX2_SLIP; if (pExtEvents->avs_events & (DAL_CB_AVS3_SLIP | DAL_CB_AVS3_RPT)) extStatus |= DD_EXT_STATUS_ARX3_SLIP; if (pExtEvents->avs_events & (DAL_CB_AVS4_SLIP | DAL_CB_AVS4_RPT)) extStatus |= DD_EXT_STATUS_ARX4_SLIP; // At last the most important thing, get the "dal" status and call diceDriver dalGetCurrentStatus (eDAL_INTERFACE_1, &dalStatus); avcDriverSetStatus (dalStatus.state == eDAL_STATE_LOCKED, dalStatus.lockedNominalRate, dalStatus.lockedRateHz); // Actually now that we are at it, let's indicate lock on an LED if (dalStatus.state == eDAL_STATE_LOCKED) LED_ON(LOCKUP_LED_ID); else LED_OFF(LOCKUP_LED_ID); return NO_ERROR; }
static void dumpADAT(void) { BOOL bEnable; BOOL bLocked; uADATRX_STATUS error; adatRxGetEnable (&bEnable); bLocked = adatIsLocked (); adatRxGetError(&error, TRUE); cliPrintf("ADAT Rx:\n\r"); cliPrintf("\tState : %s\n\r", bEnable ? (bLocked ? "Locked" : "Unlocked") : "Disabled"); cliPrintf("ADAT Errors R=Repeat, S=Slip\n\r"); cliPrintf("\tErrors : %c%c%\n\r", error.bit.u_run ? 'R' : ' ', error.bit.o_run ? 'S' : ' '); cliPrintf("ADAT Rx registers:\n\r"); cliPrintf("\tSETUP : 0x%04x\n\r", pDiceADATRx->setup.reg); cliPrintf("\tSTATUS : 0x%04x\n\r", pDiceADATRx->status.reg); cliPrintf("ADAT Tx registers:\n\r"); cliPrintf("\tUSER_SETUP : 0x%04x\n\r", pDiceADATTx->userSetup.reg); cliPrintf("\tMUX_SETUP : 0x%04x\n\r", pDiceADATTx->muxSetup.reg); cliPrintf("\tCH_MUTE : 0x%04x\n\r", pDiceADATTx->chMute.reg); }