Hello everyone,
can anyone please tell me about "how can I use <dsk6713_aic23.h> with rxdx"
below source code for connect with labview
target.h make error with dsk6713_aic23.h
and target.h obligatory for connecting with labview
so I can't remove target.h but I need aic23.h
because I want input & output digital sound wave processing
and I usually used function "input_sample()" for input sound but this function included in aic23.h
I really wish to anyone reply for me about this problem
Thanks for reading
-------------------------------------------------------------------------------------------------------------------------------
//rtdx_lv_gain.c RTDX using LABVIEW to control gain from DSK of generated sine wave
//#include "dsk6713_aic23.h"
//Uint32 fs=DSK6713_AIC23_FREQ_8KHZ;
#include <rtdx.h> //RTDX support
#include "target.h" //init target
#include <stdio.h>
#define kBUFFER_SIZE 49
RTDX_CreateInputChannel(cinput); //create RTDX input channel
RTDX_CreateInputChannel(cgain); //input channel for gain value
RTDX_CreateOutputChannel(coutput); //channel for scaled output
RTDX_CreateInputChannel(testval); //new
void Gain (int *output,int *input,int gain) //scale array of input array
{
int i;
for(i=0; i<kBUFFER_SIZE; i++)
output[i]=input[i]*gain; //scaled output
}
void main()
{
int input[kBUFFER_SIZE];
int output[kBUFFER_SIZE];
int gain = 5; //initial gain setting
int testin = 12;
int testout;
TARGET_INITIALIZE(); //init target for RTDX
RTDX_enableInput(&cgain); //enable RTDX channels
RTDX_enableInput(&cinput); //for input array
RTDX_enableOutput(&coutput); //for output array
RTDX_enableInput(&testval);
for (;;) //infinite loop
{
if (!RTDX_channelBusy(&cgain)) //if new gain value
{
RTDX_readNB(&cgain, &gain, sizeof(gain)); //read it
printf("gain : %d\n", gain);
}
if (!RTDX_channelBusy(&testval)) //if new gain value
{
RTDX_readNB(&testval, &testin, sizeof(testin)); //read it
printf("testin : %d\n", testin);
}
while(!RTDX_read(&cinput,input,sizeof(input)));//wait for input waveform
Gain (output, input, gain); //call function to scale
RTDX_write(&coutput, &output, sizeof(input)); //scaled output from DSK->host
}
}
--------------------------------------------------------------------------------------------------------------------------