// This function handles the rate change request from the driver. // If the rate mode has changed it will create a new DAL. static HRESULT myAppChangeSR(DICE_DRIVER_CB_DATA * pData) { HRESULT hResult = NO_ERROR; uint32 notify = 0; DAL_RATE_MODE_ENUM driverRateMode; driverRateMode = dalRateByID(pData->rate)->rateMode; if (driverRateMode != lastDriverRatemode) { //Driver asked for a change of rate mode lastDriverRatemode = driverRateMode; myAppCreateDAL(driverRateMode); // Send the RX and TX Configuration Notification as this might // have resulted in a change of the Rx and Tx streams going // to the computer. This will for example happen if the device // has ADAT, when going from 48k to 96k ADAT will be reduced // to 4 channels (SMUXII) notify |= DD_NOTIFY_RX_CFG_CHG_BIT | DD_NOTIFY_TX_CFG_CHG_BIT; } //Change the Clock as instructed by driver, this could be a change //in clock source, nominal rate or both. dalSetClockSource (eDAL_INTERFACE_1, pData->source, pData->rate); //Send the Clock Setting Accept Notification, this should always be send notify |= DD_NOTIFY_CLOCK_ACP; diceDriverNotifyHost(notify); return hResult; }
// This function is called when the system is initializing. At this point no threads are running and no audio is // passed. After this function returns all threads are started. It is not legal to wait on semaphores etc at this // point in the initialization sequence. HRESULT myAppInitialize(void) { HRESULT hResult = NO_ERROR; // Initialize the SPI devices (targetBoard.c) targetSpiInit(); // Show the initial switch settings //Initialize the persistent storage system and check the stored mode hResult = spsInitialize ("am_sps", 2, sizeof(evmCfg), &evmCfg, 100); if (hResult!=NO_ERROR) { sysLogError(hResult, __LINE__, __FILE__); } if (evmCfg.hpgain > 38) evmCfg.hpgain = 38; //Initialize the mode abstraction system pCurrentMode = &modeCfg0_Mini; pCurrentMode->fInit(0); //create the call back from DAL dalInstallCallback(&myDalSubscribedEvents, 200, myDalCallBack, 0); //Create Low Rate DAL for default initialization myAppCreateDAL(eDAL_RATE_MODE_LOW); #ifdef _AML myAppAMLInitialize(); #endif //Set flag for creation of DAL // After application initialization is done resume tasks to start them hResult = myAppResumeTasks(); if (hResult != NO_ERROR) return hResult; // If the developer wishes to add Command Line Interface, define _CLI_TOOL_MYAPP in make.params #ifdef _CLI_TOOL_MYAPP myAppCliInstallTools(); #endif //_CLI_TOOL_MYAPP return hResult; }