diff --git a/include/ad9915.h b/include/ad9915.h index 569dcdc..84f0d7f 100644 --- a/include/ad9915.h +++ b/include/ad9915.h @@ -81,14 +81,3 @@ int continuePhaseSweep (int fd, int f_dds,double fclk,double dphiUp, double dphi //fin fonctions rampes hardwares -// fonctions rampes softwares - -int rampAmpFromSoft(int fd, int f_dds,double DeltaTimeUp,double AIni, double AFin); - -int rampPhaseFromSoft(int fd, int f_dds,double DeltaTimeUp,double PhiIni, double PhiFin); - -// fin fonctoins rampes softwares - - - - diff --git a/src/ad9915.c b/src/ad9915.c index 9213645..ac15d98 100644 --- a/src/ad9915.c +++ b/src/ad9915.c @@ -1007,131 +1007,6 @@ int continuePhaseSweep (int fd, int f_dds,double fclk,double dphiUp, double dphi //-------------------------FIN FONCTIONS RAMPES HARDWARES -//--------------------------FONCTIONS RAMPES SOFTWARES - -int rampAmpFromSoft(int fd, int f_dds,double DeltaTimeUp,double AIni, double AFin) -{ - - //On va plutôt fixé dA sinon trop de contrainte : => Besoin d'allocation dynamique - double dA=0.024;//en % - double DeltaAmp = AIni-AFin; - double AbsDeltaAmp = 0; - if(DeltaAmp>=0) - { - AbsDeltaAmp = DeltaAmp; - } - else - { - AbsDeltaAmp = -1*DeltaAmp; - } - - int NumberPoints = AbsDeltaAmp/dA; - - double dt=DeltaTimeUp/NumberPoints; - - printf("Taille du tableau = %d\n", NumberPoints); - printf("dt = %f s\n",dt); - - - uint16_t* ArrayWordAmp= NULL; - ArrayWordAmp = malloc(NumberPoints*sizeof(uint16_t)); - - //extraction de la phase initiale et de l'amplitude - - uint32_t ReadPhaseAmpWord = 0x00000000; - readRegister(fd, 0x0c,&ReadPhaseAmpWord); - printf("ReadPhaseAmpWord = %.8x \n", ReadPhaseAmpWord); - - uint16_t WordPhaseInitiale = ReadPhaseAmpWord&0xFFFF; - printf("Phase = %.4x \n", WordPhaseInitiale); - - - // - for(int i=0;i>8&0xFF,ArrayWordAmp[i]&0xFF,WordPhaseInitiale>>8&0xFF,WordPhaseInitiale&0xFF); - sendIOUpdate(f_dds); - usleep(1000000*dt); - } - - - - - return EXIT_SUCCESS; -} - -int rampPhaseFromSoft(int fd, int f_dds,double DeltaTimeUp,double PhiIni, double PhiFin) -{ - - //On va plutôt fixé dphi : => Besoin d'allocation dynamique - double dphi=0.06;//en ° - double DeltaPhi = PhiIni-PhiFin; - double AbsDeltaPhi = 0; - if(DeltaPhi>=0) - { - AbsDeltaPhi = DeltaPhi; - } - else - { - AbsDeltaPhi = -1*DeltaPhi; - } - - int NumberPoints = AbsDeltaPhi/dphi; - - double dt=DeltaTimeUp/NumberPoints; - - printf("Taille du tableau = %d\n", NumberPoints); - printf("dt = %f s\n",dt); - - - uint16_t* ArrayWordPhi= NULL; - ArrayWordPhi = malloc(NumberPoints*sizeof(uint16_t)); - - //extraction de l'amplitude - - uint32_t ReadPhaseAmpWord = 0x00000000; - readRegister(fd, 0x0c,&ReadPhaseAmpWord); - printf("ReadPhaseAmpWord = %.8x \n", ReadPhaseAmpWord); - - uint16_t WordAmpInitiale = ReadPhaseAmpWord>>16&0xFFFF; - printf("Amp = %.4x \n", WordAmpInitiale); - - - for(int i=0;i>8&0xFF,WordAmpInitiale&0xFF,ArrayWordPhi[i]>>8&0xFF,ArrayWordPhi[i]&0xFF); - sendIOUpdate(f_dds); - usleep(1000000*dt); - } - - - return EXIT_SUCCESS; -} - - - -//-------------------------FIN FONCTIONS RAMPES SOFTWARES - - int receiveParameterFromPythonServer(char * device, double f_clk, double f_out){