Circular buffer read cleanup from Build #38 (work on PASDK-53).
authorFrank Livingston <frank-livingston@ti.com>
Sat, 4 Mar 2017 00:31:41 +0000 (18:31 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Sat, 4 Mar 2017 00:31:41 +0000 (18:31 -0600)
GPIO debug.
This helps 192 kHz & SRC 4:1 to "work" in some circumstances w/ CAR
enabled for 7.1.4 upmix.

pasdk/common/evmc66x_gpio_dbg.c [new file with mode: 0644]
pasdk/common/evmc66x_gpio_dbg.h [new file with mode: 0644]
pasdk/test_arm/.cproject
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_dsp/.cproject
pasdk/test_dsp/framework/audioStreamOutProc.c
pasdk/test_dsp/framework/systemInit.c

diff --git a/pasdk/common/evmc66x_gpio_dbg.c b/pasdk/common/evmc66x_gpio_dbg.c
new file mode 100644 (file)
index 0000000..cab90dc
--- /dev/null
@@ -0,0 +1,505 @@
+/*
+ * Copyright (c) 2010-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   evmc66x_gpio.c
+ *
+ * \brief  This file contains the lower level functions to access GPIO
+ *
+ *****************************************************************************/
+
+/************************
+ * Include Files
+ ************************/
+
+#include "evmc66x_gpio_dbg.h"
+//#include "platform_internal.h"
+
+//#if (PLATFORM_GPIO_IN)
+
+/**
+ * \brief  This function performs different control operations on GPIO
+ *
+ * \param   gpioPortNumber [IN]     GPIO port number
+ * \param   pinNum         [IN]     GPIO pin number
+ * \param   ctrlCmd        [IN]     Command to indicate action to perform
+ * \n                               Use below macros as input for 'ctrlCmd'
+ * \n        GPIO_CTRL_SET_DIR       - Command to set GPIO pin direction
+ * \n        GPIO_CTRL_SET_OUTPUT    - Command to set GPIO pin output
+ * \n        GPIO_CTRL_CLEAR_OUTPUT  - Command to clear GPIO pin output
+ * \n        GPIO_CTRL_READ_INPUT    - Command to read GPIO pin input
+ * \n        GPIO_CTRL_SET_RE_INTR   - Command to set rising edge interrupt
+ * \n        GPIO_CTRL_CLEAR_RE_INTR - Command to clear rising edge interrupt
+ * \n        GPIO_CTRL_SET_FE_INTR   - Command to set falling edge interrupt
+ * \n        GPIO_CTRL_CLEAR_FE_INTR - Command to clear falling edge interrupt
+ *
+ * \param   ctrlData       [IN/OUT] Data to be manipulated by the command
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+static GPIO_RET GPIO_ctrl(uint8_t gpioPortNumber, uint8_t pinNum,
+                          uint8_t ctrlCmd, void *ctrlData)
+{
+       GPIO_RET       retVal;
+    uint8_t        bankIndex;
+    uint8_t        bitPos;
+    CSL_GpioHandle hGpio;
+    GpioDirection  direction;
+
+    retVal = GPIO_RET_OK;
+
+    if(pinNum < GPIO_MAX_NUMBER)
+    {
+               hGpio = GPIOGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       bankIndex = pinNum / GPIO_PINS_PER_BANK;
+                       bitPos    = pinNum % GPIO_PINS_PER_BANK;
+
+                       switch(ctrlCmd)
+                       {
+                               /* Command to set GPIO pin direction */
+                case GPIO_CTRL_SET_DIR:
+                        direction = *((GpioDirection*)ctrlData);
+                                        if     (direction == GPIO_IN)
+                                        {
+                                               hGpio->BANK_REGISTERS[bankIndex].DIR |= 1 << bitPos;
+                                        }
+                                        else
+                                        {
+                                               hGpio->BANK_REGISTERS[bankIndex].DIR &= ~(1 << bitPos);
+                                        }
+                        break;
+
+                               /* Command to set GPIO pin output */
+                case GPIO_CTRL_SET_OUTPUT:
+                        hGpio->BANK_REGISTERS[bankIndex].SET_DATA = 1 << bitPos;
+                        break;
+
+                               /* Command to clear GPIO pin output */
+                case GPIO_CTRL_CLEAR_OUTPUT:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_DATA = 1 << bitPos;
+                        break;
+
+                               /* Command to read GPIO pin input */
+                case GPIO_CTRL_READ_INPUT:
+                        *(uint8_t*)ctrlData =
+                              CSL_FEXTR (hGpio->BANK_REGISTERS[bankIndex].IN_DATA,
+                                         bitPos, bitPos);
+                        break;
+
+                               /* Command to set rising edge interrupt */
+                case GPIO_CTRL_SET_RE_INTR:
+                        CSL_FINSR (hGpio->BANK_REGISTERS[bankIndex].SET_RIS_TRIG,
+                                   bitPos, bitPos, 1);
+                        break;
+
+                               /* Command to clear rising edge interrupt */
+                case GPIO_CTRL_CLEAR_RE_INTR:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_RIS_TRIG |= 1 << pinNum;
+                        break;
+
+                               /* Command to set falling edge interrupt */
+                case GPIO_CTRL_SET_FE_INTR:
+                        CSL_FINSR (hGpio->BANK_REGISTERS[bankIndex].SET_FAL_TRIG,
+                                   bitPos, bitPos, 1);
+                        break;
+
+                               /* Command to clear falling edge interrupt */
+                case GPIO_CTRL_CLEAR_FE_INTR:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_FAL_TRIG |=  1 << pinNum;
+                        break;
+
+                default:
+                        retVal = GPIO_RET_FAIL;
+                        break;
+                       }
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} //gpio_ctrl
+
+/**
+ * \brief  Returns base address of given GPIO port number.
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return CSL_GpioHandle\n
+ *
+ */
+CSL_GpioHandle GPIOGetRegBaseAddr(uint8_t gpioPortNumber)
+{
+       CSL_GpioHandle addr;
+
+       switch(gpioPortNumber)
+       {
+               case GPIO_PORT_0:
+                       addr = (CSL_GpioHandle)CSL_GPIO_0_REGS;
+                       break;
+
+               case GPIO_PORT_1:
+                       addr = (CSL_GpioHandle)CSL_GPIO_1_REGS;
+                       break;
+
+               default :
+                       addr = NULL;
+                       break;
+       }
+
+       return (addr);
+
+}  //gpioGetRegBaseAddr
+
+/**
+ * \brief  Initializes the GPIO peripheral
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ *
+ */
+GPIO_RET GPIOInit(uint8_t gpioPortNumber)
+{
+       GPIO_RET    retVal;
+    uint8_t     bankNum;
+    uint8_t     pinNum;
+
+       retVal = GPIO_RET_OK;
+
+    if (gpioPortNumber <= GPIO_PORT_1)
+    {
+               /* Disable the GPIO global interrupts */
+               /*for (bankNum = 0; bankNum < GPIO_MAX_BANKS; bankNum++)
+               {
+                       gpioDisableGlobalInterrupt(gpioPortNumber, bankNum);
+               }*/
+
+           /* Clear all falling edge trigger and rising edge trigger */
+          /* for (pinNum = 0; pinNum < GPIO_MAX_NUMBER; pinNum++)
+           {
+            gpioClearFallingEdgeInterrupt(gpioPortNumber, pinNum);
+            gpioClearRisingEdgeInterrupt(gpioPortNumber, pinNum);
+        }*/
+       }
+       else
+       {
+               retVal = INVALID_GPIO_PORT;
+       }
+
+       return (retVal);
+
+} //gpioInit
+
+/**
+ * \brief  This function configures the specified GPIO's direction
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ * \param   direction      [IN]    GPIO pin direction
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetDirection(uint8_t gpioPortNumber, uint8_t pinNum,
+                          GpioDirection direction)
+{
+       GPIO_RET    retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_DIR, &direction);
+
+       return (retVal);
+
+} //gpioSetDirection
+
+/**
+ * \brief  This function sets the specified GPIO's pin state to 1
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetOutput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_OUTPUT, NULL);
+
+       return (retVal);
+
+} //gpioSetOutput
+
+/**
+ * \brief  This function Clears the specified GPIO's pin state to 0
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOClearOutput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_OUTPUT, NULL);
+
+       return (retVal);
+
+} //gpioClearOutput
+
+/**
+ * \brief  This function gets the specified GPIO's pin state
+ *
+ * The specified GPIO should be configured as input
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      uint32_t - Input state of GPIO if success
+ * \n                          - else GPIO status
+ */
+uint32_t GPIOReadInput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+    uint8_t  inData = 0;
+    uint32_t retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_READ_INPUT, &inData);
+       if(GPIO_RET_OK == retVal)
+       {
+               if( ( inData & GPIO_HIGH ) == GPIO_HIGH )
+               {
+                       retVal = GPIO_HIGH;
+               }
+               else
+               {
+                       retVal = GPIO_LOW;
+               }
+       }
+
+       return(retVal);
+
+} //gpioReadInput
+
+/**
+ * \brief  This function Enables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+/*GPIO_RET gpioEnableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum)
+{
+       GPIO_RET       retVal;
+       CSL_GpioHandle hGpio;
+
+       retVal = GPIO_RET_OK;
+
+       if(bankNum <= GPIO_MAX_BANKS)
+       {
+               hGpio = gpioGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       CSL_GPIO_bankInterruptEnable(hGpio, bankNum);
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} *///gpioEnableGlobalInterrupt
+
+/**
+ * \brief  This function Disables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+/*GPIO_RET gpioDisableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum)
+{
+       GPIO_RET       retVal;
+       CSL_GpioHandle hGpio;
+
+       retVal = GPIO_RET_OK;
+
+       if(bankNum <= GPIO_MAX_BANKS)
+       {
+               hGpio = gpioGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       CSL_GPIO_bankInterruptDisable(hGpio, bankNum);
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} *///gpioDisableGlobalInterrupt
+
+/**
+ * \brief  This function sets specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioSetRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_RE_INTR, NULL);
+
+       return (retVal);
+
+} *///gpioSetRisingEdgeInterrupt
+
+/**
+ * \brief  This function clears specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioClearRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_RE_INTR, NULL);
+
+       return (retVal);
+
+} *///gpioClearRisingEdgeInterrupt
+
+/**
+ * \brief  This function sets specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioSetFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_FE_INTR, NULL);
+
+       return (retVal);
+
+}*/ //gpioSetFallingEdgeInterrupt
+
+/**
+ * \brief  This function clears specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioClearFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_FE_INTR, NULL);
+
+       return (retVal);
+}*/
+
+//#endif /* #if PLATFORM_GPIO_IN */
+
+/* Nothing past this point */
diff --git a/pasdk/common/evmc66x_gpio_dbg.h b/pasdk/common/evmc66x_gpio_dbg.h
new file mode 100644 (file)
index 0000000..0a0fab0
--- /dev/null
@@ -0,0 +1,566 @@
+/*
+ * Copyright (c) 2011-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       evmc66x_gpio.h
+ *
+ * \brief      This file is the header file for GPIO module
+ *
+ ******************************************************************************/
+
+#ifndef        _EVMC66X_GPIO_DBG_H_
+#define        _EVMC66X_GPIO_DBG_H_
+
+
+#include <ti\csl\csl_gpio.h>
+#include <ti\csl\soc\k2g\src\cslr_soc_baseaddress.h>
+/************************
+ * Defines and Macros
+ ************************/
+
+/** GPIO port 0 */
+#define GPIO_PORT_0                               (CSL_GPIO_0)
+/** GPIO port 1 */
+#define GPIO_PORT_1                           (CSL_GPIO_1)
+
+/** GPIO pin number 0 */
+#define GPIO_PIN_0    (0)
+/** GPIO pin number 1 */
+#define GPIO_PIN_1    (1)
+/** GPIO pin number 2 */
+#define GPIO_PIN_2    (2)
+/** GPIO pin number 3 */
+#define GPIO_PIN_3    (3)
+/** GPIO pin number 4 */
+#define GPIO_PIN_4    (4)
+/** GPIO pin number 5 */
+#define GPIO_PIN_5    (5)
+/** GPIO pin number 6 */
+#define GPIO_PIN_6    (6)
+/** GPIO pin number 7 */
+#define GPIO_PIN_7    (7)
+/** GPIO pin number 8 */
+#define GPIO_PIN_8    (8)
+/** GPIO pin number 9 */
+#define GPIO_PIN_9    (9)
+/** GPIO pin number 10 */
+#define GPIO_PIN_10    (10)
+/** GPIO pin number 11 */
+#define GPIO_PIN_11    (11)
+/** GPIO pin number 12 */
+#define GPIO_PIN_12    (12)
+/** GPIO pin number 13 */
+#define GPIO_PIN_13    (13)
+/** GPIO pin number 14 */
+#define GPIO_PIN_14    (14)
+/** GPIO pin number 15 */
+#define GPIO_PIN_15    (15)
+/** GPIO pin number 16 */
+#define GPIO_PIN_16    (16)
+/** GPIO pin number 17 */
+#define GPIO_PIN_17    (17)
+/** GPIO pin number 18 */
+#define GPIO_PIN_18    (18)
+/** GPIO pin number 19 */
+#define GPIO_PIN_19    (19)
+/** GPIO pin number 20 */
+#define GPIO_PIN_20    (20)
+/** GPIO pin number 21 */
+#define GPIO_PIN_21    (21)
+/** GPIO pin number 22 */
+#define GPIO_PIN_22    (22)
+/** GPIO pin number 23 */
+#define GPIO_PIN_23    (23)
+/** GPIO pin number 24 */
+#define GPIO_PIN_24    (24)
+/** GPIO pin number 25 */
+#define GPIO_PIN_25    (25)
+/** GPIO pin number 26 */
+#define GPIO_PIN_26    (26)
+/** GPIO pin number 27 */
+#define GPIO_PIN_27    (27)
+/** GPIO pin number 28 */
+#define GPIO_PIN_28    (28)
+/** GPIO pin number 29 */
+#define GPIO_PIN_29    (29)
+/** GPIO pin number 30 */
+#define GPIO_PIN_30    (30)
+/** GPIO pin number 31 */
+#define GPIO_PIN_31    (31)
+/** GPIO pin number 32 */
+#define GPIO_PIN_32    (32)
+/** GPIO pin number 33 */
+#define GPIO_PIN_33    (33)
+/** GPIO pin number 34 */
+#define GPIO_PIN_34    (34)
+/** GPIO pin number 35 */
+#define GPIO_PIN_35    (35)
+/** GPIO pin number 36 */
+#define GPIO_PIN_36    (36)
+/** GPIO pin number 37 */
+#define GPIO_PIN_37    (37)
+/** GPIO pin number 38 */
+#define GPIO_PIN_38    (38)
+/** GPIO pin number 39 */
+#define GPIO_PIN_39    (39)
+/** GPIO pin number 40 */
+#define GPIO_PIN_40    (40)
+/** GPIO pin number 41 */
+#define GPIO_PIN_41    (41)
+/** GPIO pin number 42 */
+#define GPIO_PIN_42    (42)
+/** GPIO pin number 43 */
+#define GPIO_PIN_43    (43)
+/** GPIO pin number 44 */
+#define GPIO_PIN_44    (44)
+/** GPIO pin number 45 */
+#define GPIO_PIN_45    (45)
+/** GPIO pin number 46 */
+#define GPIO_PIN_46    (46)
+/** GPIO pin number 47 */
+#define GPIO_PIN_47    (47)
+/** GPIO pin number 48 */
+#define GPIO_PIN_48    (48)
+/** GPIO pin number 49 */
+#define GPIO_PIN_49    (49)
+/** GPIO pin number 50 */
+#define GPIO_PIN_50    (50)
+/** GPIO pin number 51 */
+#define GPIO_PIN_51    (51)
+/** GPIO pin number 52 */
+#define GPIO_PIN_52    (52)
+/** GPIO pin number 53 */
+#define GPIO_PIN_53    (53)
+/** GPIO pin number 54 */
+#define GPIO_PIN_54    (54)
+/** GPIO pin number 55 */
+#define GPIO_PIN_55    (55)
+/** GPIO pin number 56 */
+#define GPIO_PIN_56    (56)
+/** GPIO pin number 57 */
+#define GPIO_PIN_57    (57)
+/** GPIO pin number 58 */
+#define GPIO_PIN_58    (58)
+/** GPIO pin number 59 */
+#define GPIO_PIN_59    (59)
+/** GPIO pin number 60 */
+#define GPIO_PIN_60    (60)
+/** GPIO pin number 61 */
+#define GPIO_PIN_61    (61)
+/** GPIO pin number 62 */
+#define GPIO_PIN_62    (62)
+/** GPIO pin number 63 */
+#define GPIO_PIN_63    (63)
+/** GPIO pin number 64 */
+#define GPIO_PIN_64    (64)
+/** GPIO pin number 65 */
+#define GPIO_PIN_65    (65)
+/** GPIO pin number 66 */
+#define GPIO_PIN_66    (66)
+/** GPIO pin number 67 */
+#define GPIO_PIN_67    (67)
+/** GPIO pin number 68 */
+#define GPIO_PIN_68    (68)
+/** GPIO pin number 69 */
+#define GPIO_PIN_69    (69)
+/** GPIO pin number 70 */
+#define GPIO_PIN_70    (70)
+/** GPIO pin number 71 */
+#define GPIO_PIN_71    (71)
+/** GPIO pin number 72 */
+#define GPIO_PIN_72    (72)
+/** GPIO pin number 73 */
+#define GPIO_PIN_73    (73)
+/** GPIO pin number 74 */
+#define GPIO_PIN_74    (74)
+/** GPIO pin number 75 */
+#define GPIO_PIN_75    (75)
+/** GPIO pin number 76 */
+#define GPIO_PIN_76    (76)
+/** GPIO pin number 77 */
+#define GPIO_PIN_77    (77)
+/** GPIO pin number 78 */
+#define GPIO_PIN_78    (78)
+/** GPIO pin number 79 */
+#define GPIO_PIN_79    (79)
+/** GPIO pin number 80 */
+#define GPIO_PIN_80    (80)
+/** GPIO pin number 81 */
+#define GPIO_PIN_81    (81)
+/** GPIO pin number 82 */
+#define GPIO_PIN_82    (82)
+/** GPIO pin number 83 */
+#define GPIO_PIN_83    (83)
+/** GPIO pin number 84 */
+#define GPIO_PIN_84    (84)
+/** GPIO pin number 85 */
+#define GPIO_PIN_85    (85)
+/** GPIO pin number 86 */
+#define GPIO_PIN_86    (86)
+/** GPIO pin number 87 */
+#define GPIO_PIN_87    (87)
+/** GPIO pin number 88 */
+#define GPIO_PIN_88    (88)
+/** GPIO pin number 89 */
+#define GPIO_PIN_89    (89)
+/** GPIO pin number 90 */
+#define GPIO_PIN_90    (90)
+/** GPIO pin number 91 */
+#define GPIO_PIN_91    (91)
+/** GPIO pin number 92 */
+#define GPIO_PIN_92    (92)
+/** GPIO pin number 93 */
+#define GPIO_PIN_93    (93)
+/** GPIO pin number 94 */
+#define GPIO_PIN_94    (94)
+/** GPIO pin number 95 */
+#define GPIO_PIN_95    (95)
+/** GPIO pin number 96 */
+#define GPIO_PIN_96    (96)
+/** GPIO pin number 97 */
+#define GPIO_PIN_97    (97)
+/** GPIO pin number 98 */
+#define GPIO_PIN_98    (98)
+/** GPIO pin number 99 */
+#define GPIO_PIN_99    (99)
+/** GPIO pin number 100 */
+#define GPIO_PIN_100    (100)
+/** GPIO pin number 101 */
+#define GPIO_PIN_101    (101)
+/** GPIO pin number 102 */
+#define GPIO_PIN_102    (102)
+/** GPIO pin number 103 */
+#define GPIO_PIN_103    (103)
+/** GPIO pin number 104 */
+#define GPIO_PIN_104    (104)
+/** GPIO pin number 105 */
+#define GPIO_PIN_105    (105)
+/** GPIO pin number 106 */
+#define GPIO_PIN_106    (106)
+/** GPIO pin number 107 */
+#define GPIO_PIN_107    (107)
+/** GPIO pin number 108 */
+#define GPIO_PIN_108    (108)
+/** GPIO pin number 109 */
+#define GPIO_PIN_109    (109)
+/** GPIO pin number 110 */
+#define GPIO_PIN_110    (110)
+/** GPIO pin number 111 */
+#define GPIO_PIN_111    (111)
+/** GPIO pin number 112 */
+#define GPIO_PIN_112    (112)
+/** GPIO pin number 113 */
+#define GPIO_PIN_113    (113)
+/** GPIO pin number 114 */
+#define GPIO_PIN_114    (114)
+/** GPIO pin number 115 */
+#define GPIO_PIN_115    (115)
+/** GPIO pin number 116 */
+#define GPIO_PIN_116    (116)
+/** GPIO pin number 117 */
+#define GPIO_PIN_117    (117)
+/** GPIO pin number 118 */
+#define GPIO_PIN_118    (118)
+/** GPIO pin number 119 */
+#define GPIO_PIN_119    (119)
+/** GPIO pin number 120 */
+#define GPIO_PIN_120    (120)
+/** GPIO pin number 121 */
+#define GPIO_PIN_121    (121)
+/** GPIO pin number 122 */
+#define GPIO_PIN_122    (122)
+/** GPIO pin number 123 */
+#define GPIO_PIN_123    (123)
+/** GPIO pin number 124 */
+#define GPIO_PIN_124    (124)
+/** GPIO pin number 125 */
+#define GPIO_PIN_125    (125)
+/** GPIO pin number 126 */
+#define GPIO_PIN_126    (126)
+/** GPIO pin number 127 */
+#define GPIO_PIN_127    (127)
+/** GPIO pin number 128 */
+#define GPIO_PIN_128    (128)
+/** GPIO pin number 129 */
+#define GPIO_PIN_129    (129)
+/** GPIO pin number 130 */
+#define GPIO_PIN_130    (130)
+/** GPIO pin number 131 */
+#define GPIO_PIN_131    (131)
+/** GPIO pin number 132 */
+#define GPIO_PIN_132    (132)
+/** GPIO pin number 133 */
+#define GPIO_PIN_133    (133)
+/** GPIO pin number 134 */
+#define GPIO_PIN_134    (134)
+/** GPIO pin number 135 */
+#define GPIO_PIN_135    (135)
+/** GPIO pin number 136 */
+#define GPIO_PIN_136    (136)
+/** GPIO pin number 137 */
+#define GPIO_PIN_137    (137)
+/** GPIO pin number 138 */
+#define GPIO_PIN_138    (138)
+/** GPIO pin number 139 */
+#define GPIO_PIN_139    (139)
+/** GPIO pin number 140 */
+#define GPIO_PIN_140    (140)
+/** GPIO pin number 141 */
+#define GPIO_PIN_141    (141)
+/** GPIO pin number 142 */
+#define GPIO_PIN_142    (142)
+/** GPIO pin number 143 */
+#define GPIO_PIN_143    (143)
+
+/** Number of GPIO pins per bank */
+#define GPIO_PINS_PER_BANK         (32)
+/** Maximum number of GPIO banks */
+#define GPIO_MAX_BANKS             (5)
+
+/** Maximum number of GPIO pins supported per instance */
+#define GPIO_MAX_NUMBER            ((GPIO_MAX_BANKS) * (GPIO_PINS_PER_BANK))
+
+/*
+ * \brief GPIO function returned result
+ */
+/** GPIO pin value is low */
+#define GPIO_LOW                   (0)
+/** GPIO pin value is high */
+#define GPIO_HIGH                  (1)
+/** Requested operation is successful */
+#define GPIO_RET_OK                (0)
+/** Requested operation is failed */
+#define GPIO_RET_FAIL              (1)
+/** Invalid GPIO pin/bank number error */
+#define INVALID_GPIO_NUMBER        (2)
+/** Invalid GPIO direction error */
+#define INVALID_GPIO_DIRECTION     (3)
+/** Invalid GPIO state error */
+#define        INVALID_GPIO_STATE         (4)
+/** Invalid GPIO port number error */
+#define        INVALID_GPIO_PORT          (5)
+
+/** Command to set GPIO pin direction */
+#define GPIO_CTRL_SET_DIR          (0)
+/** Command to set GPIO pin output */
+#define GPIO_CTRL_SET_OUTPUT       (1)
+/** Command to clear GPIO pin output */
+#define GPIO_CTRL_CLEAR_OUTPUT     (2)
+/** Command to read GPIO pin input */
+#define GPIO_CTRL_READ_INPUT       (3)
+/** Command to set rising edge interrupt */
+#define GPIO_CTRL_SET_RE_INTR      (4)
+/** Command to clear rising edge interrupt */
+#define GPIO_CTRL_CLEAR_RE_INTR    (5)
+/** Command to set falling edge interrupt */
+#define GPIO_CTRL_SET_FE_INTR      (6)
+/** Command to clear falling edge interrupt */
+#define GPIO_CTRL_CLEAR_FE_INTR    (7)
+
+/** GPIO function return type */
+typedef uint16_t GPIO_RET;
+
+/**
+ * \brief Options to configure GPIO pin direction
+ */
+typedef enum _GpioDirection
+{
+    GPIO_OUT = 0,  /**< Configures GPIO pin as output */
+    GPIO_IN        /**< Configures GPIO pin as input */
+} GpioDirection;
+
+/************************
+ * Function declarations
+ ************************/
+/**
+ * \brief  Returns base address of given GPIO port number.
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return CSL_GpioHandle\n
+ *
+ */
+CSL_GpioHandle GPIOGetRegBaseAddr(uint8_t gpioPortNumber);
+
+/**
+ * \brief  Initializes the GPIO peripheral
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ *
+ */
+GPIO_RET GPIOInit(uint8_t gpioPortNumber);
+
+/**
+ * \brief  This function configures the specified GPIO's direction
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ * \param   direction      [IN]    GPIO pin direction
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetDirection(uint8_t gpioPortNumber, uint8_t pinNum,
+                          GpioDirection direction);
+
+/**
+ * \brief  This function sets the specified GPIO's pin state to 1
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetOutput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function Clears the specified GPIO's pin state to 0
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOClearOutput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function gets the specified GPIO's pin state
+ *
+ * The specified GPIO should be configured as input
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      uint32_t - Input state of GPIO if success
+ * \n                          - else GPIO status
+ */
+uint32_t GPIOReadInput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function Enables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+//GPIO_RET GPIOEnableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum);
+
+/**
+ * \brief  This function Disables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+//GPIO_RET GPIODisableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum);
+
+/**
+ * \brief  This function sets specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOSetRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function clears specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOClearRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function sets specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOSetFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function clears specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOClearFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+#endif /* _EVMC66X_GPIO_H_ */
+
+/* Nothing past this point */
index 40968aa3b42d628bdb449a3242b1bfdf768e3e34..1c6048d0b1e379d139cb5ca54397891f5dd21e86 100644 (file)
@@ -11,8 +11,8 @@
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
@@ -70,7 +70,7 @@
                                                        <tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1227706836" name="GNU Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug">
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.DEFINE.1708873009" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.DEFINE" valueType="definedSymbols">
                                                                        <listOptionValue builtIn="false" value="k2g02"/>
