]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pdk_k2g_1_0_1/packages/ti/platform/evmk2g/platform_audio_test/analog/loopback/src/main.c
Change pdk_k2g_1_0_1 directory name in preparation for updating RSTC plugin
[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1 / packages / ti / platform / evmk2g / platform_audio_test / analog / loopback / src / main.c
diff --git a/pdk_k2g_1_0_1/packages/ti/platform/evmk2g/platform_audio_test/analog/loopback/src/main.c b/pdk_k2g_1_0_1/packages/ti/platform/evmk2g/platform_audio_test/analog/loopback/src/main.c
deleted file mode 100644 (file)
index 8d373a9..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 2015, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * *  Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * *  Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * *  Neither the name of Texas Instruments Incorporated nor the names of
- *    its contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/**
- * \file      main.c
- *
- * \brief     Audio DC analog test main file
- *
- *  Audio analog test verifies the functionality of ADC and DAC available on
- *  audio daughter card. During this test, data received from ADC will be
- *  sent to DAC. There are two instances of DAC and ADC available on
- *  audio daughter card. One ADC supports 4 analog channels and one DAC
- *  supports 8 analog channels. Data received from one DAC shall be sent
- *  to both the ADCs making 8 channel Rx/Tx. Each DAC should be validated
- *  separately.
- *
- */
-
-#include "analog_test.h"
-
-/* ADC default configuration parameters */
-AdcConfig adcCfg =
-{
-       80,                  /* ADC gain */
-       ADC_INL_SE_VINL1,    /* Left input mux for ADC1L */
-       ADC_INL_SE_VINL2,    /* Left input mux for ADC2L */
-       ADC_INR_SE_VINR1,    /* Right input mux for ADC1R */
-       ADC_INR_SE_VINR2,    /* Right input mux for ADC2R */
-       ADC_RX_WLEN_24BIT,   /* ADC word length */
-       ADC_DATA_FORMAT_I2S, /* ADC data format */
-       0
-};
-
-/* DAC default configuration parameters */
-DacConfig  dacCfg =
-{
-       DAC_AMUTE_CTRL_SCKI_LOST,   /* Amute event */
-       0,                          /* Amute control */
-       DAC_SAMPLING_MODE_AUTO,     /* Sampling mode */
-       DAC_DATA_FORMAT_I2S,        /* Data format */
-       0,                          /* Soft mute control */
-       DAC_ATTENUATION_WIDE_RANGE, /* Attenuation mode */
-       DAC_DEEMP_44KHZ,            /* De-emph control */
-       80                          /* Volume */
-};
-
-void McaspDevice_init(void);
-
-/**
- *  \brief    Initializes platform specific modules
- *
- *  This function initializes the modules like PLL, DDR, I2C etc
- *  which are required for audio processing. Need to call this function
- *  before doing any HW related operations.
- *
- *  \return    Platform_EOK on Success or error code
- */
-Platform_STATUS initPlatform(void)
-{
-    platform_init_flags  init_flags;
-    platform_init_config init_config;
-       Platform_STATUS status;
-
-       /* Set request to configure PLL, DDR and Time Stamp Counter */
-       init_flags.pll  = 1;
-       init_flags.ddr  = 0;
-       init_flags.tcsl = 1;
-       init_flags.phy  = 0;
-       init_flags.ecc  = 0;
-
-       /* PLL configuration shall be done based on default values */
-    init_config.pllm       = 0;
-    init_config.plld       = 0;
-    init_config.postdiv    = 0;
-    init_config.mastercore = 1;
-
-       status = platform_init(&init_flags, &init_config);
-    if (status != Platform_EOK)
-    {
-       printf("Error in Platform Initialization\n");
-       return(status);
-    }
-
-       pinMuxSetMode(125, PADCONFIG_MUX_MODE_QUATERNARY);
-       gpioSetDirection(GPIO_PORT_1, 54, GPIO_OUT);
-       gpioSetOutput(GPIO_PORT_1, 54);
-
-       /* Configure platform log messages to standard printf */
-    platform_write_configure(PLATFORM_WRITE_UART);
-
-    /* Initialize UART */
-    platform_uart_init();
-    platform_uart_set_baudrate(115200);
-
-    return(status);
-}
-
-/**
- *  \brief    Audio analog test main function
- *
- *  \return    none
- */
-void main (void)
-{
-       Platform_STATUS status;
-
-       status = initPlatform();
-       if(status != Platform_EOK)
-       {
-               platform_write("Platform Init Failed!\n");
-               testRet(1);
-       }
-
-       platform_delay(10000);
-
-
-
-       platform_write("\n******************************************\n");
-       platform_write(  "      Audio DC Analog Loopback Test       \n");
-    platform_write(  "******************************************\n");
-
-#ifdef AUDIO_DAC0_TEST
-    platform_write("\nTest Verifies ADC and DAC Channels 0 to 3\n");
-       platform_write("Test Runs in Audio Loopback Mode\n");
-       platform_write("Confirm that ADC Input Audio is Played at DAC Channels 0 to 3\n");
-
-       platform_write("\nAudio Connection Details\n");
-#ifdef K2G_ALPHA_EVM_BUILD
-       platform_write("**************************************\n");
-       platform_write("ADC1_STEREO_IN1 ==> DAC0_STEREO_OUT1\n");
-       platform_write("ADC1_STEREO_IN2 ==> DAC0_STEREO_OUT2\n");
-       platform_write("ADC2_STEREO_IN1 ==> DAC0_STEREO_OUT3\n");
-       platform_write("ADC2_STEREO_IN2 ==> DAC0_STEREO_OUT4\n");
-       platform_write("**************************************\n");
-#else
-       platform_write("**************************************\n");
-       platform_write("ADC_IN 0 ==> DAC_OUT 0\n");
-       platform_write("ADC_IN 1 ==> DAC_OUT 1\n");
-       platform_write("ADC_IN 2 ==> DAC_OUT 2\n");
-       platform_write("ADC_IN 3 ==> DAC_OUT 3\n");
-       platform_write("**************************************\n");
-#endif
-
-#else
-
-    platform_write("\nTest Verifies ADC Channels 0 to 3 and DAC Channels 4 to 7\n");
-       platform_write("Test Runs in Audio Loopback Mode\n");
-       platform_write("Confirm that ADC Input Audio is Played at DAC Channels 4 to 7\n");
-
-       platform_write("\nAudio Connection Details\n");
-#ifdef K2G_ALPHA_EVM_BUILD
-       platform_write("**************************************\n");
-       platform_write("ADC1_STEREO_IN1 ==> DAC1_STEREO_OUT1\n");
-       platform_write("ADC1_STEREO_IN2 ==> DAC1_STEREO_OUT2\n");
-       platform_write("ADC2_STEREO_IN1 ==> DAC1_STEREO_OUT3\n");
-       platform_write("ADC2_STEREO_IN2 ==> DAC1_STEREO_OUT4\n");
-       platform_write("**************************************\n");
-#else
-       platform_write("**************************************\n");
-       platform_write("ADC_IN 0 ==> DAC_OUT 4\n");
-       platform_write("ADC_IN 1 ==> DAC_OUT 5\n");
-       platform_write("ADC_IN 2 ==> DAC_OUT 6\n");
-       platform_write("ADC_IN 3 ==> DAC_OUT 7\n");
-       platform_write("**************************************\n");
-#endif
-
-#endif
-
-       /* Initialize McASP HW details */
-       McaspDevice_init();
-
-       /* Configure eDMA module */
-       status = eDmaConfig();
-       if(status != Platform_EOK)
-       {
-               platform_write("eDMA Configuration Failed!\n");
-               testRet(1);
-       }
-
-       /* Initialize common audio configurations */
-       status = platformAudioInit();
-       if(status != Platform_EOK)
-       {
-               platform_write("Audio Init Failed!\n");
-               testRet(1);
-       }
-
-       /* Initialize Audio ADC module */
-       status = audioAdcConfig(ADC_DEVICE_ALL, &adcCfg);
-       if(status != Platform_EOK)
-       {
-               platform_write("Audio ADC Configuration Failed!\n");
-               testRet(1);
-       }
-
-       /* Initialize McASP module */
-       status = mcaspAudioConfig();
-       if(status != Platform_EOK)
-       {
-               platform_write("McASP Configuration Failed!\n");
-               testRet(1);
-       }
-
-       /* Start BIOS execution */
-       BIOS_start();
-}
-
-/**
- *  \brief    Configures audio DAC module
- *
- *  \return    none
- */
-void configAudioDAC(void)
-{
-       Platform_STATUS status;
-
-       /* Initialize Audio DAC module */
-       status = audioDacConfig(DAC_DEVICE_ALL, &dacCfg);
-       if(status != Platform_EOK)
-       {
-               platform_write("Audio DAC Configuration Failed!\n");
-               testRet(1);
-       }
-}
-
-/* Nothing past this point */