//This function is called at startup (or at mode change). This function will //initialize the DICE<->Codec interface (I2S in this example) and initialize //the codec if necessary. With this AKM codec we just initialize it the first //time it has a good clock in the msgFunc below. HRESULT akm4620_InitI2S (void) { insSetClockPortI2S (INS_ID0, INS_MCK_512BR, true);//always use 512 Base Rate for all modes insRxSetDataFormatI2S (INS_ID0, INS_LN0, true); insRxSetDataFormatI2S (INS_ID0, INS_LN1, true); insTxSetDataFormatI2S (INS_ID0, INS_LN0, true); insTxSetDataFormatI2S (INS_ID0, INS_LN1, true); return NO_ERROR; }
static HRESULT initMode(uint32 initFlags) { bInitFlags = initFlags; //this mode uses all ports as InS targetChangeAudioPorts (APM_ALL_INS); //this mode uses I2S on all ports, 512xBase rate insSetClockPortI2S (INS_ID0, INS_MCK_512BR, true);//always use 512 Base Rate for all modes insRxSetDataFormatI2S (INS_ID0, INS_LN0, true); insRxSetDataFormatI2S (INS_ID0, INS_LN1, true); insRxSetDataFormatI2S (INS_ID0, INS_LN2, true); insRxSetDataFormatI2S (INS_ID0, INS_LN3, true); insSetClockPortI2S (INS_ID1, INS_MCK_512BR, true);//always use 512 Base Rate for all modes insRxSetDataFormatI2S (INS_ID1, INS_LN0, true); insRxSetDataFormatI2S (INS_ID1, INS_LN1, true); insRxSetDataFormatI2S (INS_ID1, INS_LN2, true); insRxSetDataFormatI2S (INS_ID1, INS_LN3, true); insTxSetDataFormatI2S (INS_ID0, INS_LN0, true); insTxSetDataFormatI2S (INS_ID0, INS_LN1, true); insTxSetDataFormatI2S (INS_ID0, INS_LN2, true); insTxSetDataFormatI2S (INS_ID0, INS_LN3, true); insTxSetDataFormatI2S (INS_ID1, INS_LN0, true); insTxSetDataFormatI2S (INS_ID1, INS_LN1, true); insTxSetDataFormatI2S (INS_ID1, INS_LN2, true); insTxSetDataFormatI2S (INS_ID1, INS_LN3, true); return NO_ERROR; }
static HRESULT initMode(uint32 initFlags) { bInitFlags = initFlags; insSetClockPortI2S (INS_ID0, INS_MCK_512BR, true);//always use 512 Base Rate for all modes insRxSetDataFormatI2S (INS_ID0, INS_LN0, true); insRxSetDataFormatI2S (INS_ID0, INS_LN1, true); insRxSetDataFormatI2S (INS_ID0, INS_LN2, true); insRxSetDataFormatI2S (INS_ID0, INS_LN3, true); insSetClockPortI2S (INS_ID1, INS_MCK_512BR, true);//always use 512 Base Rate for all modes insRxSetDataFormatI2S (INS_ID1, INS_LN0, true); insRxSetDataFormatI2S (INS_ID1, INS_LN1, true); insRxSetDataFormatI2S (INS_ID1, INS_LN2, true); insRxSetDataFormatI2S (INS_ID1, INS_LN3, true); insTxSetDataFormatI2S (INS_ID0, INS_LN0, true); insTxSetDataFormatI2S (INS_ID0, INS_LN1, true); insTxSetDataFormatI2S (INS_ID0, INS_LN2, true); insTxSetDataFormatI2S (INS_ID0, INS_LN3, true); insTxSetDataFormatI2S (INS_ID1, INS_LN0, true); insTxSetDataFormatI2S (INS_ID1, INS_LN1, true); insTxSetDataFormatI2S (INS_ID1, INS_LN2, true); insTxSetDataFormatI2S (INS_ID1, INS_LN3, true); return NO_ERROR; }
HRESULT akm4384_InitI2S (void) { insSetClockPortI2S (INS_ID0, INS_MCK_512BR, true); insTxSetDataFormatI2S (INS_ID0, INS_LN0, true); insRxSetDataFormatI2S (INS_ID0, INS_LN0, true); return NO_ERROR; }
static void myAppInitI2S (void) { insSetClockPort (INS_ID0, INS_MCK_512BR, INS_BCK_64FS, INS_FSYN_LEN_32BIT, 1, 1, 1, true); insRxSetDataFormatI2S (INS_ID0, INS_LN0, true); insTxSetDataFormatI2S (INS_ID0, INS_LN0, true); }