]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/audio-preprocessing.git/blobdiff - file_demo_bios/k2g/components/sysvau.c
file_demo_bios/k2g: move the shared code to common folder, add file_io.gel
[processor-sdk/audio-preprocessing.git] / file_demo_bios / k2g / components / sysvau.c
diff --git a/file_demo_bios/k2g/components/sysvau.c b/file_demo_bios/k2g/components/sysvau.c
deleted file mode 100644 (file)
index d27b3b3..0000000
+++ /dev/null
@@ -1,118 +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
- *  sysvau.c: VAU 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/vau/vau.h>\r
-\r
-#include "sys.h"\r
-\r
-vauSizeConfig_t vauSizeConfig = {\r
-  SYS_FRAME_LENGTH,     /* 10ms frames (160 samples) */\r
-  vau_SAMP_RATE_16KHZ   /* 16kHz sampling rate */\r
-};\r
-\r
-vauOpenConfig_t vauOpenConfig = {\r
-  SYS_FRAME_LENGTH,     /* use 160 sample frames */\r
-  vau_SAMP_RATE_16KHZ,  /* use 16kHz sampling rate */\r
-  { 0, 0, 0, 0, 0}      /* Do not reconfigure defaults */\r
-};\r
-\r
-/*=================================================================\r
- *  void sysVauCreate(void)     Create VAU instance\r
- *=================================================================*/\r
-void sysVauCreate(void)\r
-{\r
-  int err;\r
-  tint nbufs;\r
-  const ecomemBuffer_t  *bufs;\r
-  ifvauControl_t    vauCtl;\r
-\r
-  System_printf("...Initializing VAU\n");\r
-  System_flush();\r
-\r
-  /* Configure VAU */\r
-  err = vauGetSizes(&nbufs, &bufs, &vauSizeConfig);\r
-  if (err != vau_NOERR) {\r
-    System_printf("*** VAU getsizes error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-  /* Allocate memory for VAU */\r
-  if (nbufs > SYS_COMP_MAXBUFS) {\r
-    System_printf("*** not enough buffer descriptors");\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
-  SYS_CHECK_ERROR(err);\r
-  \r
-  /* Give memory to VAU */\r
-  sysContext.vauInst_p = NULL;\r
-  err = vauNew(&sysContext.vauInst_p, nbufs, sysCompBufs);\r
-  if (err != vau_NOERR) {\r
-    System_printf("*** VAU #%d new error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  /* Open VAU for business */\r
-  err = vauOpen(sysContext.vauInst_p,&vauOpenConfig);\r
-  if (err != vau_NOERR) {\r
-    System_printf("*** VAU open error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-  /* At this point VAU is open, but may need additional configuration */\r
-\r
-  /* Here we enable VAU */\r
-  vauCtl.valid_params = ifvau_VALID_CONTROL;\r
-  vauCtl.control      = ifvau_ENABLE;\r
-  err = vauControl (sysContext.vauInst_p, NULL, &vauCtl);\r
-  if (err != vau_NOERR) {\r
-    System_printf("*** VAU control error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  System_printf("Done with VAU\n");\r
-  System_flush();\r
-\r
-} /* sysVauCreate */\r
-\r
-/* nothing past this point */\r
-\r