-                                                                       <listOptionValue builtIn="false" value="PAF_SYS_FRAMELENGTH=512"/>
+                                                                       <listOptionValue builtIn="false" value="PAF_SYS_FRAMELENGTH=1024"/>
                                                                        <listOptionValue builtIn="false" value="arm0"/>
                                                                        <listOptionValue builtIn="false" value="ARMCOMPILE"/>
                                                                        <listOptionValue builtIn="false" value="PAF_DEVICE=0xDA000000"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/ddp/Dolby_Digital_Plus_Decoder_Imp/Source_Code/alg&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/ddp/Dolby_Digital_Plus_Decoder_Imp/Source_Code/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/mat-thd/Dolby_MAT_Decoder_Imp/Source_Code/alg&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${PDK_INSTALL_PATH}&quot;"/>
                                                                </option>
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.MFLOAT_ABI.576208136" name="Specify if floating point hardware should be used (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OTHER_PREPROC_FLAGS.1983639225" name="Other preprocessor flags (-Xpreprocessor)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OTHER_PREPROC_FLAGS"/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
index 38820aeb6a6d64f712329c81a800234ba9590cc2..62ce3f743c33d0384f6b66f791ec9ce4ea34dee6 100644 (file)
@@ -119,6 +119,10 @@ UInt32 gSlaveDecDecodeCnt       =0;
 UInt32 gSlaveDecDeactivateCnt   =0;
 
 
+// FL: (***) debug
+#include "evmc66x_gpio_dbg.h"
+
+
 /*
  *  ======== taskAsdpFxn ========
  *  Audio Stream Decode Processing task function
@@ -709,6 +713,7 @@ Void taskAsdpFxn(
                         //    Log_info0("capAfWrite() error");
                         //}                        
 
+                        GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
                         cbErrno = cbWriteAf(pCbCtl, z, pAfWrt);
                         if (cbErrno < 0)
                         {
@@ -730,8 +735,21 @@ Void taskAsdpFxn(
                                 }
                             }
                         }
+                        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
                         TRACE_TERSE0("Dec:cbWriteAf() complete");
                         
+#if 1 // (***) FL: shows timing of CB write
+                        /// (***) debug // B9
+                        //{
+                        //    static Uint8 toggleState = 0;
+                        //    if (toggleState == 0)
+                        //        GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
+                        //    else
+                        //        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
+                        //    toggleState = ~(toggleState);
+                        //}
+#endif        
+                        
                         // FL: debug, log circular buffer control variables
                         cbLog(pCbCtl, z, 1, "cbWriteAf");
                     }
index 62546f7d8f20b650dedad41b02af205a6e746692..33c5a1ad70d65e4f8e561669ebd1fbe654bc34fc 100644 (file)
@@ -11,8 +11,8 @@
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
@@ -68,7 +68,7 @@
                                                        <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderDebug.1984605958" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderDebug"/>
                                                        <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug.1216493005" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug">
                                                                <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE.903477341" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE" valueType="definedSymbols">
-                                                                       <listOptionValue builtIn="false" value="PAF_SYS_FRAMELENGTH=512"/>
+                                                                       <listOptionValue builtIn="false" value="PAF_SYS_FRAMELENGTH=1024"/>
                                                                        <listOptionValue builtIn="false" value="dsp0"/>
                                                                        <listOptionValue builtIn="false" value="k2g02"/>
                                                                        <listOptionValue builtIn="false" value="SOC_K2G"/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
index b8154d2ee1deff0f6b5cee131a4ed07b0a357e98..a4827864b0d8aa74736784ba90993c3d6c30dd8a 100644 (file)
@@ -119,9 +119,11 @@ PAF_ASOT_Config gPAF_ASOT_config = {
     &gPAF_AST_config    // pAstCfg
 };
 
-// Underflow threshold before returning error to Top-Level FSM
-#define DEC_OP_CB_RDAF_UND_THR  ( 20 ) // FL: arbitrary setting
-UInt32 gDecOpCbRdAfUnd  =0; // decoder output circular buffer underflow count
+// Underflow threshold before circular buffer reset and return error to Top-Level FSM
+#define DEC_OP_CB_RDAF_UND_THR  ( 80 ) // FL: arbitrary setting
+UInt32 gCbReadAfErr         =0; // read circular buffer error count, not including underflows
+UInt32 gDecOpCbRdAfUnd      =0; // decoder output circular buffer underflow count
+UInt32 gMaxDecOpCbRdAfUnd   =0; // max (consecutive) decoder output circular buffer underflow count
 
 // Global debug counters */
 UInt32 gTaskAsopCnt=0; // debug
@@ -131,6 +133,8 @@ UInt32 gAsopEncodeCnt   =0;
 UInt32 gAsopFinalCnt    =0;
 UInt32 gAsopQuitCnt     =0;
 
+// FL: (***) debug
+#include "evmc66x_gpio_dbg.h"
 
 /*
  *  ======== taskAsopFxn ========
@@ -1658,6 +1662,10 @@ PAF_ASOT_decodeInit(
             SW_BREAKPOINT; // FL: debug
             return errno;
         }
+        gCbReadAfErr=0;         // reset read circular buffer error count
+        gDecOpCbRdAfUnd=0;      // reset decoder output circular buffer underflow count
+        gMaxDecOpCbRdAfUnd=0;   // reset max decoder output circular buffer underflow count
+        
         // FL: debug
         cbLog(pCbCtl, z, 1, "PAF_ASOT_decodeInit:cbReadStart");
     }
@@ -1852,7 +1860,60 @@ PAF_ASOT_decodeStream(
         // Read decoder output circular buffer
         //
         pAfRd = pAstCfg->xStr[zS].pAudioFrame;
+        GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106);
         cbErrno = cbReadAf(pCbCtl, z, pAfRd);
+        if ((cbErrno < 0) && (cbErrno != ASP_DECOP_CB_READ_UNDERFLOW))
+        {
+            gCbReadAfErr++;
+            TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
+            //SW_BREAKPOINT; // FL: debug
+            return cbErrno;
+        }
+
+        // Handle underflows
+        if (cbErrno == ASP_DECOP_CB_READ_UNDERFLOW)
+        {
+            // FL: some number of underflows alway occur on start of stream when ASOT only depends on configured Output.
+            //     DDP: ~2 underflows
+            //     MAT-THD: ~16 underflows
+            // Need to check behavior of cbReset().
+            // Need to check behavior on exit/re-entry into Output processing.
+            
+            gDecOpCbRdAfUnd++; // increment circular buffer underflow count
+            if (gDecOpCbRdAfUnd >= DEC_OP_CB_RDAF_UND_THR) 
+            {
+                // Underflow count above threshold.
+                // (1) set max underflow count to threshold
+                // (2) reset underflow count
+                // (3) reset circular buffer
+                
+                gMaxDecOpCbRdAfUnd = DEC_OP_CB_RDAF_UND_THR; // update max underflow count
+                gDecOpCbRdAfUnd = 0; // reset underflow count
+
+                // Reset circular buffer
+                cbReset(pCbCtl, z);
+                Log_info0("PAF_ASOT_decodeStream:cbReset");
+            
+                return cbErrno;
+            }
+        }
+        else if ((cbErrno == ASP_DECOP_CB_SOK) && (gDecOpCbRdAfUnd > 0))
+        {
+            // No underflow detected.
+            // update max underflow count,
+            // reset underflow count
+            
+            // update max underflow count
+            if (gDecOpCbRdAfUnd > gMaxDecOpCbRdAfUnd)
+            {
+                gMaxDecOpCbRdAfUnd = gDecOpCbRdAfUnd;
+            }
+            gDecOpCbRdAfUnd = 0; // reset circular buffer underflow count
+        }
+        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+        
+        
+#if 0
         if (cbErrno != 0)
         {
             TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
@@ -1873,7 +1934,23 @@ PAF_ASOT_decodeStream(
                 }
             }
         }
-        //Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");
+        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+        Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");
+#endif
+        
+
+
+#if 1 // (***) FL: shows timing of CB read
+            //// (***) debug // B8
+            //{
+            //    static Uint8 toggleState = 0;
+            //    if (toggleState == 0)
+            //        GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106);
+            //    else
+            //        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+            //    toggleState = ~(toggleState);
+            //}
+#endif
 
         // FL: debug
         cbLog(pCbCtl, z, 1, "PAF_ASOT_decodeStream:cbReadAf");
index 365b6cb8a51c7a2ef7570279d5244951ddfbb2af..7b141dc77e94ccb10abea947f382e199afae3b24 100644 (file)
@@ -82,6 +82,10 @@ Int gSysInit=0;
 
 #define SYS_INIT_SLEEP  100
 
+// FL: debug
+#include "evmc66x_pinmux.h"
+#include "evmc66x_gpio_dbg.h"
+
 /*
  *  ======== taskSysInitFxn ========
  *  System Initializations task function
@@ -179,7 +183,21 @@ Void taskSysInitFxn(Void)
     PAF_ASOT_params_fxns.memStatusPrint = PAF_ALG_memStatusPrint;
 #endif
 
-
+    // FL: debug
+    // Any of these can be used on ARM, but DSP must configure the GPIO since pinMuxSetMode() is only available on DSP
+    pinMuxSetMode(101,PADCONFIG_MUX_MODE_QUATERNARY); // PAD101 to QUATERNARY, GPIO (B5 on AudioDaughterCard J12)
+    GPIOSetDirection(GPIO_PORT_0, GPIO_PIN_99, GPIO_OUT); // GPIO0,pin99 output
+    GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_99);
+    GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_99);
+    pinMuxSetMode(117,PADCONFIG_MUX_MODE_QUATERNARY); // PAD117 to QUATERNARY, GPIO (B8 on AudioDaughterCard J12)
+    GPIOSetDirection(GPIO_PORT_0, GPIO_PIN_106, GPIO_OUT); // GPIO0,pin106 output
+    GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106);
+    GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+    pinMuxSetMode(118,PADCONFIG_MUX_MODE_QUATERNARY); // PAD118 to QUATERNARY, GPIO (B9 on AudioDaughterCard J12)
+    GPIOSetDirection(GPIO_PORT_0, GPIO_PIN_107, GPIO_OUT); // GPIO0,pin107 output
+    GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
+    GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
+    
     /* This is required to use SYS alpha codes in atboot? */
     Log_info0("taskSysInitFxn:TaskSystemStream resume");
     gSysInit = 0;