1 #include <math.h> // sin
2 #include <xdc/std.h>
4 #include "inpbuf.h"
6 //#define CAP_IB_PCM
7 #ifdef CAP_IB_PCM
8 // IB capture (PCM) buffer parameters
9 #define CAP_IB_PCM_MAX_NUM_CH ( 8 )
10 #define CAP_IB_PCM_MAX_NUM_FRAME ( 100 )
11 #define CAP_IB_PCM_MAX_SAMP_PER_FRAME ( 256 )
12 #define CAP_IB_PCM_MAX_NUM_SAMP ( CAP_IB_PCM_MAX_NUM_FRAME * CAP_IB_PCM_MAX_SAMP_PER_FRAME )
14 // IB capture (PCM) buffer
15 extern Int32 gCapIpPcmBuf[CAP_IB_PCM_MAX_NUM_CH][CAP_IB_PCM_MAX_NUM_SAMP];
16 extern Int32 gCapIbPcmBufIdx;
17 extern Int32 gCapIbPcmBufWrapCnt;
18 #endif // CAP_IB_PCM
20 #define CAP_IP
21 #ifdef CAP_IP
22 // IB capture buffer parameters
23 #define CAP_IB_MAX_NUM_FRAME ( 938 )
24 #define CAP_IB_MAX_BYTES_PER_FRAME ( 24576 )
25 #define CAP_IB_BUF_SZ ( CAP_IB_MAX_NUM_FRAME * CAP_IB_MAX_BYTES_PER_FRAME )
27 // IB capture buffer
28 extern Int8 gCapIpBuf[2][CAP_IB_BUF_SZ];
29 extern Int32 gCapIbBufIdx[2];
30 extern Int32 gCapIbBufWrapCnt[2];
31 extern Int8 gCapIbBufPingPongSel;
32 #endif // CAP_IP
34 // Generate sinusoids in IB buffer
35 Void genSinIb(
36 PAF_InpBufConfig *pInpBufConfig
37 );
39 // Capture data in IB buffer (PCM) to memory
40 Void capIbPcm(
41 PAF_InpBufConfig *pInpBufConfig
42 );
44 // Reset IB capture buffer
45 Int capIbReset(Void);
47 // Capture data in IB buffer to memory
48 Void capIb(
49 PAF_InpBufConfig *pInpBufConfig
50 );