]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/audio-preprocessing.git/blobdiff - file_demo_bios/am572x/components/sysasnr.c
file_demo_bios/am57xx: use the common folder for all the shared files; change to...
[processor-sdk/audio-preprocessing.git] / file_demo_bios / am572x / components / sysasnr.c
diff --git a/file_demo_bios/am572x/components/sysasnr.c b/file_demo_bios/am572x/components/sysasnr.c
deleted file mode 100644 (file)
index 7cbbeac..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, 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.
- *
- */
-\r
-/*=================================================================\r
- *  sysasnr.c: ASNR creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-#include <ti/mas/vpe/asnr.h>\r
-\r
-#include "sys.h"\r
-\r
-asnrSizeConfig_t asnrSizeConfig = {\r
-  asnr_SRATE_16K      /* 16kHz sampling rate */\r
-};\r
-\r
-asnrOpenConfig_t asnrOpenConfig = {\r
-  asnr_SRATE_16K      /* use 16kHz sampling rate */\r
-};\r
-\r
-/*=================================================================\r
- *  void sysAsnrCreate(void)     Create ASNR's within virtual mics\r
- *=================================================================*/\r
-void sysAsnrCreate(void)\r
-{\r
-  int k, err;\r
-  tint nbufs;\r
-  const ecomemBuffer_t  *bufs;\r
-  asnrNewConfig_t asnrNewConfig;\r
-  asnrControl_t   asnrCtl;\r
-\r
-  System_printf("...Initializing ASNR's\n");\r
-  System_flush();\r
-\r
-  /* Configure ASNR's (use same configuration for all) */\r
-  err = asnrGetSizes(&nbufs, &bufs, &asnrSizeConfig);\r
-  if (err != asnr_NOERR) {\r
-    System_printf("*** ASNR's getsizes error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-  /* Allocate memory for ASNR's */\r
-  if (nbufs > SYS_COMP_MAXBUFS) {\r
-    System_printf("*** not enough buffer descriptors");\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  asnrNewConfig.sizeCfg = asnrSizeConfig;   /* Use same configuration for all */\r
-  for (k = 0; k < sysContext.nvmics; k++) {\r
-    err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
-    SYS_CHECK_ERROR(err);\r
-  \r
-    /* Give memory to ASNR #k */\r
-    asnrNewConfig.handle = (void*)k;        /* Indicate ASNR instance #k */\r
-    sysContext.asnrInst_p[k] = NULL;\r
-    err = asnrNew(&sysContext.asnrInst_p[k], nbufs, sysCompBufs, &asnrNewConfig);\r
-    if (err != asnr_NOERR) {\r
-      System_printf("*** ASNR #%d new error: %d\n", k, err);\r
-      BIOS_exit(0);\r
-    }\r
-  }\r
-\r
-  /* Open ASNR for business */\r
-  for (k = 0; k < sysContext.nvmics; k++) {\r
-    err = asnrOpen(sysContext.asnrInst_p[k],&asnrOpenConfig);\r
-    if (err != asnr_NOERR) {\r
-      System_printf("*** ASNR #%d open error: %d\n", k, err);\r
-      BIOS_exit(0);\r
-    }\r
-  }\r
-  /* At this point ASNR's are open, but may need additional configuration */\r
-\r
-  /* Here we reconfigure the ASNR */\r
-  asnrCtl.valid_bitfield  = (asnr_CTL_VALID_BAND1_MAX_ATTEN |\r
-                             asnr_CTL_VALID_BAND2_MAX_ATTEN |\r
-                             asnr_CTL_VALID_BAND3_MAX_ATTEN);\r
-  asnrCtl.band1_max_atten = 12;\r
-  asnrCtl.band2_max_atten = 9;\r
-  asnrCtl.band3_max_atten = 6;\r
-  for (k = 0; k < sysContext.nvmics; k++) {\r
-    err = asnrControl (sysContext.asnrInst_p[k], &asnrCtl);\r
-    if (err != asnr_NOERR) {\r
-      System_printf("*** ASNR #%d control error: %d\n", k, err);\r
-      BIOS_exit(0);\r
-    }\r
-  }\r
-\r
-  System_printf("Done with ASNR's\n");\r
-  System_flush();\r
-\r
-} /* sysAsnrCreate */\r
-\r
-/* nothing past this point */\r
-\r