Functions
csl_aif2HwSetup.c File Reference

AIF2 HW setup CSL 3.x function. More...

#include <ti/csl/csl_aif2.h>
#include <ti/csl/csl_aif2HwSetupAux.h>

Functions

CSL_Status CSL_aif2HwSetup (CSL_Aif2Handle hAif2, CSL_Aif2Setup *aif2Setup)

Detailed Description

AIF2 HW setup CSL 3.x function.

===========================================================================


Function Documentation

CSL_Status CSL_aif2HwSetup ( CSL_Aif2Handle  hAif2,
CSL_Aif2Setup *  aif2Setup 
)

============================================================================
CSL_aif2HwSetup

Description
It configures the AIF2 instance registers as per the values passed in the hardware setup structure.

Arguments

            hAif2        Handle to the AIF2 instance

            aif2Setup       Pointer to hardware setup structure
     

Return Value CSL_Status

  • CSL_SOK - Hardware setup successful.
  • CSL_ESYS_BADHANDLE - Invalid handle
  • CSL_ESYS_INVPARAMS - Hardware structure is not properly initialized

Pre Condition
Both CSL_aif2Init() and CSL_aif2Open() must be called successfully in that order before CSL_aif2HwSetup() can be called. The user has to allocate space for & fill in the main setup structure appropriately before calling this function.

Post Condition
The specified instance will be setup according to value passed.

Writes
The hardware registers of AIF2.

Example

          CSL_Aif2Handle handleAif2;
          
          CSL_Aif2Obj Aif2Obj;
          //AIF module specific parameters
          CSL_Aif2Param  aif2Param;
          // CSL status
          CSL_Status status;
          // global config for AIF2 
          CSL_Aif2GlobalSetup gblCfg = {…};

          // Setup objects for global configuring  
          CSL_Aif2GlobalSetup GlobalConfig;
          // Setup for common params  
          CSL_Aif2CommonSetup commoncfg= {CSL_AIF2_LINK_0};
          // Setup for link 
          CSL_Aif2Setup Config = {…};
   
          // Open handle - for use 
          handleAif2 = CSL_aif2Open(&Aif2Obj, CSL_AIF2, &aif2Param, &status);

          if ((handleAif2 == NULL) || (status != CSL_SOK)) 
          {
             printf ("\nError opening CSL_AIF2");
             exit(1);
          }

          // Do config 
          Config.globalSetup = &gblCfg;
          Config.commonSetup = &commoncfg;
          Config.linkSetup = &linkCfg;
       
          //Do setup 
          CSL_aif2HwSetup(handleAif2, &Config);
     

=============================================================================

Parameters:
hAif2Pointer to the object that holds reference to the instance of AIF2 link requested after the call
aif2SetupPointer to setup structure which contains the information to program AIF2 to a useful state

Copyright 2014, Texas Instruments Incorporated