Ejemplo n.º 1
0
static void myAppCreateHighRateDAL(void)
{
    cliPrintf("high rate dal.\n\r");

    if(PreviousDAL)
        dalUninstallCallback(myDalCallBack);

    //Let's build our audio configuration with "dal", We want to allow all rates above 96KHz
    dalCreateInterface(eDAL_INTERFACE_1, eDAL_RATE_MODE_HIGH, MY_INPUT_DEVICES_HIGH, MY_OUTPUT_DEVICES_HIGH);
    //default we will run at internal rate 48KHz, the computer will change that when attached
    dalSetClockSource (eDAL_INTERFACE_1, eDAL_CLK_SRC_AVS_SYT1, eDAL_NOMINAL_RATE_192);
    //we need to setup our routing
    //let the 4 AES channels take data from the first Isoc receiver
    dalSetRoute(eDAL_INTERFACE_1, TX_AES_CH0_3, RX_AVS1_CH0_3);
    //let the first 8 Isoc 1 transmitter channels take data from the 8 AES channels
    dalSetRoute(eDAL_INTERFACE_1, TX_AVS1_CH0_3, RX_AES_CH0_3);
    //the call back function defined above needs to be installed into "dal"
    dalInstallCallback(&myDalSubscribedEvents, 200, myDalCallBack, 0);
    //configure device for MIDI based on a function in targetBoard. For the EVAL
    //board this is determined by DIP SW 1
    myAvcDriverTxConfigLow[0].midiChannels = 1;
    myAvcDriverRxConfigLow[0].midiChannels = 1;

    avcDriverConfigure (myAvcDriverTxConfigLow, MY_NB_TX_ISOC_STREAMS_HIGH,
                        myAvcDriverRxConfigLow, MY_NB_RX_ISOC_STREAMS_HIGH,
                        myAvcDriverCallBack);

    myAppInitializeI2S();
    myAppSetI2SHigh();
    // now we are ready to start the whole thing, it actually wont start until we return from
    // this function as threads are not enabled yet. If we want to have some code running after
    // this we need to create a thread. We don't need that here, our call backs will do things
    // for us.
    dalStartInterface(eDAL_INTERFACE_1);
}
Ejemplo n.º 2
0
// This function is called when the system is initializing. At this point no threads are running and no audio is
// passed. When 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;	

	//Enable Automatic Hi/Lo detection in AES receiver for stand-alone mode.
	aesRxAutoHiLo (TRUE);	
	
	// Initialize the SPI devices (targetBoard.c)
	targetSpiInit();

	//initialize audio ports
	akm4384_InitI2S (); 	
	
	//configure static part of driver
	diceDriverConfigureInitial   (MY_DEVICE_NICK_NAME,
								  myDiceDriverCallBack,
							      DEVICE_SUPPORTED_CLK_CAPS,
							      DEVICE_SUPPORTED_CLK_SRC_NAMES);

	//Initialize eap.
	eapInitializeInterface(&eapInitDesc); //actually configures router, but that is overwritten by stand alone mode init later
	
	//create the call back from DAL
	dalInstallCallback(&myDalSubscribedEvents, 200, myDalCallBack, 0);
	
		
	//Creates the appropriate DAL
	StandAloneInitialize (); //routing still not done, will be done in DAL callback

#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;
}
Ejemplo n.º 3
0
// 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;
}