]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pasdk/common/dbgDib.h
Cleaned up code repetitions of messaging and shared memory read/write.
[processor-sdk/performance-audio-sr.git] / pasdk / common / dbgDib.h
2 /*
3 Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without 
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 #include <math.h> // sin
37 #include <xdc/std.h>
39 #include "inpbuf.h"
41 //#define CAP_IB_PCM
42 #ifdef CAP_IB_PCM
43 // IB capture (PCM) buffer parameters
44 #define CAP_IB_PCM_MAX_NUM_CH           ( 8 )
45 #define CAP_IB_PCM_MAX_NUM_FRAME        ( 100 )
46 #define CAP_IB_PCM_MAX_SAMP_PER_FRAME   ( 256 )
47 #define CAP_IB_PCM_MAX_NUM_SAMP         ( CAP_IB_PCM_MAX_NUM_FRAME * CAP_IB_PCM_MAX_SAMP_PER_FRAME )
49 // IB capture (PCM) buffer
50 extern Int32 gCapIpPcmBuf[CAP_IB_PCM_MAX_NUM_CH][CAP_IB_PCM_MAX_NUM_SAMP];
51 extern Int32 gCapIbPcmBufIdx;
52 extern Int32 gCapIbPcmBufWrapCnt;
53 #endif // CAP_IB_PCM
55 #define CAP_IP
56 #ifdef CAP_IP
57 // IB capture buffer parameters
58 //#define CAP_IB_MAX_NUM_FRAME        ( 938 )
59 #define CAP_IB_MAX_NUM_FRAME        ( 2000 )
60 //#define CAP_IB_MAX_BYTES_PER_FRAME  ( 24576 ) // for DDP
61 #define CAP_IB_MAX_BYTES_PER_FRAME  ( 2*30720 ) // for MAT-THD
62 #define CAP_IB_BUF_SZ               ( CAP_IB_MAX_NUM_FRAME * CAP_IB_MAX_BYTES_PER_FRAME )
64 // IB capture buffer
65 extern Int8 gCapIpBuf[2][CAP_IB_BUF_SZ];
66 extern Int32 gCapIbBufIdx[2];
67 extern Int32 gCapIbBufWrapCnt[2];
68 extern Int8 gCapIbBufPingPongSel;
69 #endif // CAP_IP
71 // Generate sinusoids in IB buffer
72 Void genSinIb(
73     PAF_InpBufConfig *pInpBufConfig
74 );
76 // Capture data in IB buffer (PCM) to memory
77 Void capIbPcm(
78     PAF_InpBufConfig *pInpBufConfig
79 );
81 // Reset IB capture buffer
82 Int capIbReset(Void);
84 // Capture data in IB buffer to memory
85 Void capIb(
86     PAF_InpBufConfig *pInpBufConfig
87 );